Getting Started
If you are ready to jump in, this page will get you started with the Geodesic python API. This is intended to get the API installed and authenticated quickly but we recommend that if this is your first time using Geodesic we recommend that you read the overview guides.
Installation
You will want to use some sort of virtual environment to manage your python libraries. This ensures that you do not have version conflicts with any other projects you might have that also use python. We recommend Conda as it has the easiest installation options for libraries that need binaries.
To install miniconda (the lightweight Conda package manager) follow instructions here.
Once conda is installed we can create a virtual environment:
conda create -n geodesic python=3.10
conda activate geodesic
You can then install the Geodesic API through pip. There are a few installation options including installing all dependencies or only installing minimal dependencies to work. For getting started we recommend installing all dependencies. To install all dependencies along with the Geodesic API, run:
pip install geodesic-api[all]
Using the API
To use the Geodsic API you must first authenticate with the platform. This can be done either from python or from the command line.
CLI Authentication
$ geodesic authenticate
Attempting to authenticate and save code automatically...
Successfully saved authorization token.
Python Authentication
Python authentication can be done either in the python interpreter or a Jupyter environment.
import geodesic
geodesic.authenticate()
The rest of the process is the same as the CLI authentication. You will not need to log in each time you use the API. The credentials stored are long lived.
Create a project
To create a project, you can use the create_project
method. This will create a new project in your
Geodesic account. In Geodesic, all commands are run in the current active project uless otherwise
specified. You can set the newly created project as the active project by setting the
set_as_active
parameter to True
.
geodesic.create_project(
name='my_new_project'
alias='My New Project'
description='My New Project Description',
set_as_active=True
)
Next Steps
Now that you have the Geodesic API installed and authenticated, you can start using it to create and manage your projects, datasets, and objects. You can explore the Python API Reference for more information on the available methods and classes, or you can jump into the Tutorials to learn how to use the API in practice.
Tutorials
Detailed tutorials on how to use different parts of the Geodesic API. EEverything from creating projects, to adding datasets, to building knowledge graphs.
Geodesic Python API Reference
Reference documentation for the Geodesic Python API. This includes detailed information on classes, methods, and attributes available in the API.