Getting Started - Setting up your Python environment

Modified on Tue, 24 Jun at 12:28 PM

To begin using the inmydata Agent API, you'll need to set up your development environment properly. This includes creating a virtual environment and configuring the necessary environment variables.


1. Create a Python Virtual Environment

It's best practice to isolate your project dependencies using a virtual environment.

Steps:

Create the environment:

bash
python -m venv venv

Activate the environment:

  • On macOS/Linux:

    bash
    source venv/bin/activate
  • On Windows:

    bash
    venv\Scripts\activate

Upgrade pip (optional but recommended):

bash
pip install --upgrade pip

Install the inmydata SDK:

bash
pip install inmydata

 

2. Set Required Environment Variables

To authenticate and configure your connection to the inmydata Agent API, you'll need to set the following environment variables:

Required Variables

VariableDescription
INMYDATA_API_KEYYour personal API key used to authenticate with inmydata
INMYDATA_TENANTYour organization’s tenant name (e.g. demo for https://demo.inmydata.com)
INMYDATA_CALENDARThe name of the calendar you want your agent to use

How to Obtain Each Variable

? INMYDATA_API_KEY

  1. Log in to inmydata (or your tenant-specific domain, e.g. https://demo.inmydata.com).

  2. Open the User menu (usually found in the top right).

  3. Click "API Keys".

  4. Press "Create a new API key".

? The API key grants data access based on the user’s privileges. Treat it like a password—do not share or commit it to version control.


? INMYDATA_TENANT

Your tenant is the subdomain you use to log in to inmydata.
For example:

  • If you access the platform via https://demo.inmydata.com, your tenant is demo.

  • If your organization logs in at https://acme.inmydata.com, your tenant is acme.


? INMYDATA_CALENDAR

  1. Log in to inmydata.

  2. From the Settings menu, select "Edit Calendars".

  3. Choose the name of the calendar you want your agent to use and set this as your value.


3. Loading Environment Variables in Your Project

As detailed above, we recommend using a .env file for local development.

.env example:

ini
INMYDATA_API_KEY=your_api_key INMYDATA_TENANT=your_tenant INMYDATA_CALENDAR=your_calendar_name

Load these in your Python script using:

python
from dotenv import load_dotenv import os load_dotenv() api_key = os.getenv("INMYDATA_API_KEY")
tenant = os.getenv("INMYDATA_TENANT")
calendar = os.getenv("INMYDATA_CALENDAR")


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article