Skip to main content

A client library for accessing the Nile API

Project description

Installing

The Nile Python SDK is available on PyPI, and can be installed via:

pip install nile-api

(in a virtual environment as appropriate).

Usage

Usage examples of the SDK can be found in the Nile examples repository, within the directories with -python in their name.

Development

Commands below generally make use of nox (in some sense a Python-based, testing-centric make).

You can install it by following its install instructions for your OS, or e.g. on macOS, by simply running:

brew install nox

Regenerating (updating) the client is done via openapi-python-client.

To do so, run:

nox -s regenerate

You will want to test the results. First, validate that the client generated with the expected structure (packages and modules):

To do so, run:

nox -s tests

Then you’ll want to do a quick smoke test and make sure the client actually works against Nile. Currently we do it by running https://github.com/TheNileDev/examples/tree/main/quickstart-python example. Before running it you’ll want to make sure that running the example will use the local client and not an installed one.

From the local nile-py repository directory run:

export PYTHONPATH=`pwd`:$PYTHONPATH
venv/bin/python -c "import nile_api; print(str(nile_api.__path__))"
cd ../examples/quickstart-python
./venv/bin/python src/all.py

We pin the version of this generator itself in a requirements file. To update the version of the generator that will be used, run:

nox -s update_openapi_requirements

which should regenerate the openapi-generator-requirements.txt file which you should then commit.

Project details


Download files

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

Source Distribution

nile_api-0.2.5.tar.gz (40.8 kB view hashes)

Uploaded Source

Built Distribution

nile_api-0.2.5-py3-none-any.whl (108.3 kB 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