Skip to main content

A wrapper for the Glif API

Project description

GLIF client

A python client to interact with the Glif API.

Quickstart

pip install glif-client

Create a Glif account and create a new API token here.

export GLIF_API_TOKEN="your-token"

Example:

from glif_client import GlifClient

# supply `api_token` or set it as an environment variable named GLIF_API_TOKEN
glif_api = GlifClient(api_token="your-token")

# option 1, positional args
simple_args = ["a happy horse", "foobar"]
response = glif_api.run_simple("cm023wc6m0009k7ur9ta0g14f", simple_args)
print(response)

# option 2, named args
named_args = {
    "prompt": "a happy horse",
    "other_parameter": "foobar",
}
response = glif_api.run_simple("cm023wc6m0009k7ur9ta0g14f", named_args)
print(response)

Enable debugging

import logging

logging.basicConfig(level=logging.DEBUG)

Dev (unix)

Install dev deps:

pip install -r requirements.dev.txt

There's a makefile with two handy commands:

make test # run the little test suite
make style # run formatting

Links

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

glif_client-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

glif_client-0.1.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glif_client-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for glif_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1f814edff178eaaf2dfce2cb44466ca6c1e8dc05c00eb31f1866190fd95c560f
MD5 25c36f62de24920182e1b8dcd32f314e
BLAKE2b-256 84bcb3c66383ea08784b4e12df81351cdd44d650451add476f5d0248aa6d6487

See more details on using hashes here.

File details

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

File metadata

  • Download URL: glif_client-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for glif_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f5a81badd721be9d72735e5a5c193f8686dacbf4d5cf45852d41dbaa3a5a60e
MD5 20356e6df826353513466c7c7b21dd84
BLAKE2b-256 f400c59997afbd362655cc11036540bf331b64659748c4e02f66b45a27823788

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