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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
010cf835bd7b86cf0622b3934338e37e4b770fce24473e4bd2185017237b5584
|
|
| MD5 |
0602cc9b286b29f19d882040c301457d
|
|
| BLAKE2b-256 |
c9d998acb37564567519bcfa9347c3bcbbe796377e45899f14197eb57258636f
|
Provenance
The following attestation bundles were made for glean_requests-0.3.0.tar.gz:
Publisher:
python-publish.yml on johnagan/glean-requests
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glean_requests-0.3.0.tar.gz -
Subject digest:
010cf835bd7b86cf0622b3934338e37e4b770fce24473e4bd2185017237b5584 - Sigstore transparency entry: 178013344
- Sigstore integration time:
-
Permalink:
johnagan/glean-requests@8a522b9f3b4da1bb6249f8cd9f3a15f740674287 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/johnagan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8a522b9f3b4da1bb6249f8cd9f3a15f740674287 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f5f0fe98cc2632ac31eaac68c65c8296ea56ceaf8cc9586bf6c7c3a9f7fccaf
|
|
| MD5 |
f725e465701f4030785900ba021884cf
|
|
| BLAKE2b-256 |
f5c0af9a0cd26fdbfb1db3d9d7bf080c8671b8f7a9def392d379426e112aecba
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glean_requests-0.3.0-py3-none-any.whl -
Subject digest:
8f5f0fe98cc2632ac31eaac68c65c8296ea56ceaf8cc9586bf6c7c3a9f7fccaf - Sigstore transparency entry: 178013347
- Sigstore integration time:
-
Permalink:
johnagan/glean-requests@8a522b9f3b4da1bb6249f8cd9f3a15f740674287 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/johnagan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8a522b9f3b4da1bb6249f8cd9f3a15f740674287 -
Trigger Event:
release
-
Statement type: