Skip to main content

No project description provided

Project description

Pangram Labs Python Package

Installation

pip install pangram-sdk

Add your API key

Add your API key as an environment variable, or pass it directly to the Pangram constructor.

export PANGRAM_API_KEY=<your API key>
from pangram import Pangram
# If the environment variable PANGRAM_API_KEY is set:
pangram_client = Pangram()

# Otherwise, pass the API key directly:
my_api_key = ''  # Fill this in with your API key.
pangram_client = Pangram(api_key=my_api_key)

Make a request

from pangram import Pangram
pangram_client = Pangram()

result = pangram_client.predict(text)
# Score in range [0, 1] where 0 is human-written and 1 is AI-generated.
score = result['ai_likelihood']

Make a batch request

from pangram import Pangram
pangram_client = Pangram()

text_batch = ["abc", "def"]

results = pangram_client.batch_predict(text_batch)
for result in results:
    text = result['text']
    score = result['ai_likelihood']

Questions? Email support@pangram.com!

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

pangram_sdk-0.1.7.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.

pangram_sdk-0.1.7-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pangram_sdk-0.1.7.tar.gz.

File metadata

  • Download URL: pangram_sdk-0.1.7.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pangram_sdk-0.1.7.tar.gz
Algorithm Hash digest
SHA256 f92e9f4162d18e031fac6be784d12d987c98be1666bfa74949ae7830d0453013
MD5 928cffbe572479f2b011c5d1124b1c1d
BLAKE2b-256 53fc800d98e3ed390391f804af582e871d186f72aa50da254c94f3bd7da8b431

See more details on using hashes here.

Provenance

The following attestation bundles were made for pangram_sdk-0.1.7.tar.gz:

Publisher: publish-to-pypi.yml on pangramlabs/pangram-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pangram_sdk-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: pangram_sdk-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pangram_sdk-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7ad696cb8649c14c7d0a3c7be97719c368633ba308e21b24138f9c07d645c9de
MD5 fe7a218259dc9c4ed0ea1c2d87b7e230
BLAKE2b-256 becc110e246e6df78fd695bf73bf15b3f8ae7771d97047fa1765fd0c74df60aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pangram_sdk-0.1.7-py3-none-any.whl:

Publisher: publish-to-pypi.yml on pangramlabs/pangram-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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