Skip to main content

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

  1. Install the latest version of Python. This will be installed alongside the version that your operating system provides.
  2. 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: The requirements.txt file contains transitive dependencies in addition to direct dependencies. To reconstruct the requirements from scratch, use the following commands to install the direct dependencies used for development, packaging, and releasing.

(env) $ pip install pytest-cov requests nox sphinx sphinx-rtd-theme twine wheel

Note: If you wish to update the requirements with new or updated packages, run the following.

(env) $ pip freeze --exclude-editable > requirements.txt

Testing

The tests require the ProKnow API service to be started with the PATIENTS_MIN_PAGE_SIZE environment variable set to 1. To do this, at the top level of the the ProKnow directory, run

$ PATIENTS_MIN_PAGE_SIZE=1 npm run start

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 test directory 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. Note that for testing against a local ProKnow instance, the base_url should be set to http://localhost:3005 and the environment must be configured to use Auth0 as the identity provider (and not Keycloak or OIDC).

Next, run the tests with the nox command from within your virtual environment. This command runs the tests against all of the supported Python versions. You may need to install these versions on the host.

$ 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 & Release

First, make sure the version has been updated in setup.py. Then run the following within the virtual environment.

$ rm -rf dist build */*.egg-info *.egg-info
$ python3 setup.py bdist_wheel --universal
$ python3 -m twine upload dist/*

Metadata

Release files for proknow 0.23.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for proknow 0.23.0
File Interpreter ABI Platform
proknow-0.23.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / proknow-0.23.0-py2.py3-none-any.whl

Download URL proknow-0.23.0-py2.py3-none-any.whl
Size 69.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
42f534619daaabb78147ade56c9b67f5f07d0fdf9e570629abc50c706eceedad
BLAKE2b-256 checksum
How to use checksums
e339e1cf9fa896a9fae9b79cb1c0d00b51acfefe55e6bbe11106830bf3e38bae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for proknow 0.23.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.23.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page