Skip to main content

Python client for the hosted Greenophy ESG substantiveness classification API.

Project description

Greenophy Client

Python helper for calling the hosted Greenophy ESG substantiveness API.

Installation

pip install .

Usage

from greenophy_client import SubstantivenessClient

# Uses the default hosted base URL. Add an API key if your partner token requires it.
client = SubstantivenessClient(api_key="your-shared-token")

results = client.classify_esg_text("We transitioned 70% of our fleet to EVs in 2023.\nWe value teamwork.")
for item in results:
    print(item.index, item.label_name, item.sentence)

Use client.close() when you are done (or create it with a context manager).

Generic classification

Need a neutral rubric instead of the ESG-focused labels? Call classify_generic_text("..."), which targets /api/generic_classification.

Environment-variable configuration

You can also set connection details once for the whole environment. Override the hosted endpoint only if you are targeting a private deployment.

export GREENOPHY_API_KEY="your-shared-token"
# export GREENOPHY_API_BASE_URL="https://your-private-service"  # optional

Then simply instantiate SubstantivenessClient() without arguments.

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

greenophy_client-0.1.4.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

greenophy_client-0.1.4-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file greenophy_client-0.1.4.tar.gz.

File metadata

  • Download URL: greenophy_client-0.1.4.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for greenophy_client-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4c85580789d00e341fc5efc32295dda1b99a716bc080fa96a8fcc6ab1005c915
MD5 eef261b9b0d818652628bd2b892e64c2
BLAKE2b-256 c94fe61199d9ab7be8e0371df8f6f84d48e4c5eb1766280acb6d101fb737b4fb

See more details on using hashes here.

File details

Details for the file greenophy_client-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for greenophy_client-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b525bbf7c273190233c595c3499e29fb493c9a110b7b91455268b7bf5f433606
MD5 9d8fc34900b35c51d81d7ef28deee225
BLAKE2b-256 1f0af78051b46b69ccf563f690cec7f7e7ab6bc5d8e7ca4d0aa42af123dbebef

See more details on using hashes here.

Supported by

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