Python SDK for the heraw API
Project description
heraw Python SDK
A Python client for the heraw API with full type annotations.
Installation
pip install heraw
Usage
from heraw import Heraw
# Initialize the client with your API key
client = Heraw(api_key="your_api_key")
# Work with projects
projects = client.list_projects(workspace_name="my-workspace")
for project in projects:
print(f"Project: {project['name']} ({project['uuid']})")
if project.get('company'):
print(f" Company: {project['company']['name']}")
print(f" Status: {project['status']}")
print(f" Created: {project['created']}")
# Create a new project
new_project = client.create_project({
"name": "New Project",
"startDate": "2024-04-01T00:00:00.000Z",
"endDate": "2024-06-30T00:00:00.000Z",
"companyName": "ACME Inc.",
"disableCasts": False
}, workspace_name="my-workspace")
# Work with files
file = client.upload_file({
"folderUuid": new_project["folderUuid"],
"uploadGroup": ""
}, workspace_name="my-workspace", file_path="video.mp4)
# Work with folders
folder = client.get_folder(new_project["folderUuid"], workspace_name="my-workspace")
content = client.get_folder_content(new_project["folderUuid"], workspace_name="my-workspace")
Type Annotations
This SDK includes complete TypedDict definitions for all API resources, providing IDE autocompletion and type checking:
from heraw import Heraw, ProjectDict, FileDict
# All methods return properly typed objects
projects: List[ProjectDict] = client.list_projects(workspace_name="my-workspace")
project: ProjectDict = client.get_project("project-123", workspace_name="my-workspace")
# Project resource example
"""
{
"uuid": "00000000-0000-0000-0000-000000000001",
"name": "Example Project",
"startDate": "2023-01-01T00:00:00.000Z",
"endDate": "2023-02-01T00:00:00.000Z",
"created": "2023-01-15T10:30:00.000Z",
"updated": "2023-01-16T14:25:00.000Z",
"status": "IN_PROGRESS",
"folderUuid": "00000000-0000-0000-0000-000000000002",
"castsDisabled": false,
"hasCast": false,
"hasStats": false,
"user": "00000000-0000-0000-0000-000000000003",
"company": {
"uuid": "00000000-0000-0000-0000-000000000004",
"name": "Example Company",
"color": "#3f51b5"
},
"role": null,
"isFavorite": false,
"color": "#000000",
"logoUrl": "https://example.com/logo.png",
"backgroundUrl": null,
"size": 12345678,
"hasNotificationSettings": true,
"team": null,
"taskCounts": {
"projectUuid": "00000000-0000-0000-0000-000000000001",
"toDo": 5,
"inProgress": 3,
"toValidate": 2,
"done": 10
}
}
"""
Authentication
You need to create an API key from the heraw dashboard and provide it when initializing the client.
API Reference
Client Initialization
from heraw import Heraw
# Default base URL is https://app.heraw.com/public/v1
client = Heraw(api_key="your_api_key")
# Custom base URL
client = Heraw(api_key="your_api_key", base_url="https://custom-instance.heraw.com/public/v1")
Entities API
Methods for working with entities:
list_entities(workspace_name) -> List[EntityDict]: List all entities in a workspacecreate_entity(data, workspace_name) -> EntityDict: Create an entityupdate_entity(entity_uuid, data, workspace_name) -> EntityDict: Update an entitydelete_entity(entity_uuid, workspace_name) -> Dict[str, Any]: Delete an entity
Projects API
Methods for working with projects:
list_projects(workspace_name) -> List[ProjectDict]: List all projects in a workspacecreate_project(data, workspace_name) -> ProjectDict: Create a new projectget_project(project_uuid, workspace_name) -> ProjectDict: Get a project by UUIDupdate_project(project_uuid, data, workspace_name) -> ProjectDict: Update a projectdelete_project(project_uuid, workspace_name) -> Dict[str, Any]: Delete a projectupdate_project_status(project_uuid, status) -> ProjectDict: Update a project's statussearch_projects(criteria, workspace_name) -> Dict[str, Any]: Search for projectsget_project_custom_fields(project_uuid, workspace_name) -> Dict[str, Any]: Get custom fields for a projectset_project_custom_fields(project_uuid, data, workspace_name) -> Dict[str, Any]: Set custom fields for a projectget_project_teams(project_uuid, workspace_name) -> Dict[str, Any]: Get teams for a project
Files API
Methods for working with files:
list_files(workspace_name, params) -> List[FileDict]: List files in a workspacecreate_file(data, workspace_name) -> FileDict: Create a new file entry to be uploadedupload_file(data, workspace_name, file_path) -> FileDict: Upload a file to a folderdelete_file(file_uuid, workspace_name) -> Dict[str, Any]: Delete a filedelete_file_permanently(file_uuid, workspace_name) -> Dict[str, Any]: Delete a file permanentlyupdate_file_status(file_uuid, status, workspace_name) -> FileDict: Update file statusget_file_version(file_uuid, file_version, workspace_name, params) -> FileDict: Get a file versioncreate_file_version(file_uuid, data, workspace_name) -> FileDict: Create a new version of a fileget_file_subtitles(file_uuid, file_version, workspace_name, params) -> List[SubtitleDict]: Get file subtitlesget_file_custom_fields(file_uuid, workspace_name) -> Dict[str, Any]: Get custom fields for a fileset_file_custom_fields(file_uuid, data, workspace_name) -> Dict[str, Any]: Set custom fields for a fileingest_file(data, workspace_name) -> Dict[str, Any]: Upload a file creating missing foldersingest_file_from_s3(data, workspace_name) -> Dict[str, Any]: Upload from S3 source
Folders API
Methods for working with folders:
get_folder(folder_uuid, workspace_name) -> FolderDict: Get a folderdelete_folder(folder_uuid, workspace_name) -> Dict[str, Any]: Delete a foldercreate_folder(data, workspace_name) -> FolderDict: Create a folderget_folder_content(folder_uuid, workspace_name, basic) -> FolderContentDict: Get folder contentinvite_users_to_folder(folder_uuid, data, workspace_name) -> Dict[str, Any]: Invite users to a folderset_folder_teams(folder_uuid, team_uuids, workspace_name) -> Dict[str, Any]: Set teams for a folder
Casts API
Methods for working with casts:
list_casts(workspace_name, project_uuid) -> List[CastDict]: List castscreate_cast(data, workspace_name) -> CastDict: Create a new castupdate_cast(cast_uid, data, workspace_name) -> CastDict: Update a castdelete_cast(cast_uid, workspace_name) -> Dict[str, Any]: Delete a castshare_cast(cast_uid, data, workspace_name) -> Dict[str, Any]: Share a cast
Custom Fields API
Methods for working with custom fields:
list_custom_fields(workspace_name) -> List[CustomFieldDict]: List all custom fields for a workspacecreate_custom_field(data, workspace_name) -> CustomFieldDict: Create a custom fieldupdate_custom_field(custom_field_uuid, data, workspace_name) -> CustomFieldDict: Update a custom fielddelete_custom_field(custom_field_uuid, workspace_name) -> Dict[str, Any]: Delete a custom field
Search API
Methods for searching:
search(query, workspace_name, contexts, folder_uuid) -> SearchResultDict: Search for files, folders, comments
Subtitles API
Methods for working with subtitles:
get_subtitle(subtitle_uuid, workspace_name, format, timestamp) -> Union[SubtitleDict, Dict[str, Any]]: Get a subtitleupload_subtitle(file_data, file_name, file_uuid, locale, workspace_name) -> SubtitleDict: Upload a subtitle file
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 heraw-0.1.0.tar.gz.
File metadata
- Download URL: heraw-0.1.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3ff1f88e9e4ca5dfa854887dd7b1ab2039d2f50bddb68cc2d1a4e21b0843f7a
|
|
| MD5 |
9c2378aa790ca21bb83b55f27d6f6c67
|
|
| BLAKE2b-256 |
4468e103719a8f2b86ae1871af07f4e1ea97f0ccdaf35d0d6663eeca347c8a88
|
Provenance
The following attestation bundles were made for heraw-0.1.0.tar.gz:
Publisher:
python-publish.yml on ProductionsAutrementDit/python-heraw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
heraw-0.1.0.tar.gz -
Subject digest:
a3ff1f88e9e4ca5dfa854887dd7b1ab2039d2f50bddb68cc2d1a4e21b0843f7a - Sigstore transparency entry: 197393357
- Sigstore integration time:
-
Permalink:
ProductionsAutrementDit/python-heraw@f32991c28e41c70a0c1294f91978ea9e097fa222 -
Branch / Tag:
refs/tags/v0.0.1-alpha - Owner: https://github.com/ProductionsAutrementDit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f32991c28e41c70a0c1294f91978ea9e097fa222 -
Trigger Event:
release
-
Statement type:
File details
Details for the file heraw-0.1.0-py3-none-any.whl.
File metadata
- Download URL: heraw-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.6 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 |
e3dd1ea1807793d761b80cf87a2a9264b1c001867beed9975c0e579dba0c67ba
|
|
| MD5 |
c14571a3d06cba60a7c41775dd95d30e
|
|
| BLAKE2b-256 |
1d59d6a7f9f5ea99462324786ef53bc4bec8ee431e94db6a8b234bcaacdbe911
|
Provenance
The following attestation bundles were made for heraw-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on ProductionsAutrementDit/python-heraw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
heraw-0.1.0-py3-none-any.whl -
Subject digest:
e3dd1ea1807793d761b80cf87a2a9264b1c001867beed9975c0e579dba0c67ba - Sigstore transparency entry: 197393360
- Sigstore integration time:
-
Permalink:
ProductionsAutrementDit/python-heraw@f32991c28e41c70a0c1294f91978ea9e097fa222 -
Branch / Tag:
refs/tags/v0.0.1-alpha - Owner: https://github.com/ProductionsAutrementDit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f32991c28e41c70a0c1294f91978ea9e097fa222 -
Trigger Event:
release
-
Statement type: