{"id":30593365,"url":"https://github.com/techwithty/heygen_content","last_synced_at":"2025-10-26T13:47:55.826Z","repository":{"id":310013757,"uuid":"1038385807","full_name":"TechWithTy/heygen_content","owner":"TechWithTy","description":"Production-ready HeyGen content library: prompts, scene templates, asset schemas, Pydantic types, and helpers for avatar/video generation.","archived":false,"fork":false,"pushed_at":"2025-08-15T05:21:36.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-15T07:11:47.517Z","etag":null,"topics":["assets","avatars","ci-cd","content","heygen","pydantic","python","schemas","templates","video"],"latest_commit_sha":null,"homepage":"https://www.cybershoptech.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TechWithTy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-15T05:21:25.000Z","updated_at":"2025-08-15T05:21:40.000Z","dependencies_parsed_at":"2025-08-15T07:12:04.836Z","dependency_job_id":"be5ce31c-03fc-4dfc-8f26-f0ee0548fa24","html_url":"https://github.com/TechWithTy/heygen_content","commit_stats":null,"previous_names":["techwithty/heygen_content"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/TechWithTy/heygen_content","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen_content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen_content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen_content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen_content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechWithTy","download_url":"https://codeload.github.com/TechWithTy/heygen_content/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fheygen_content/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272735311,"owners_count":24984283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assets","avatars","ci-cd","content","heygen","pydantic","python","schemas","templates","video"],"created_at":"2025-08-29T18:13:37.432Z","updated_at":"2025-10-26T13:47:55.733Z","avatar_url":"https://github.com/TechWithTy.png","language":"Python","readme":"# HeyGen Content SDK (Async) for Python\n\nAsynchronous, typed utilities for the HeyGen Content REST APIs (v1 + v2). Provides:\n\n- Full async/await via httpx\n- Pydantic schemas per-route for validation\n- Centralized error mapping and auth via a shared HTTP helper (`api/_http.py`)\n- Environment-based configuration (`config.py`) and `.env.example`\n- Lightweight REST client (`rest_client.py`) and thin singleton client (`client.py`)\n\n## Configuration\n\nConfigure via environment variables (or a `.env` file):\n\n```bash\nHEYGEN_API_KEY=your_api_key_here\nHEYGEN_BASE_URL=https://api.heygen.com/v1\nHEYGEN_TIMEOUT=30\n```\n\nSee `heygen_content/.env.example` for a template.\n\nAccess configuration at runtime:\n\n```python\nfrom backend.app.core.third_party_integrations.heygen_content.config import config\nprint(config.BASE_URL, config.TIMEOUT)\n```\n\n## Usage Patterns\n\n### 1) Per-route utilities (recommended)\nEach endpoint has a small, focused function using the shared HTTP helper.\n\n```python\nfrom backend.app.core.third_party_integrations.heygen_content.api.v2 import list_supported_languages\nlangs = await list_supported_languages()\nprint(langs.languages)\n```\n\nMore examples:\n\n```python\nfrom backend.app.core.third_party_integrations.heygen_content.api.v1 import (\n    list_folders, create_folder, update_folder, trash_folder, restore_folder,\n)\nfrom backend.app.core.third_party_integrations.heygen_content.api.v1.schemas import (\n    CreateFolderRequest, UpdateFolderRequest,\n)\n\nresp = await list_folders(limit=10)\ncreated = await create_folder(CreateFolderRequest(name=\"My Folder\"))\nupdated = await update_folder(created.data[\"id\"], UpdateFolderRequest(name=\"Renamed\"))\nawait trash_folder(updated.data[\"id\"]) \nawait restore_folder(updated.data[\"id\"]) \n```\n\n### 2) REST client (generic)\nUse `HeyGenRESTClient` for generic calls when a utility isn’t available.\n\n```python\nfrom backend.app.core.third_party_integrations.heygen_content.rest_client import HeyGenRESTClient\nfrom backend.app.core.third_party_integrations.heygen_content.api.v1.schemas import ListFoldersResponse\n\nasync with HeyGenRESTClient() as rc:\n    res = await rc._request(\"GET\", \"/v1/folders\", ListFoldersResponse)\n    print(res)\n```\n\n### 3) Thin singleton client\nThe `client.py` file exposes a thin content client using the same configuration and error mapping.\n\n```python\nfrom backend.app.core.third_party_integrations.heygen_content.client import client\nfrom backend.app.core.third_party_integrations.heygen_content.api.v2.schemas import RemainingQuotaResponse\n\nres = await client.request(\"GET\", \"/v2/user/remaining_quota\", RemainingQuotaResponse)\nprint(res.remaining_quota)\n```\n\n## Error Handling\n\nCommon exceptions (from `api/_exceptions.py`) are raised consistently:\n\n- `AuthenticationError`\n- `PermissionDeniedError`\n- `NotFoundError`\n- `RateLimitError`, `QuotaLimitError`, `CreditNotEnoughError`\n- `HeyGenValidationError`\n- `ServerError`\n- `HeyGenAPIError` (fallback)\n\n## Development\n\n1. Copy `.env.example` to `.env` and fill in values\n2. Run tests:\n\n```bash\npytest backend/app/core/third_party_integrations/heygen_content/_tests -q\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Fheygen_content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechwithty%2Fheygen_content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Fheygen_content/lists"}