A package for creating tokens for Graphlit services
Project description
graphlit-client-python
Overview
The Graphlit Client for Python enables easy interaction with the Graphlit API, allowing developers to execute queries and mutations against the Graphlit service. This document outlines the setup process and provides a basic example of using the client.
Prerequisites
Before you begin, ensure you have the following:
- Python 3.x installed on your system.
- An active account on graphlit.com with access to the API settings dashboard.
Installation
To install the Graphlit Client, use pip:
pip install graphlit-client
Configuration
The Graphlit Client requires three environment variables to be set for authentication and configuration:
ENVIRONMENT_ID
: Your environment ID.ORGANIZATION_ID
: Your organization ID.SECRET_KEY
: Your secret key for API access.
You can find these values in the API settings dashboard on graphlit.com.
Setting Environment Variables
To set these environment variables on your system, use the following commands, replacing your_value
with the actual values from your account.
For Unix/Linux/macOS:
export ENVIRONMENT_ID=your_environment_id_value
export ORGANIZATION_ID=your_organization_id_value
export SECRET_KEY=your_secret_key_value
For Windows Command Prompt (CMD):
set ENVIRONMENT_ID=your_environment_id_value
set ORGANIZATION_ID=your_organization_id_value
set SECRET_KEY=your_secret_key_value
For Windows PowerShell:
$env:ENVIRONMENT_ID="your_environment_id_value"
$env:ORGANIZATION_ID="your_organization_id_value"
$env:SECRET_KEY="your_secret_key_value"
Usage Example
Here's a simple example of how to use the Graphlit Client to create a Feed.
from graphlit_client import Graphlit
# Initialize the client
client = Graphlit()
# Print the client token
print(client.token)
# Execute a query
response = client.request(query="""
mutation CreateFeed($feed: FeedInput!) {
createFeed(feed: $feed) {
id
name
state
type
}
}""", variables={
"feed": {
"type": "WEB",
"web": {
"uri": "https://openai.com/blog"
},
"name": "OpenAI Blog"
}
})
# Print the response
print(response)
Support
For issues and support with the Graphlit Client or API,
Please refer to the documentation and
join our Discord community.
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
File details
Details for the file graphlit_client-0.1.3.tar.gz
.
File metadata
- Download URL: graphlit_client-0.1.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bed0bca43d9d65783a8e545497577c28a279f7aadf0d01509e7dee03a57876a |
|
MD5 | 0045286bf20aa2fb280f2ed4ba8e14e7 |
|
BLAKE2b-256 | f4c0d45253e48dd868d3fc1b53a9183cd14e1a1d2c9c36b53b2f83b4b71cec95 |
File details
Details for the file graphlit_client-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: graphlit_client-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc6905f5add1a75200d4e8498746b06f52b9ad1cee65069818cc3f446050ca5f |
|
MD5 | 7cb03a60aff6f3ae88b4e613717ea6d2 |
|
BLAKE2b-256 | cba567b2047bf336fa70e1d59e114d8d8970fc5690379b1bdb2141d4b09c9bb3 |