g2-sdk-python
Synopsis
Senzing Software Development Kit (SDK) for Python.
This SDK provide python access to the senzingapi
More information at github.com/Senzing/g2-sdk-python
Overview
The git repository at
github.com/Senzing/g2-sdk-python
contains the Senzing SDK for Python files in src/senzing.
It also contains:
- Tooling to create Python "wheel" packages
- Test suites
- Instructions for publishing to PyPi.
Contents
Install
-
Use the pip install command to install the Senzing SDK for Python. Example:
pip install senzing -
More information at github.com/Senzing/g2-sdk-python
Develop
The following instructions are used when modifying and building the Docker image.
Prerequisites for development
:thinking: The following tasks need to be complete before proceeding. These are "one-time tasks" which may already have been completed.
-
The following software programs need to be installed:
-
:pencil2: Make a
~/.pypircfile. Example:[pypi] username = __token__ password = pypi-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [testpypi] username = __token__ password = pypi-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
Clone repository
For more information on environment variables, see Environment Variables.
-
Set these environment variable values:
export GIT_ACCOUNT=senzing export GIT_REPOSITORY=g2-sdk-python export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
-
Using the environment variables values just set, follow steps in clone-repository to install the Git repository.
Install dependencies
-
Install python tools via
Makefile. Example:cd ${GIT_REPOSITORY_DIR} make install-dependencies
Build python packages
-
Build pip package using
python3 -m buildviaMakefile. Example:cd ${GIT_REPOSITORY_DIR} make package
Output will be in the
distdirectory.
Local test
Install from file
-
Install using
pipviaMakefile. Example:cd ${GIT_REPOSITORY_DIR} make install-file
Test local package
-
Run testcases found in
testsdirectory. Example:cd ${GIT_REPOSITORY_DIR} make test
Uninstall local package
-
Remove senzing. Example:
cd ${GIT_REPOSITORY_DIR} make uninstall
Publish
:warning: On PyPi and test.pypi, pip package versions are immmutable. They cannot be deleted nor updated. Since only one instance of a version can be published, be careful on what is published.
Publish to test.pypi.org
-
Publish to https://test.pypi.org. This is a test PyPi server. Example:
cd ${GIT_REPOSITORY_DIR} make publish-test
Publish to pypi.org
-
Publish to https://pypi.org. :warning: This requires that the workstation has
gpgenabled with the signing key for "Senzing, Inc." Example:cd ${GIT_REPOSITORY_DIR} make publish-signed
Test
Install from test.pypi.org
-
Install using
pipviaMakefile. Example:cd ${GIT_REPOSITORY_DIR} make install-test
Install from pypi.org
-
Install using
pipviaMakefile. Example:cd ${GIT_REPOSITORY_DIR} make install
Unit tests
-
Run testcases found in
testsdirectory. Example:cd ${GIT_REPOSITORY_DIR} make test
Uninstall
-
Remove Senzing SDK for Python. Example:
cd ${GIT_REPOSITORY_DIR} make uninstall
Verify Uninstall
-
:pencil2: Identify python version. Example:
export SENZING_PYTHON_VERSION=3.8 -
Verify deletion in user python repository. Example:
ls ~/.local/lib/python${SENZING_PYTHON_VERSION}/site-packages | grep senzingShould return nothing.
-
Verify deletion in system repository. Example:
ls /usr/local/lib/python${SENZING_PYTHON_VERSION}/dist-packages | grep senzingShould return nothing.
References
Metadata
Release files for senzing 3.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| senzing-3.0.1.tar.gz | 23.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| senzing-3.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.5 kB
Release files / senzing-3.0.1.tar.gz
| Download URL | senzing-3.0.1.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f493fc5c9cb3fb4393f08563d3e90c060e7e50e4cd482dedfd3ad443ffcb174a
|
|
BLAKE2b-256 checksum How to use checksums |
dacd6537b454b2180df03a460a2653e511f235f33ec53fcf56de914dffb37ec5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8
|
Release files / senzing-3.0.1-py3-none-any.whl
| Download URL | senzing-3.0.1-py3-none-any.whl |
|---|---|
| Size | 34.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc566e03b45b940601a9e1838efa91ae161456d1fb0690a89ae62b98c5cda054
|
|
BLAKE2b-256 checksum How to use checksums |
2dcae5772a8789dbd43bf53d97f8d905893e65831708b70b7fcc3c2ff03f3e3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8
|