Skip to main content

Python client for the Greenophy substantiveness classification API.

Project description

Greenophy Client

Small Python helper package for calling the Greenophy substantiveness API.

Installation

pip install .

Usage

from greenophy_client import SubstantivenessClient

# Option 1: pass connection info explicitly
client = SubstantivenessClient(
    base_url="https://greenophy-service-xyz.a.run.app",
    api_key="your-shared-token",  # optional
)

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)

The same client exposes classify_esg_sentences([...]) if you prefer passing your own sentence list.

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

Generic classification

Need broader categories? Use the generic helpers, which call /api/generic_classification:

generic_results = client.classify_generic_text("Our ESG disclosures are independently assured by EY.")

Environment-variable configuration

You can also set the connection details once for the whole environment:

export GREENOPHY_API_BASE_URL="https://greenophy-service-xyz.a.run.app"
export GREENOPHY_API_KEY="your-shared-token"

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.2.tar.gz (3.2 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.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: greenophy_client-0.1.2.tar.gz
  • Upload date:
  • Size: 3.2 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.2.tar.gz
Algorithm Hash digest
SHA256 1049801463506e92d2e6c833a7920df6904201c0c4b7fe5aa0ed84a1c311f5dd
MD5 2ba7a2599f450a5e46fa6c7e420921a6
BLAKE2b-256 982b3cacd0a6dde04ceae20287d5d2bb40091e96adc49211791caa55ad1ff424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for greenophy_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 53daeda4dd1288b8b84a07a774beec50efa2f657c1a6378d6c6ba227f6e5badf
MD5 392ca8528bf08904536b5dad8e8273cc
BLAKE2b-256 ea86294bc69608dadd05e793f392aeae5c6b1e158615206ab4d39dd192156867

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