Skip to main content

Python client for the hosted Greenophy ESG substantiveness classification API.

Project description

Greenophy

Python helper for calling the hosted Greenophy ESG substantiveness API.

Installation

pip install .

Usage

from greenophy 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")

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

print("Quota remaining:", response["meta"]["quota_remaining"])

Each call returns a JSON-style dictionary with a results list (one entry per sentence) and a meta object that includes counters, processing time, and the remaining quota if the partner token enforces limits.

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 and returns the same JSON structure (with updated labels and meta).

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-0.1.5.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

greenophy-0.1.5-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file greenophy-0.1.5.tar.gz.

File metadata

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

File hashes

Hashes for greenophy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c4e80555534f7ef72ec135cfdadb070843dd153b9ba3e77d7dce8183cb9a9619
MD5 775097b2563fba2c7ac4258a21ba2908
BLAKE2b-256 5eaf1e99401d5e751d1c269c1010587baafed8130502893b80a17eef5c2d6d20

See more details on using hashes here.

File details

Details for the file greenophy-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: greenophy-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for greenophy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dec926eaaa0d8a616423cfd1fcf9f435e72ad776ca1d1eb2fba646ae01a7ee3f
MD5 cb2b78386af5b61477a2a1c88ed8af40
BLAKE2b-256 ee7ffdf44238c1faeb3d893e433d8d8be7cbd4d20af3608280ba78c672f1d371

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