Skip to main content

Python API for the Geodesic Datascience Platform

Project description

geodesic-python-api

Build codecov

The python API for interacting with SeerAI's Geodesic system. Documentation can be found at docs.seerai.space/geodesic

Contributing

To setup a development environment for geodesic we recommend first creating a conda environment.

conda create -n geodesic-dev python=3.8
conda activate geodesic-dev

You will also need to install GDAL for some applications as well as nodejs and yarn to build the jupyter widgets. This is easiest to do through conda.

conda install gdal nodejs=16 yarn=1.22.19 arcgis -c conda-forge -c esri -y 

This will allow proper building of the widgets. NOTE: this is only required when you install from a cloned repo.

Once this finishes you can proceed to installing geodesic.

After cloning the repo you can install with pip. There are several install options depending on which packages you would like installed. For development we recommend installing the dev packages with the dev extras identifier. This will install all packages needed to use all parts of the geodesic api as well as some packages used for testing.

pip install .[dev]

When adding or modifying any code you should also add to the documentation if necessary and make sure that it builds and renders correctly. You can find instructions for modifying and building the docs sources in the README in the docs/ folder. The CI/CD will also build docs when a PR is created and provide a link to them. It is a good idea to check this after your PR finishes building to make sure any of your added documentation is displayed correctly.

Code Formatting

In geodesic, we use the black code formatter. If you are developing in VSCode, this should be set to your default formatter in Python settings. You can install black via pip:

pip install black

In the VSCode Settings, make sure "Format On Save" is enabled and set Python > Formatting: Provider to "black".

We override the default line length to be 100 lines. This can be done in your settings under Python > Formatting: Black Args. Add the following to the list of args:

--line-length
100

Testing

To run unit tests and see coverage, in the root directory run:

coverage run -m pytest
coverage report --omit=test/*

CLI

This library installs with a command line tool geodesic that allows you to authenticate or configure which geodesic cluster you are pointed at.

Examples:

$ geodesic authenticate
To authorize access needed by Geodesic, open the following URL in a web browser and follow the instructions. If the web browser does not start automatically, please manually browse the URL below.

    https://seerai.us.auth0.com/authorize?client_id=RlCTevNLPn0oVzmwLu3R0jCF7tfakpq9&scope=email+openid+profile+picture+admin+offline_access+entanglement%3Aread+entanglement%3Awrite+spacetime%3Aread+spacetime%3Awrite+tesseract%3Aread+tesseract%3Awrite+boson%3Aread+boson%3Awrite+krampus%3Aread&redirect_uri=https%3A%2F%2Fseerai.space%2FauthPage&audience=https%3A%2F%2Fgeodesic.seerai.space&response_type=code&code_challenge=ABC&code_challenge_method=S256

The authorization workflow will generate a code, which you should paste in the box below.
Enter verification code: XXXXXXXXX
$ geodesic get clusters
[*] seerai
$ geodesic get active-config
{
    "host": "https://geodesic.seerai.space",
    "name": "seerai",
    "oauth2": {
        "audience": "https://geodesic.seerai.space",
        "authorization_uri": "https://seerai.us.auth0.com/authorize",
        "client_id": "RlCTevNLPn0oVzmwLu3R0jCF7tfakpq9",
        "client_secret": "EY5_-6InmoqYSy1ZEKb7vGiUrCTE1JapTtBncaP_w_0_IhuSilZw1YS6pqoJ0n75",
        "redirect_uri": "https://seerai.space/authPage",
        "token_uri": "https://seerai.us.auth0.com/oauth/token"
    }
}
$ geodesic set cluster seerai

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

geodesic_api-0.47.1-py3-none-any.whl (2.7 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page