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

from glean_requests import GleanRestClient

# Initialize the client
# https://developers.glean.com/client/overview/#section/Introduction
client = GleanRestClient(
    api_token="your_api_token",
    subdomain="your_subdomain",
    act_as="optional_user_to_act_as", # Optional
    auth_type="OAUTH" # Optional
)

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

Indexing API Client

from glean_requests import GleanIndexingClient

# Initialize the client
# https://developers.glean.com/docs/indexing_api/indexing_api_getting_started/
client = GleanIndexingClient(
    api_token="your_api_token",
    subdomain="your_subdomain",
    act_as="optional_user_to_act_as", # Optional
    auth_type="OAUTH" # Optional
)

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

Features

  • Simple interface for making authenticated requests to Glean's API endpoints
  • Support for both REST and Indexing APIs
  • Automatic handling of authentication and session management
  • Support for acting as another user

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.2.0.tar.gz (19.7 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.2.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glean_requests-0.2.0.tar.gz
  • Upload date:
  • Size: 19.7 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.2.0.tar.gz
Algorithm Hash digest
SHA256 4f56beb0fb2f569cd8163ef2244cef88aa37b01729ba93663aec966d056a6249
MD5 45f3121e9bfbf890750d02d5cbd7f326
BLAKE2b-256 49b44f5dec9b8fa59d412d88b8156c39330ddff90a1de1b06e45304033a2e9e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for glean_requests-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: glean_requests-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 496121f56165eed7b15729e5c9d055ac234a9d600e4e304013a8c7dc6cb5f963
MD5 ba00082e1d4afc030d8f5643a94846be
BLAKE2b-256 7e3752a3d446903446389299da3e2c8b746bc9a0bc48cb2b9d9d1e2d69a26564

See more details on using hashes here.

Provenance

The following attestation bundles were made for glean_requests-0.2.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