Python library for the ProKnow API.
Project description
ProKnow DS - Python SDK
The ProKnow DS - Python SDK library provides convenient access to the ProKnow API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.
Documentation
Complete documentation is available on Read the Docs.
Development
Mac OSX
Initializing a Development Environment
- Install the latest version of Python 3.8. This will be installed alongside the version that your operating system provides.
- Run the following.
$ python3 -m venv env
$ source env/bin/activate
(env) $ pip install --upgrade pip
(env) $ pip install -r requirements.txt
(env) $ pip install -e .
Deactivate your virtual environment with the deactivate
command. As long as the environment is not removed, you may start sessions simply with the command source env/bin/activate
.
Note: If you wish to update the requirements with new or updated packages, run the following.
(env) $ pip freeze --exclude-editable > requirements.txt
Testing
Before you start testing, you'll need access to a ProKnow DS organization where you can generate an API token for your project. Once you have your API token create a file called pktestconfig.py
in the root of this project with the following contents:
#!/usr/bin/env python
base_url = "https://example.proknow.com"
credentials_id = "{{ id from credentials.json }}"
credentials_secret = "{{ secret from credentials.json }}"
Make sure to put your actual base_url and the id and secret from your credentials.json
file in place of the placeholders above.
Next, run the tests with the nox
command from within your virtual environment.
nox
To run a specific test using python 3, use the following form:
pytest tests/{{file name}}::{{test name}}
To run tests with the HTML coverage report, use the following:
pytest --cov=proknow --cov-branch --cov-report html tests
Building the Documentation
With the virtual environment, you can run make clean && make html
to build the documentation.
cd docs/
make clean && make html
Packaging
First, make sure the version has been updated in setup.py. Then run the following.
rm -rf dist build */*.egg-info *.egg-info
python3 setup.py bdist_wheel --universal
python3 -m twine upload dist/*
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
Built Distribution
Hashes for proknow-0.18.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa7709600c780fec438d77573cdc06f92243829327e905b9f2372c523cbdbd66 |
|
MD5 | e32c8effea662d269f399b324cbae39e |
|
BLAKE2b-256 | e0b7c8d42c0885f0a289c228afdf89ea6d6a33a0fe68b31b1dcec43a0c41bd60 |