Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/speakeasy-sdks/hex-python-sdk
Hex Python SDK
https://github.com/speakeasy-sdks/hex-python-sdk
analytics api data python sdk
Last synced: 2 days ago
JSON representation
Hex Python SDK
- Host: GitHub
- URL: https://github.com/speakeasy-sdks/hex-python-sdk
- Owner: speakeasy-sdks
- License: mit
- Created: 2023-02-15T23:16:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-02T21:12:46.000Z (7 months ago)
- Last Synced: 2024-04-28T05:14:44.252Z (6 months ago)
- Topics: analytics, api, data, python, sdk
- Language: Python
- Homepage: https://learn.hex.tech/docs/develop-logic/hex-api/overview
- Size: 50.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hex Python SDK
## SDK Installation
```bash
pip install hex
```## Authentication
API Requests are authenticated using Oauth 2.0 Bearer Tokens in the header of the HTTP request. The token is always bound to a single Hex user's account and requests are executed as that Hex user, meaning the user can only execute requests against projects that are in line with the current permissions for that project.
### Token creation
![](https://learn.hex.tech/assets/images/api-tokens-3e39d4aea5ed40b3aeff4d583c80a41d.png)
Personal access tokens can be created from the API keys section of the User settings page.
A new token can be created by selecting the New Token button, then inputting a description and an expiration time frame. An existing token can be regenerated at any time by selecting the three-dot menu to the right of the token, and selecting Regenerate.
## SDK Example Usage
```python
import hex
from hex.models import operations, shareds = hex.Hex()
s.config_security(
security=shared.Security(
bearer_auth=shared.SchemeBearerAuth(
authorization="Bearer YOUR_BEARER_TOKEN_HERE",
),
)
)
req = operations.CancelRunRequest(
path_params=operations.CancelRunPathParams(
project_id="unde",
run_id="deserunt",
),
)
res = s.cancel_run(req)if res.status_code == 200:
# handle response
```## SDK Available Operations
### Hex SDK
* `cancel_run` - Cancel a project run.
* `get_project_runs` - Get the status of the API-triggered runs of a project.
* `get_run_status` - Get the status of a project run.
* `run_project` - Trigger a run of the latest published version of a project.### SDK Generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)