# g2-sdk-python
## Synopsis
Senzing Software Development Kit (SDK) for Python.
This SDK provide python access to the
[senzingapi](https://senzing.com/senzing-api/)
More information at
[github.com/Senzing/g2-sdk-python](https://github.com/Senzing/g2-sdk-python)
## Overview
The git repository at
[github.com/Senzing/g2-sdk-python](https://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](https://pypi.org/).
### Contents
1. [Install](#install)
1. [Develop](#develop)
1. [Prerequisites for development](#prerequisites-for-development)
1. [Clone repository](#clone-repository)
1. [Install dependencies](#install-dependencies)
1. [Build python packages](#build-python-packages)
1. [Local test](#local-test)
1. [Publish](#publish)
1. [Test](#test)
1. [Uninstall](#uninstall)
1. [Verify Uninstal](#verify-uninstall)
1. [References](#references)
## Install
1. Use the [pip install](https://pip.pypa.io/en/stable/cli/pip_install/)
command to install the
[Senzing SDK for Python](https://pypi.org/project/senzing/).
Example:
```console
pip install senzing
```
1. More information at
[github.com/Senzing/g2-sdk-python](https://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.
1. The following software programs need to be installed:
1. [git](https://github.com/Senzing/knowledge-base/blob/main/HOWTO/install-git.md)
1. [make](https://github.com/Senzing/knowledge-base/blob/main/HOWTO/install-make.md)
1. [pip](https://github.com/Senzing/knowledge-base/blob/main/HOWTO/install-pip.md)
1. :pencil2: Make a `~/.pypirc` file.
Example:
```console
[pypi]
username = __token__
password = pypi-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[testpypi]
username = __token__
password = pypi-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
```
### Clone repository
For more information on environment variables,
see [Environment Variables](https://github.com/Senzing/knowledge-base/blob/main/lists/environment-variables.md).
1. Set these environment variable values:
```console
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}"
```
1. Using the environment variables values just set, follow steps in [clone-repository](https://github.com/Senzing/knowledge-base/blob/main/HOWTO/clone-repository.md) to install the Git repository.
### Install dependencies
1. Install python tools via `Makefile`.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make install-dependencies
```
### Build python packages
1. Build pip package using `python3 -m build` via `Makefile`.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make package
```
Output will be in the `dist` directory.
### Local test
#### Install from file
1. Install using `pip` via `Makefile`.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make install-file
```
#### Test local package
1. Run testcases found in `tests` directory.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make test
```
#### Uninstall local package
1. Remove senzing.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make uninstall
```
### Publish
:warning: On [PyPi](https://pypi.org/) and
[test.pypi](https://test.pypi.org/),
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
1. Publish to <https://test.pypi.org>.
This is a test PyPi server.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make publish-test
```
#### Publish to pypi.org
1. Publish to <https://pypi.org>.
:warning: This requires that the workstation has `gpg` enabled with
the signing key for "Senzing, Inc."
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make publish-signed
```
### Test
#### Install from test.pypi.org
1. Install using `pip` via `Makefile`.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make install-test
```
#### Install from pypi.org
1. Install using `pip` via `Makefile`.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make install
```
#### Unit tests
1. Run testcases found in `tests` directory.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make test
```
### Uninstall
1. Remove Senzing SDK for Python.
Example:
```console
cd ${GIT_REPOSITORY_DIR}
make uninstall
```
### Verify Uninstall
1. :pencil2: Identify python version.
Example:
```console
export SENZING_PYTHON_VERSION=3.8
```
1. Verify deletion in user python repository.
Example:
```console
ls ~/.local/lib/python${SENZING_PYTHON_VERSION}/site-packages | grep senzing
```
Should return nothing.
1. Verify deletion in system repository.
Example:
```console
ls /usr/local/lib/python${SENZING_PYTHON_VERSION}/dist-packages | grep senzing
```
Should return nothing.
## References
1. [Packaging Python Projects](https://packaging.python.org/tutorials/packaging-projects/)
Raw data
{
"_id": null,
"home_page": "https://github.com/Senzing/g2-sdk-python",
"name": "senzing",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "senzing",
"author_email": "support@senzing.com",
"download_url": "https://files.pythonhosted.org/packages/da/cd/6537b454b2180df03a460a2653e511f235f33ec53fcf56de914dffb37ec5/senzing-3.0.1.tar.gz",
"platform": null,
"description": "# g2-sdk-python\n\n## Synopsis\n\nSenzing Software Development Kit (SDK) for Python.\n\nThis SDK provide python access to the\n[senzingapi](https://senzing.com/senzing-api/)\n\nMore information at\n[github.com/Senzing/g2-sdk-python](https://github.com/Senzing/g2-sdk-python)\n\n## Overview\n\nThe git repository at\n[github.com/Senzing/g2-sdk-python](https://github.com/Senzing/g2-sdk-python)\ncontains the Senzing SDK for Python files in `src/senzing`.\n\nIt also contains:\n\n- Tooling to create Python \"wheel\" packages\n- Test suites\n- Instructions for publishing to [PyPi](https://pypi.org/).\n\n### Contents\n\n1. [Install](#install)\n1. [Develop](#develop)\n 1. [Prerequisites for development](#prerequisites-for-development)\n 1. [Clone repository](#clone-repository)\n 1. [Install dependencies](#install-dependencies)\n 1. [Build python packages](#build-python-packages)\n 1. [Local test](#local-test)\n 1. [Publish](#publish)\n 1. [Test](#test)\n 1. [Uninstall](#uninstall)\n 1. [Verify Uninstal](#verify-uninstall)\n1. [References](#references)\n\n## Install\n\n1. Use the [pip install](https://pip.pypa.io/en/stable/cli/pip_install/)\n command to install the\n [Senzing SDK for Python](https://pypi.org/project/senzing/).\n Example:\n\n ```console\n pip install senzing\n ```\n\n1. More information at\n [github.com/Senzing/g2-sdk-python](https://github.com/Senzing/g2-sdk-python)\n\n## Develop\n\nThe following instructions are used when modifying and building the Docker image.\n\n### Prerequisites for development\n\n:thinking: The following tasks need to be complete before proceeding.\nThese are \"one-time tasks\" which may already have been completed.\n\n1. The following software programs need to be installed:\n 1. [git](https://github.com/Senzing/knowledge-base/blob/main/HOWTO/install-git.md)\n 1. [make](https://github.com/Senzing/knowledge-base/blob/main/HOWTO/install-make.md)\n 1. [pip](https://github.com/Senzing/knowledge-base/blob/main/HOWTO/install-pip.md)\n\n1. :pencil2: Make a `~/.pypirc` file.\n Example:\n\n ```console\n [pypi]\n username = __token__\n password = pypi-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n\n [testpypi]\n username = __token__\n password = pypi-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n ```\n\n### Clone repository\n\nFor more information on environment variables,\nsee [Environment Variables](https://github.com/Senzing/knowledge-base/blob/main/lists/environment-variables.md).\n\n1. Set these environment variable values:\n\n ```console\n export GIT_ACCOUNT=senzing\n export GIT_REPOSITORY=g2-sdk-python\n export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git\n export GIT_REPOSITORY_DIR=\"${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}\"\n ```\n\n1. Using the environment variables values just set, follow steps in [clone-repository](https://github.com/Senzing/knowledge-base/blob/main/HOWTO/clone-repository.md) to install the Git repository.\n\n### Install dependencies\n\n1. Install python tools via `Makefile`.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make install-dependencies\n ```\n\n### Build python packages\n\n1. Build pip package using `python3 -m build` via `Makefile`.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make package\n ```\n\n Output will be in the `dist` directory.\n\n### Local test\n\n#### Install from file\n\n1. Install using `pip` via `Makefile`.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make install-file\n ```\n\n#### Test local package\n\n1. Run testcases found in `tests` directory.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make test\n ```\n\n#### Uninstall local package\n\n1. Remove senzing.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make uninstall\n ```\n\n### Publish\n\n:warning: On [PyPi](https://pypi.org/) and\n[test.pypi](https://test.pypi.org/),\npip package versions are immmutable.\nThey cannot be deleted nor updated.\nSince only one instance of a version can be published,\nbe careful on what is published.\n\n#### Publish to test.pypi.org\n\n1. Publish to <https://test.pypi.org>.\n This is a test PyPi server.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make publish-test\n ```\n\n#### Publish to pypi.org\n\n1. Publish to <https://pypi.org>.\n :warning: This requires that the workstation has `gpg` enabled with\n the signing key for \"Senzing, Inc.\"\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make publish-signed\n ```\n\n### Test\n\n#### Install from test.pypi.org\n\n1. Install using `pip` via `Makefile`.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make install-test\n ```\n\n#### Install from pypi.org\n\n1. Install using `pip` via `Makefile`.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make install\n ```\n\n#### Unit tests\n\n1. Run testcases found in `tests` directory.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make test\n ```\n\n### Uninstall\n\n1. Remove Senzing SDK for Python.\n Example:\n\n ```console\n cd ${GIT_REPOSITORY_DIR}\n make uninstall\n ```\n\n### Verify Uninstall\n\n1. :pencil2: Identify python version.\n Example:\n\n ```console\n export SENZING_PYTHON_VERSION=3.8\n ```\n\n1. Verify deletion in user python repository.\n Example:\n\n ```console\n ls ~/.local/lib/python${SENZING_PYTHON_VERSION}/site-packages | grep senzing\n ```\n\n Should return nothing.\n\n1. Verify deletion in system repository.\n Example:\n\n ```console\n ls /usr/local/lib/python${SENZING_PYTHON_VERSION}/dist-packages | grep senzing\n ```\n\n Should return nothing.\n\n## References\n\n1. [Packaging Python Projects](https://packaging.python.org/tutorials/packaging-projects/)\n\n\n",
"bugtrack_url": null,
"license": "Apache 2",
"summary": "Python SDK for Senzing API",
"version": "3.0.1",
"project_urls": {
"Bug Tracker": "https://github.com/Senzing/g2-sdk-python/issues",
"Homepage": "https://github.com/Senzing/g2-sdk-python"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2dcae5772a8789dbd43bf53d97f8d905893e65831708b70b7fcc3c2ff03f3e3a",
"md5": "42254669a918eef25d1cc4a69c9bc220",
"sha256": "fc566e03b45b940601a9e1838efa91ae161456d1fb0690a89ae62b98c5cda054"
},
"downloads": -1,
"filename": "senzing-3.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "42254669a918eef25d1cc4a69c9bc220",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 33954,
"upload_time": "2022-05-23T18:45:00",
"upload_time_iso_8601": "2022-05-23T18:45:00.495961Z",
"url": "https://files.pythonhosted.org/packages/2d/ca/e5772a8789dbd43bf53d97f8d905893e65831708b70b7fcc3c2ff03f3e3a/senzing-3.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dacd6537b454b2180df03a460a2653e511f235f33ec53fcf56de914dffb37ec5",
"md5": "dffa5073639133186fede6f5d547458c",
"sha256": "f493fc5c9cb3fb4393f08563d3e90c060e7e50e4cd482dedfd3ad443ffcb174a"
},
"downloads": -1,
"filename": "senzing-3.0.1.tar.gz",
"has_sig": false,
"md5_digest": "dffa5073639133186fede6f5d547458c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 23525,
"upload_time": "2022-05-23T18:45:03",
"upload_time_iso_8601": "2022-05-23T18:45:03.072503Z",
"url": "https://files.pythonhosted.org/packages/da/cd/6537b454b2180df03a460a2653e511f235f33ec53fcf56de914dffb37ec5/senzing-3.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-05-23 18:45:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Senzing",
"github_project": "g2-sdk-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "senzing"
}