If you are beginning your journey with Senzing, please start with Senzing Quick Start guides.
You are in the Senzing Garage where projects are "tinkered" on. Although this GitHub repository may help you understand an approach to using Senzing, it's not considered to be "production ready" and is not considered to be part of the Senzing product. Heck, it may not even be appropriate for your application of Senzing!
Senzing Software Development Kit (SDK) for Python. This SDK provide python access to the senzingapi
Warning: Using pip install senzing-ce
will install a version of the Senzing Python SDK
that is not covered by Senzing's Service Level Agreement (SLA).
To obtain a version of the Senzing Python SDK that is covered, see
Install Senzing API.
More information at github.com/senzing-garage/g2-sdk-python
The git repository at
github.com/senzing-garage/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.
-
Use the pip install command to install the Senzing SDK for Python community edition. Example:
pip install senzing-ce
-
More information at github.com/senzing-garage/g2-sdk-python
The following instructions are used when modifying and building the Docker image.
🤔 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:
-
✏️ Make a
~/.pypirc
file. Example:[pypi] username = __token__ password = pypi-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [testpypi] username = __token__ password = pypi-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
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 python tools via
Makefile
. Example:cd ${GIT_REPOSITORY_DIR} make install-dependencies
-
Build pip package using
python3 -m build
viaMakefile
. Example:cd ${GIT_REPOSITORY_DIR} make package
Output will be in the
dist
directory.
-
Install using
pip
viaMakefile
. Example:cd ${GIT_REPOSITORY_DIR} make install-file
-
Run testcases found in
tests
directory. Example:cd ${GIT_REPOSITORY_DIR} make test
-
Remove senzing. Example:
cd ${GIT_REPOSITORY_DIR} make uninstall
-
Publish to https://test.pypi.org. This is a test PyPi server. Example:
cd ${GIT_REPOSITORY_DIR} make publish-test
-
Publish to https://pypi.org. :warning: This requires that the workstation has
gpg
enabled with the signing key for "Senzing, Inc." Example:cd ${GIT_REPOSITORY_DIR} make publish-signed
-
Install using
pip
viaMakefile
. Example:cd ${GIT_REPOSITORY_DIR} make install-test
-
Install using
pip
viaMakefile
. Example:cd ${GIT_REPOSITORY_DIR} make install
-
Run testcases found in
tests
directory. Example:cd ${GIT_REPOSITORY_DIR} make test
-
Remove Senzing SDK for Python. Example:
cd ${GIT_REPOSITORY_DIR} make uninstall
-
✏️ 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 senzing
Should return nothing.
-
Verify deletion in system repository. Example:
ls /usr/local/lib/python${SENZING_PYTHON_VERSION}/dist-packages | grep senzing
Should return nothing.