actorhub 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,93 @@
1
+ # Dependencies
2
+ node_modules/
3
+ venv/
4
+ .venv/
5
+ __pycache__/
6
+ *.pyc
7
+ *.pyo
8
+ *.pyd
9
+ .Python
10
+
11
+ # Build outputs
12
+ .next/
13
+ dist/
14
+ build/
15
+ *.egg-info/
16
+ .eggs/
17
+
18
+ # Environment files
19
+ .env
20
+ .env.local
21
+ .env.*.local
22
+ .env.production
23
+ *.local
24
+
25
+ # IDE
26
+ .idea/
27
+ .vscode/
28
+ *.swp
29
+ *.swo
30
+ .DS_Store
31
+
32
+ # Logs
33
+ logs/
34
+ *.log
35
+ npm-debug.log*
36
+ yarn-debug.log*
37
+ yarn-error.log*
38
+
39
+ # Testing
40
+ coverage/
41
+ .pytest_cache/
42
+ .coverage
43
+ htmlcov/
44
+
45
+ # Docker
46
+ docker-compose.override.yml
47
+
48
+ # Database
49
+ *.db
50
+ *.sqlite
51
+
52
+ # Uploads (local dev)
53
+ uploads/
54
+ tmp/
55
+
56
+ # Secrets
57
+ *.pem
58
+ *.key
59
+ credentials.json
60
+ secrets/
61
+ מפתחות.txt
62
+ .claude/settings.local.json
63
+
64
+ # OS files
65
+ Thumbs.db
66
+ *.DS_Store
67
+
68
+ # Misc
69
+ *.bak
70
+ *.tmp
71
+ .turbo
72
+ backups/
73
+ nul
74
+ *.sql.gz
75
+
76
+ # Secret files - never commit
77
+ apps/api/.env.backup
78
+ apps/api/.env.railway
79
+ apps/api/.env.secrets.generated
80
+ env_root_prod.txt
81
+ *.backup
82
+ *.old
83
+ *.orig
84
+ *.save
85
+
86
+ # SECURITY: Scripts with hardcoded credentials (remove secrets before committing)
87
+ # apps/api/scripts/upload_actors_production.py
88
+
89
+ # Test files
90
+ login*.json
91
+ register*.json
92
+ test-*.json
93
+ tmpclaude-*
actorhub-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 ActorHub.ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.4
2
+ Name: actorhub
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for ActorHub.ai - Verify AI-generated content against protected identities
5
+ Project-URL: Homepage, https://actorhub.ai
6
+ Project-URL: Documentation, https://docs.actorhub.ai
7
+ Project-URL: Repository, https://github.com/actorhub/actorhub-python
8
+ Project-URL: Issues, https://github.com/actorhub/actorhub-python/issues
9
+ Author-email: "ActorHub.ai" <actorhub.ai@gmail.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: actorhub,ai,api,consent,deepfake,face-recognition,identity,verification
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Requires-Python: >=3.8
26
+ Requires-Dist: httpx>=0.24.0
27
+ Requires-Dist: pydantic>=2.0.0
28
+ Requires-Dist: tenacity>=8.0.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: black>=23.0.0; extra == 'dev'
31
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
32
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
33
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
34
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
35
+ Requires-Dist: respx>=0.20.0; extra == 'dev'
36
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # ActorHub Python SDK
40
+
41
+ Official Python SDK for [ActorHub.ai](https://actorhub.ai) - Verify AI-generated content against protected identities.
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ pip install actorhub
47
+ ```
48
+
49
+ ## Quick Start
50
+
51
+ ```python
52
+ from actorhub import ActorHub
53
+
54
+ # Initialize the client
55
+ client = ActorHub(api_key="your-api-key")
56
+
57
+ # Verify if an image contains protected identities
58
+ result = client.verify(image_url="https://example.com/image.jpg")
59
+
60
+ if result.protected:
61
+ print(f"Protected identity detected!")
62
+ for identity in result.identities:
63
+ print(f" - {identity.display_name} (similarity: {identity.similarity_score})")
64
+ ```
65
+
66
+ ## Features
67
+
68
+ - **Identity Verification**: Check if images contain protected identities
69
+ - **Consent Checking**: Verify consent before AI generation
70
+ - **Marketplace Access**: Browse and license identities
71
+ - **Actor Pack Training**: Train custom Actor Packs
72
+ - **Async Support**: Full async/await support with `AsyncActorHub`
73
+ - **Automatic Retries**: Built-in retry logic with exponential backoff
74
+ - **Type Hints**: Full type annotations for IDE support
75
+
76
+ ## Usage Examples
77
+
78
+ ### Verify Image
79
+
80
+ ```python
81
+ from actorhub import ActorHub
82
+
83
+ client = ActorHub(api_key="your-api-key")
84
+
85
+ # From URL
86
+ result = client.verify(image_url="https://example.com/image.jpg")
87
+
88
+ # From file
89
+ result = client.verify(image_file="/path/to/image.jpg")
90
+
91
+ # From base64
92
+ result = client.verify(image_base64="base64-encoded-data...")
93
+
94
+ print(f"Protected: {result.protected}")
95
+ print(f"Faces detected: {result.faces_detected}")
96
+ ```
97
+
98
+ ### Check Consent (for AI Platforms)
99
+
100
+ ```python
101
+ result = client.check_consent(
102
+ image_url="https://example.com/face.jpg",
103
+ platform="runway",
104
+ intended_use="video",
105
+ region="US"
106
+ )
107
+
108
+ if result.protected:
109
+ for face in result.faces:
110
+ print(f"Consent for video: {face.consent.video_generation}")
111
+ print(f"License available: {face.license.available}")
112
+ ```
113
+
114
+ ### Browse Marketplace
115
+
116
+ ```python
117
+ # Search listings
118
+ listings = client.list_marketplace(
119
+ query="actor",
120
+ category="ACTOR",
121
+ sort_by="popular",
122
+ limit=10
123
+ )
124
+
125
+ for listing in listings:
126
+ print(f"{listing.title} - ${listing.base_price_usd}")
127
+ ```
128
+
129
+ ### Purchase License
130
+
131
+ ```python
132
+ from actorhub import LicenseType, UsageType
133
+
134
+ purchase = client.purchase_license(
135
+ identity_id="uuid-here",
136
+ license_type=LicenseType.STANDARD,
137
+ usage_type=UsageType.COMMERCIAL,
138
+ project_name="My AI Project",
139
+ project_description="Creating promotional content",
140
+ duration_days=30,
141
+ )
142
+
143
+ # Redirect user to Stripe checkout
144
+ print(f"Checkout URL: {purchase.checkout_url}")
145
+ ```
146
+
147
+ ### Get My Licenses
148
+
149
+ ```python
150
+ licenses = client.get_my_licenses(status="active")
151
+
152
+ for lic in licenses:
153
+ print(f"{lic.identity_name} - {lic.license_type} - Expires: {lic.expires_at}")
154
+ ```
155
+
156
+ ## Async Usage
157
+
158
+ ```python
159
+ import asyncio
160
+ from actorhub import AsyncActorHub
161
+
162
+ async def main():
163
+ async with AsyncActorHub(api_key="your-api-key") as client:
164
+ result = await client.verify(image_url="https://example.com/image.jpg")
165
+ print(f"Protected: {result.protected}")
166
+
167
+ asyncio.run(main())
168
+ ```
169
+
170
+ ## Error Handling
171
+
172
+ ```python
173
+ from actorhub import (
174
+ ActorHub,
175
+ AuthenticationError,
176
+ RateLimitError,
177
+ ValidationError,
178
+ NotFoundError,
179
+ )
180
+
181
+ client = ActorHub(api_key="your-api-key")
182
+
183
+ try:
184
+ result = client.verify(image_url="https://example.com/image.jpg")
185
+ except AuthenticationError:
186
+ print("Invalid API key")
187
+ except RateLimitError as e:
188
+ print(f"Rate limit exceeded. Retry after: {e.retry_after} seconds")
189
+ except ValidationError as e:
190
+ print(f"Validation error: {e.message}")
191
+ except NotFoundError:
192
+ print("Resource not found")
193
+ ```
194
+
195
+ ## Configuration
196
+
197
+ ```python
198
+ client = ActorHub(
199
+ api_key="your-api-key",
200
+ base_url="https://api.actorhub.ai", # Custom base URL
201
+ timeout=30.0, # Request timeout in seconds
202
+ max_retries=3, # Max retry attempts
203
+ )
204
+ ```
205
+
206
+ ## API Reference
207
+
208
+ ### ActorHub Client
209
+
210
+ | Method | Description |
211
+ |--------|-------------|
212
+ | `verify()` | Verify if image contains protected identities |
213
+ | `get_identity()` | Get identity details by ID |
214
+ | `check_consent()` | Check consent status for AI generation |
215
+ | `list_marketplace()` | Search marketplace listings |
216
+ | `get_my_licenses()` | Get user's purchased licenses |
217
+ | `purchase_license()` | Purchase a license |
218
+ | `train_actor_pack()` | Initiate Actor Pack training |
219
+ | `get_actor_pack()` | Get Actor Pack status |
220
+
221
+ ## Requirements
222
+
223
+ - Python 3.8+
224
+ - httpx
225
+ - pydantic
226
+ - tenacity
227
+
228
+ ## License
229
+
230
+ MIT License - see [LICENSE](LICENSE) for details.
231
+
232
+ ## Links
233
+
234
+ - [Documentation](https://docs.actorhub.ai)
235
+ - [API Reference](https://api.actorhub.ai/docs)
236
+ - [GitHub](https://github.com/actorhub/actorhub-python)
237
+ - [PyPI](https://pypi.org/project/actorhub/)
@@ -0,0 +1,199 @@
1
+ # ActorHub Python SDK
2
+
3
+ Official Python SDK for [ActorHub.ai](https://actorhub.ai) - Verify AI-generated content against protected identities.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install actorhub
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ from actorhub import ActorHub
15
+
16
+ # Initialize the client
17
+ client = ActorHub(api_key="your-api-key")
18
+
19
+ # Verify if an image contains protected identities
20
+ result = client.verify(image_url="https://example.com/image.jpg")
21
+
22
+ if result.protected:
23
+ print(f"Protected identity detected!")
24
+ for identity in result.identities:
25
+ print(f" - {identity.display_name} (similarity: {identity.similarity_score})")
26
+ ```
27
+
28
+ ## Features
29
+
30
+ - **Identity Verification**: Check if images contain protected identities
31
+ - **Consent Checking**: Verify consent before AI generation
32
+ - **Marketplace Access**: Browse and license identities
33
+ - **Actor Pack Training**: Train custom Actor Packs
34
+ - **Async Support**: Full async/await support with `AsyncActorHub`
35
+ - **Automatic Retries**: Built-in retry logic with exponential backoff
36
+ - **Type Hints**: Full type annotations for IDE support
37
+
38
+ ## Usage Examples
39
+
40
+ ### Verify Image
41
+
42
+ ```python
43
+ from actorhub import ActorHub
44
+
45
+ client = ActorHub(api_key="your-api-key")
46
+
47
+ # From URL
48
+ result = client.verify(image_url="https://example.com/image.jpg")
49
+
50
+ # From file
51
+ result = client.verify(image_file="/path/to/image.jpg")
52
+
53
+ # From base64
54
+ result = client.verify(image_base64="base64-encoded-data...")
55
+
56
+ print(f"Protected: {result.protected}")
57
+ print(f"Faces detected: {result.faces_detected}")
58
+ ```
59
+
60
+ ### Check Consent (for AI Platforms)
61
+
62
+ ```python
63
+ result = client.check_consent(
64
+ image_url="https://example.com/face.jpg",
65
+ platform="runway",
66
+ intended_use="video",
67
+ region="US"
68
+ )
69
+
70
+ if result.protected:
71
+ for face in result.faces:
72
+ print(f"Consent for video: {face.consent.video_generation}")
73
+ print(f"License available: {face.license.available}")
74
+ ```
75
+
76
+ ### Browse Marketplace
77
+
78
+ ```python
79
+ # Search listings
80
+ listings = client.list_marketplace(
81
+ query="actor",
82
+ category="ACTOR",
83
+ sort_by="popular",
84
+ limit=10
85
+ )
86
+
87
+ for listing in listings:
88
+ print(f"{listing.title} - ${listing.base_price_usd}")
89
+ ```
90
+
91
+ ### Purchase License
92
+
93
+ ```python
94
+ from actorhub import LicenseType, UsageType
95
+
96
+ purchase = client.purchase_license(
97
+ identity_id="uuid-here",
98
+ license_type=LicenseType.STANDARD,
99
+ usage_type=UsageType.COMMERCIAL,
100
+ project_name="My AI Project",
101
+ project_description="Creating promotional content",
102
+ duration_days=30,
103
+ )
104
+
105
+ # Redirect user to Stripe checkout
106
+ print(f"Checkout URL: {purchase.checkout_url}")
107
+ ```
108
+
109
+ ### Get My Licenses
110
+
111
+ ```python
112
+ licenses = client.get_my_licenses(status="active")
113
+
114
+ for lic in licenses:
115
+ print(f"{lic.identity_name} - {lic.license_type} - Expires: {lic.expires_at}")
116
+ ```
117
+
118
+ ## Async Usage
119
+
120
+ ```python
121
+ import asyncio
122
+ from actorhub import AsyncActorHub
123
+
124
+ async def main():
125
+ async with AsyncActorHub(api_key="your-api-key") as client:
126
+ result = await client.verify(image_url="https://example.com/image.jpg")
127
+ print(f"Protected: {result.protected}")
128
+
129
+ asyncio.run(main())
130
+ ```
131
+
132
+ ## Error Handling
133
+
134
+ ```python
135
+ from actorhub import (
136
+ ActorHub,
137
+ AuthenticationError,
138
+ RateLimitError,
139
+ ValidationError,
140
+ NotFoundError,
141
+ )
142
+
143
+ client = ActorHub(api_key="your-api-key")
144
+
145
+ try:
146
+ result = client.verify(image_url="https://example.com/image.jpg")
147
+ except AuthenticationError:
148
+ print("Invalid API key")
149
+ except RateLimitError as e:
150
+ print(f"Rate limit exceeded. Retry after: {e.retry_after} seconds")
151
+ except ValidationError as e:
152
+ print(f"Validation error: {e.message}")
153
+ except NotFoundError:
154
+ print("Resource not found")
155
+ ```
156
+
157
+ ## Configuration
158
+
159
+ ```python
160
+ client = ActorHub(
161
+ api_key="your-api-key",
162
+ base_url="https://api.actorhub.ai", # Custom base URL
163
+ timeout=30.0, # Request timeout in seconds
164
+ max_retries=3, # Max retry attempts
165
+ )
166
+ ```
167
+
168
+ ## API Reference
169
+
170
+ ### ActorHub Client
171
+
172
+ | Method | Description |
173
+ |--------|-------------|
174
+ | `verify()` | Verify if image contains protected identities |
175
+ | `get_identity()` | Get identity details by ID |
176
+ | `check_consent()` | Check consent status for AI generation |
177
+ | `list_marketplace()` | Search marketplace listings |
178
+ | `get_my_licenses()` | Get user's purchased licenses |
179
+ | `purchase_license()` | Purchase a license |
180
+ | `train_actor_pack()` | Initiate Actor Pack training |
181
+ | `get_actor_pack()` | Get Actor Pack status |
182
+
183
+ ## Requirements
184
+
185
+ - Python 3.8+
186
+ - httpx
187
+ - pydantic
188
+ - tenacity
189
+
190
+ ## License
191
+
192
+ MIT License - see [LICENSE](LICENSE) for details.
193
+
194
+ ## Links
195
+
196
+ - [Documentation](https://docs.actorhub.ai)
197
+ - [API Reference](https://api.actorhub.ai/docs)
198
+ - [GitHub](https://github.com/actorhub/actorhub-python)
199
+ - [PyPI](https://pypi.org/project/actorhub/)
@@ -0,0 +1,57 @@
1
+ """
2
+ ActorHub.ai Python SDK
3
+
4
+ Official Python client for the ActorHub.ai API.
5
+ Verify AI-generated content against protected identities.
6
+ """
7
+
8
+ from .client import ActorHub, AsyncActorHub
9
+ from .models import (
10
+ VerifyResponse,
11
+ VerifyResult,
12
+ IdentityResponse,
13
+ ConsentCheckResponse,
14
+ ConsentResult,
15
+ MarketplaceListingResponse,
16
+ LicenseResponse,
17
+ ActorPackResponse,
18
+ TrainingStatus,
19
+ ProtectionLevel,
20
+ LicenseType,
21
+ UsageType,
22
+ )
23
+ from .exceptions import (
24
+ ActorHubError,
25
+ AuthenticationError,
26
+ RateLimitError,
27
+ ValidationError,
28
+ NotFoundError,
29
+ ServerError,
30
+ )
31
+
32
+ __version__ = "0.1.0"
33
+ __all__ = [
34
+ # Clients
35
+ "ActorHub",
36
+ "AsyncActorHub",
37
+ # Models
38
+ "VerifyResponse",
39
+ "VerifyResult",
40
+ "IdentityResponse",
41
+ "ConsentCheckResponse",
42
+ "ConsentResult",
43
+ "MarketplaceListingResponse",
44
+ "LicenseResponse",
45
+ "ActorPackResponse",
46
+ "TrainingStatus",
47
+ "ProtectionLevel",
48
+ "LicenseType",
49
+ "UsageType",
50
+ # Exceptions
51
+ "ActorHubError",
52
+ "AuthenticationError",
53
+ "RateLimitError",
54
+ "ValidationError",
55
+ "NotFoundError",
56
+ "ServerError",
57
+ ]