Getting started π―
Prerequisites
Before starting, you will need the following:
- Python βοΈ (opens in a new tab) 3.8+.
- Poetry βοΈ (opens in a new tab).
- uAgents framework βοΈ (opens in a new tab).
Set up the project and virtual environment
First of all, create a mobility-integrations
folder for your project files: mkdir mobility-integrations
. Then, create another src
sub-folder within it for your scripts: mkdir src
.
To run the example, you will need API keys from:
-
OPENCHARGEMAP API KEY
- Visit the OpenChargeMap API βοΈ (opens in a new tab).
- If you don't have an account, create one by signing up.
- Once you are logged in, click on the MY PROFILE > my apps at the top.
- Click on REGISTER AN APPLICATION button.
- Fill out the required information in the form, including the purpose of using the API, and submit the request.
- Once approved, you will see your
OPENCHARGEMAP_API_KEY
under MY API KEYS.
-
GEOAPI API KEY πΊοΈ
- Go to the Geoapify βοΈ (opens in a new tab).
- Sign in to your Google account or create a new one if you don't have an existing account.
- Once you are logged in, create a new project by clicking on the "Add a new project" button under the Projects section.
- Give your project a name and click "OK" to create the new project.
- Your
GEOAPI_API_KEY
will be generated. Copy this key and keep it secure, as it will be used to access Geoapify Projects and other services.
Once you retrieve the information above, create a .env
file in the mobility-integrations
directory and export the obtained API keys as environment variables:
export OPENCHARGEMAP_API_KEY="{GET THE API KEY}"
export GEOAPI_API_KEY="{GET THE API KEY}"
To use the environment variables from .env
file and install the project dependencies:
source .env
poetry install
We can now start defining our agents and messages data model.