Skip to main content

Python SDK for Senzing API over gRPC

Project description

g2-sdk-python-grpc

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!

:warning: WARNING: g2-sdk-python-grpc is still in development :warning: _

At the moment, this is "work-in-progress" with Semantic Versions of 0.n.x. Although it can be reviewed and commented on, the recommendation is not to use it yet.

Synopsis

The Senzing g2-sdk-python-grpc package provides a Python Software Development Kit adhering to the abstract classes of g2-sdk-python-abstract that communicates with a Senzing gRPC server.

Overview

The Senzing g2-sdk-python-grpc packages enable Python programs to call Senzing library functions across a network to a Senzing gRPC server.

The g2-sdk-python-grpc package implements the following g2-sdk-python-abstract interfaces:

  1. G2ConfigAbstract
  2. G2ConfigMgrAbstract
  3. G2DiagnosticAbstract
  4. G2EngineAbstract
  5. G2ProductAbstract

Other implementations of the g2-sdk-python-abstract interface include:

Use

The following example shows how to start a Senzing gRPC server Docker container and access it using the senzing_grpc Python package.

  1. Install the senzing-grpc Python package. Example:

    python3 -m pip install --upgrade senzing-grpc
    
  2. Run a Senzing gRPC service using Docker. Example:

    docker run \
      --env SENZING_TOOLS_COMMAND=serve-grpc \
      --env SENZING_TOOLS_DATABASE_URL=sqlite3://na:na@/tmp/sqlite/G2C.db \
      --env SENZING_TOOLS_ENABLE_ALL=true \
      --name senzing-tools-serve-grpc \
      --publish 8261:8261 \
      --pull always \
      --rm \
      senzing/senzing-tools
    

    Note: In this example, SENZING_TOOLS_DATABASE_URL specifies a file inside the container. Thus the database is temporal and will be deleted when the container is killed.

  3. In a separate window, start an interactive Python session. Example:

    python3
    
  4. Paste the following into the interactive Python session. Example:

    import grpc
    from senzing_grpc import G2ProductGrpc
    g2_product = G2ProductGrpc(grpc_channel=grpc.insecure_channel("localhost:8261"))
    print(g2_product.version())
    

More can be seen in Examples.

References

  1. Development
  2. Errors
  3. Examples
  4. g2-sdk-python-abstract package reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

senzing_grpc-0.1.1.tar.gz (34.2 kB view details)

Uploaded Source

Built Distribution

senzing_grpc-0.1.1-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file senzing_grpc-0.1.1.tar.gz.

File metadata

  • Download URL: senzing_grpc-0.1.1.tar.gz
  • Upload date:
  • Size: 34.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for senzing_grpc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7daffd79b3c85b9baa34771442a6190a9bbfe3681ff14f382e19e2b9e31d3acd
MD5 7ae7225ec2538b615a206d4a5b341be1
BLAKE2b-256 595947ef7200ca37e3a8c5003c71f46c0b34c8982922eb4da39dba3240bc2121

See more details on using hashes here.

File details

Details for the file senzing_grpc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: senzing_grpc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for senzing_grpc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2125e84b54e044d59fc855e3080ed77978c60ceab24fdad31de0c1cb2bbfa79
MD5 d8fb38f64f12b224c2a5b2972c4c76e8
BLAKE2b-256 b5ee8a55cfa3fc2a1b1192db0421a1e4a0a860f8f20925ba6098f6bc43314570

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page