Skip to main content

A minimal wrapper of the requests library for Glean's API

Project description

glean-requests

A minimal wrapper of the requests library for Glean's API.

Installation

pip install glean-requests

Usage

REST API Client

For more information on the REST API, see the Glean documentation.

from glean_requests import GleanRestClient

# Initialize the client
client = GleanRestClient(
    api_token="your_api_token",
    subdomain="your_subdomain",
)

# Example Search
# https://developers.glean.com/client/operation/search/
payload = { "query": "your_query" }
response = client.post("search", json=payload)

Indexing API Client

For more information on the Indexing API, see the Glean documentation.

from glean_requests import GleanIndexingClient

# Initialize the client
client = GleanIndexingClient(
    api_token="your_api_token",
    subdomain="your_subdomain",
)

# Example Get Datasource Configuration
# https://developers.glean.com/indexing/tag/Datasources/paths/~1getdatasourceconfig/post/
payload = {"datasource": "testing"}
response = client.post("getdatasourceconfig", json=payload)

Authentication

For more information on Authentication, see the Glean documentation.

client = GleanRestClient(
    api_token="your_api_token",
    subdomain="your_subdomain",
    act_as="optional_user_to_act_as", # For Global Tokens
    auth_type="OAUTH" # Optional
)

Features

  • Simple interface for making authenticated requests to Glean's API endpoints
  • Support for both REST and Indexing APIs
  • Automatic handling of authentication headers and urls
  • Support for global tokens

License

MIT

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

glean_requests-0.3.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

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

glean_requests-0.3.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file glean_requests-0.3.0.tar.gz.

File metadata

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

File hashes

Hashes for glean_requests-0.3.0.tar.gz
Algorithm Hash digest
SHA256 010cf835bd7b86cf0622b3934338e37e4b770fce24473e4bd2185017237b5584
MD5 0602cc9b286b29f19d882040c301457d
BLAKE2b-256 c9d998acb37564567519bcfa9347c3bcbbe796377e45899f14197eb57258636f

See more details on using hashes here.

Provenance

The following attestation bundles were made for glean_requests-0.3.0.tar.gz:

Publisher: python-publish.yml on johnagan/glean-requests

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

File details

Details for the file glean_requests-0.3.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for glean_requests-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f5f0fe98cc2632ac31eaac68c65c8296ea56ceaf8cc9586bf6c7c3a9f7fccaf
MD5 f725e465701f4030785900ba021884cf
BLAKE2b-256 f5c0af9a0cd26fdbfb1db3d9d7bf080c8671b8f7a9def392d379426e112aecba

See more details on using hashes here.

Provenance

The following attestation bundles were made for glean_requests-0.3.0-py3-none-any.whl:

Publisher: python-publish.yml on johnagan/glean-requests

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