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
Use the following steps if you need to be able to package the project to publish on PyPi or if you need to build the documentation.
- Install the latest version of python. This will be installed alongside the version that your operating system provides.
- Run the following to install/upgrade
pip
,setuptools
,wheel
,twine
,pipenv
.
python3 -m pip install --upgrade pip setuptools wheel twine pipenv
- Initialize a virtual environment using
pipenv
.
pipenv install --dev
- Activate the virtual environment using
pipenv shell
.
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 pipenv shell.
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 pipenv shell, you can run make clean && make html
to build the documentation.
pipenv shell
cd docs/
make clean && make html
Packaging
First, make sure the version has been updated in setup.py. Then run the following outside your pipenv shell.
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.7.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c4f5df8ea54ad41410e3a429f19843f0a48d6f76df4bcf1d6fa3a86e0bf6954 |
|
MD5 | ae75aa8088604d7f02b0c915f8916759 |
|
BLAKE2b-256 | 6f57205c140cd582c8d64a1995c75f5aab6f03323916a9b4b4d457a877d2cf4c |