A minimal wrapper of the requests library for Glean's API
Project description
requests-glean
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
client = GleanRestClient(
api_token="your_api_token",
subdomain="your_subdomain",
act_as="optional_user_to_act_as",
auth_type="OAUTH" # or "JWT"
)
# Make a GET request
response = client.get("endpoint")
# Make a POST request
response = client.post("endpoint", json={"key": "value"})
Indexing API Client
from glean_requests import GleanIndexingClient
# Initialize the client
client = GleanIndexingClient(
api_token="your_api_token",
subdomain="your_subdomain",
act_as="optional_user_to_act_as",
auth_type="OAUTH" # or "JWT"
)
# Make API requests
response = client.post("endpoint", json={"key": "value"})
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
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
glean_requests-0.1.0.tar.gz
(19.0 kB
view details)
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.1.0.tar.gz.
File metadata
- Download URL: glean_requests-0.1.0.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dc33ac954e8c153d5c84dc19364567a6e1ec72dcfc9beb71a90b5f64309ad2f
|
|
| MD5 |
dd15fb5b4637d49e88af01ab3bf2f134
|
|
| BLAKE2b-256 |
73bb0b72aa4f1968f2615f783b8a06f27b1a34f33a9224fdaa7c369c57cfeca0
|
File details
Details for the file glean_requests-0.1.0-py3-none-any.whl.
File metadata
- Download URL: glean_requests-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6a8ff517ad3351af6dc87ec88b3a992ab720e592657f03f28d55ada4b38b774
|
|
| MD5 |
3c4ba6c9ef945bbc5e38c092286bbfb1
|
|
| BLAKE2b-256 |
63c98b206b959f14104e8177e59e1a442c585d0faa50ee7b10a6895775dcb989
|