podfeed-sdk 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.
- podfeed_sdk-0.1.0/PKG-INFO +219 -0
- podfeed_sdk-0.1.0/README.md +183 -0
- podfeed_sdk-0.1.0/podfeed/__init__.py +26 -0
- podfeed_sdk-0.1.0/podfeed/client.py +562 -0
- podfeed_sdk-0.1.0/podfeed/exceptions.py +23 -0
- podfeed_sdk-0.1.0/podfeed/types.py +212 -0
- podfeed_sdk-0.1.0/podfeed_sdk.egg-info/PKG-INFO +219 -0
- podfeed_sdk-0.1.0/podfeed_sdk.egg-info/SOURCES.txt +12 -0
- podfeed_sdk-0.1.0/podfeed_sdk.egg-info/dependency_links.txt +1 -0
- podfeed_sdk-0.1.0/podfeed_sdk.egg-info/requires.txt +9 -0
- podfeed_sdk-0.1.0/podfeed_sdk.egg-info/top_level.txt +1 -0
- podfeed_sdk-0.1.0/pyproject.toml +45 -0
- podfeed_sdk-0.1.0/setup.cfg +4 -0
- podfeed_sdk-0.1.0/setup.py +51 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: podfeed-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Python SDK for the PodFeed API
|
|
5
|
+
Home-page: https://github.com/smh-labs/podfeed-sdk-samples
|
|
6
|
+
Author: PodFeed
|
|
7
|
+
Author-email: PodFeed <api-support@podfeed.ai>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://podfeed.ai
|
|
10
|
+
Project-URL: Documentation, https://docs.podfeed.ai
|
|
11
|
+
Project-URL: Repository, https://github.com/podfeed/podfeed-sdk-python
|
|
12
|
+
Project-URL: Bug Reports, https://github.com/podfeed/podfeed-sdk-python/issues
|
|
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.7
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Requires-Python: >=3.7
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
Requires-Dist: requests>=2.25.0
|
|
26
|
+
Requires-Dist: pydantic<3.0.0,>=1.10.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-cov>=2.0; extra == "dev"
|
|
30
|
+
Requires-Dist: black>=22.0; extra == "dev"
|
|
31
|
+
Requires-Dist: flake8>=4.0; extra == "dev"
|
|
32
|
+
Requires-Dist: mypy>=0.910; extra == "dev"
|
|
33
|
+
Dynamic: author
|
|
34
|
+
Dynamic: home-page
|
|
35
|
+
Dynamic: requires-python
|
|
36
|
+
|
|
37
|
+
# PodFeed SDK
|
|
38
|
+
|
|
39
|
+
A Python SDK for the PodFeed API, enabling developers to generate high-quality Podcast-style audio content from various input sources using AI.
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
- **Multiple Input Types**: Support for text, URLs, files, topics, and bring-your-own-script
|
|
44
|
+
- **Audio Generation Modes**: Monologue (single voice) and dialogue (two voices) modes
|
|
45
|
+
- **Voice Customization**: Multiple voice options for different languages. Some voices support custom instructions
|
|
46
|
+
- **Script Customization**: Adjustable complexity levels, lengths, and emphasis
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install podfeed-sdk
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
To install in editable (developer) mode:
|
|
56
|
+
```bash
|
|
57
|
+
python3 -m venv venv
|
|
58
|
+
. venv/bin/activate
|
|
59
|
+
|
|
60
|
+
pip install -e podfeed
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Authentication
|
|
64
|
+
|
|
65
|
+
The SDK supports two ways to provide your API key:
|
|
66
|
+
|
|
67
|
+
1. **Environment Variable**:
|
|
68
|
+
```bash
|
|
69
|
+
export PODFEED_API_KEY="your-api-key-here"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
2. **Direct initialization**:
|
|
73
|
+
```python
|
|
74
|
+
from podfeed import PodfeedClient
|
|
75
|
+
|
|
76
|
+
client = PodfeedClient(api_key="your-api-key-here")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Quick Start
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Get an API key
|
|
83
|
+
|
|
84
|
+
**Temporary Solution**
|
|
85
|
+
1. Login to tst.podfeed.ai, get JWT token from Browser
|
|
86
|
+
2. Run:
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
import requests
|
|
90
|
+
|
|
91
|
+
URL = "https://podfeed-tst-gateway-deulhl0f.uc.gateway.dev"
|
|
92
|
+
api_key_request = {
|
|
93
|
+
"name": "Test key",
|
|
94
|
+
"description": "Test key"
|
|
95
|
+
}
|
|
96
|
+
access_token = PASTE_YOUR_ACCESS_TOKEN_HERE
|
|
97
|
+
api_key_response = requests.post(f"{URL}/api/api-keys/create", headers={"Authorization": f"Bearer {access_token}"},json=api_key_request)
|
|
98
|
+
print(api_key_response.json())
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### Generate Audio (from Website)
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from podfeed import (
|
|
107
|
+
PodfeedClient,
|
|
108
|
+
PodfeedError,
|
|
109
|
+
AudioGenerationRequest,
|
|
110
|
+
InputContent,
|
|
111
|
+
VoiceConfig,
|
|
112
|
+
ContentConfig,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# Initialize client (uses PODFEED_API_KEY env var)
|
|
116
|
+
client = PodfeedClient()
|
|
117
|
+
|
|
118
|
+
# Example URL
|
|
119
|
+
website_url = "https://podfeed.ai/faq"
|
|
120
|
+
|
|
121
|
+
# Generate audio from website
|
|
122
|
+
result = client.generate_audio(
|
|
123
|
+
request=AudioGenerationRequest(
|
|
124
|
+
input_type="url",
|
|
125
|
+
mode="dialogue",
|
|
126
|
+
input_content=InputContent(url=website_url),
|
|
127
|
+
voice_config=VoiceConfig(
|
|
128
|
+
host_voice="google-male-puck", cohost_voice="google-female-leda"
|
|
129
|
+
),
|
|
130
|
+
content_config=ContentConfig(
|
|
131
|
+
level="intermediate",
|
|
132
|
+
length="medium",
|
|
133
|
+
language="en-US",
|
|
134
|
+
),
|
|
135
|
+
)
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
task_id = response["task_id"]
|
|
139
|
+
print(f"Task created: {task_id}")
|
|
140
|
+
|
|
141
|
+
# Wait for completion
|
|
142
|
+
result = client.wait_for_completion(task_id)
|
|
143
|
+
print(f"Audio generated: {result['result']['audio_url']}")
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### List Available Voices
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
from podfeed import PodfeedClient
|
|
150
|
+
|
|
151
|
+
api_key = os.getenv("PODFEED_API_KEY")
|
|
152
|
+
if not api_key:
|
|
153
|
+
print("Error: PODFEED_API_KEY environment variable not set")
|
|
154
|
+
return 1
|
|
155
|
+
|
|
156
|
+
client = PodfeedClient(api_key=api_key)
|
|
157
|
+
|
|
158
|
+
voices_config = client.list_available_voices()
|
|
159
|
+
print(voices_config)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Usage Examples
|
|
163
|
+
See `examples` directory.
|
|
164
|
+
|
|
165
|
+
## Error Handling
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
from podfeed_sdk import PodfeedClient, PodfeedError, PodfeedAuthError, PodfeedAPIError
|
|
169
|
+
|
|
170
|
+
try:
|
|
171
|
+
client = PodfeedClient()
|
|
172
|
+
response = client.generate_audio(
|
|
173
|
+
input_type="text",
|
|
174
|
+
text_content="Sample text"
|
|
175
|
+
)
|
|
176
|
+
except PodFeedAuthError as e:
|
|
177
|
+
print(f"Authentication error: {e}")
|
|
178
|
+
except PodFeedAPIError as e:
|
|
179
|
+
print(f"API error: {e.message} (Status: {e.status_code})")
|
|
180
|
+
except PodFeedError as e:
|
|
181
|
+
print(f"General error: {e}")
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## API Reference
|
|
185
|
+
|
|
186
|
+
### Core Methods
|
|
187
|
+
|
|
188
|
+
- `generate_audio(**kwargs)` - Generate audio from various input types
|
|
189
|
+
- `wait_for_completion(task_id, timeout=1800)` - Wait for task completion
|
|
190
|
+
- `get_task_progress(task_id)` - Check task progress
|
|
191
|
+
- `get_audio_status(task_id)` - Get audio generation status
|
|
192
|
+
|
|
193
|
+
### Audio Management
|
|
194
|
+
|
|
195
|
+
- `list_audios(limit=20, offset=0, status=None)` - List audio files
|
|
196
|
+
- `get_audio(audio_id)` - Get audio details
|
|
197
|
+
- `delete_audio(audio_id)` - Delete audio file
|
|
198
|
+
- `download_audio_with_metadata(audio_id)` - Download with metadata
|
|
199
|
+
|
|
200
|
+
### File Operations
|
|
201
|
+
|
|
202
|
+
- `get_upload_urls(files)` - Get signed upload URLs
|
|
203
|
+
- `create_share_link(audio_id)` - Create shareable link
|
|
204
|
+
|
|
205
|
+
### Account
|
|
206
|
+
|
|
207
|
+
- `get_account_usage()` - Get usage statistics
|
|
208
|
+
|
|
209
|
+
## Requirements
|
|
210
|
+
|
|
211
|
+
- Python 3.7+
|
|
212
|
+
- requests >= 2.25.0
|
|
213
|
+
|
|
214
|
+
## Rate Limits
|
|
215
|
+
TODO
|
|
216
|
+
|
|
217
|
+
## Support
|
|
218
|
+
|
|
219
|
+
For API support, email support@podfeed.ai.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# PodFeed SDK
|
|
2
|
+
|
|
3
|
+
A Python SDK for the PodFeed API, enabling developers to generate high-quality Podcast-style audio content from various input sources using AI.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multiple Input Types**: Support for text, URLs, files, topics, and bring-your-own-script
|
|
8
|
+
- **Audio Generation Modes**: Monologue (single voice) and dialogue (two voices) modes
|
|
9
|
+
- **Voice Customization**: Multiple voice options for different languages. Some voices support custom instructions
|
|
10
|
+
- **Script Customization**: Adjustable complexity levels, lengths, and emphasis
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install podfeed-sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
To install in editable (developer) mode:
|
|
20
|
+
```bash
|
|
21
|
+
python3 -m venv venv
|
|
22
|
+
. venv/bin/activate
|
|
23
|
+
|
|
24
|
+
pip install -e podfeed
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Authentication
|
|
28
|
+
|
|
29
|
+
The SDK supports two ways to provide your API key:
|
|
30
|
+
|
|
31
|
+
1. **Environment Variable**:
|
|
32
|
+
```bash
|
|
33
|
+
export PODFEED_API_KEY="your-api-key-here"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
2. **Direct initialization**:
|
|
37
|
+
```python
|
|
38
|
+
from podfeed import PodfeedClient
|
|
39
|
+
|
|
40
|
+
client = PodfeedClient(api_key="your-api-key-here")
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Get an API key
|
|
47
|
+
|
|
48
|
+
**Temporary Solution**
|
|
49
|
+
1. Login to tst.podfeed.ai, get JWT token from Browser
|
|
50
|
+
2. Run:
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import requests
|
|
54
|
+
|
|
55
|
+
URL = "https://podfeed-tst-gateway-deulhl0f.uc.gateway.dev"
|
|
56
|
+
api_key_request = {
|
|
57
|
+
"name": "Test key",
|
|
58
|
+
"description": "Test key"
|
|
59
|
+
}
|
|
60
|
+
access_token = PASTE_YOUR_ACCESS_TOKEN_HERE
|
|
61
|
+
api_key_response = requests.post(f"{URL}/api/api-keys/create", headers={"Authorization": f"Bearer {access_token}"},json=api_key_request)
|
|
62
|
+
print(api_key_response.json())
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### Generate Audio (from Website)
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from podfeed import (
|
|
71
|
+
PodfeedClient,
|
|
72
|
+
PodfeedError,
|
|
73
|
+
AudioGenerationRequest,
|
|
74
|
+
InputContent,
|
|
75
|
+
VoiceConfig,
|
|
76
|
+
ContentConfig,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Initialize client (uses PODFEED_API_KEY env var)
|
|
80
|
+
client = PodfeedClient()
|
|
81
|
+
|
|
82
|
+
# Example URL
|
|
83
|
+
website_url = "https://podfeed.ai/faq"
|
|
84
|
+
|
|
85
|
+
# Generate audio from website
|
|
86
|
+
result = client.generate_audio(
|
|
87
|
+
request=AudioGenerationRequest(
|
|
88
|
+
input_type="url",
|
|
89
|
+
mode="dialogue",
|
|
90
|
+
input_content=InputContent(url=website_url),
|
|
91
|
+
voice_config=VoiceConfig(
|
|
92
|
+
host_voice="google-male-puck", cohost_voice="google-female-leda"
|
|
93
|
+
),
|
|
94
|
+
content_config=ContentConfig(
|
|
95
|
+
level="intermediate",
|
|
96
|
+
length="medium",
|
|
97
|
+
language="en-US",
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
task_id = response["task_id"]
|
|
103
|
+
print(f"Task created: {task_id}")
|
|
104
|
+
|
|
105
|
+
# Wait for completion
|
|
106
|
+
result = client.wait_for_completion(task_id)
|
|
107
|
+
print(f"Audio generated: {result['result']['audio_url']}")
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### List Available Voices
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
from podfeed import PodfeedClient
|
|
114
|
+
|
|
115
|
+
api_key = os.getenv("PODFEED_API_KEY")
|
|
116
|
+
if not api_key:
|
|
117
|
+
print("Error: PODFEED_API_KEY environment variable not set")
|
|
118
|
+
return 1
|
|
119
|
+
|
|
120
|
+
client = PodfeedClient(api_key=api_key)
|
|
121
|
+
|
|
122
|
+
voices_config = client.list_available_voices()
|
|
123
|
+
print(voices_config)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Usage Examples
|
|
127
|
+
See `examples` directory.
|
|
128
|
+
|
|
129
|
+
## Error Handling
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from podfeed_sdk import PodfeedClient, PodfeedError, PodfeedAuthError, PodfeedAPIError
|
|
133
|
+
|
|
134
|
+
try:
|
|
135
|
+
client = PodfeedClient()
|
|
136
|
+
response = client.generate_audio(
|
|
137
|
+
input_type="text",
|
|
138
|
+
text_content="Sample text"
|
|
139
|
+
)
|
|
140
|
+
except PodFeedAuthError as e:
|
|
141
|
+
print(f"Authentication error: {e}")
|
|
142
|
+
except PodFeedAPIError as e:
|
|
143
|
+
print(f"API error: {e.message} (Status: {e.status_code})")
|
|
144
|
+
except PodFeedError as e:
|
|
145
|
+
print(f"General error: {e}")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## API Reference
|
|
149
|
+
|
|
150
|
+
### Core Methods
|
|
151
|
+
|
|
152
|
+
- `generate_audio(**kwargs)` - Generate audio from various input types
|
|
153
|
+
- `wait_for_completion(task_id, timeout=1800)` - Wait for task completion
|
|
154
|
+
- `get_task_progress(task_id)` - Check task progress
|
|
155
|
+
- `get_audio_status(task_id)` - Get audio generation status
|
|
156
|
+
|
|
157
|
+
### Audio Management
|
|
158
|
+
|
|
159
|
+
- `list_audios(limit=20, offset=0, status=None)` - List audio files
|
|
160
|
+
- `get_audio(audio_id)` - Get audio details
|
|
161
|
+
- `delete_audio(audio_id)` - Delete audio file
|
|
162
|
+
- `download_audio_with_metadata(audio_id)` - Download with metadata
|
|
163
|
+
|
|
164
|
+
### File Operations
|
|
165
|
+
|
|
166
|
+
- `get_upload_urls(files)` - Get signed upload URLs
|
|
167
|
+
- `create_share_link(audio_id)` - Create shareable link
|
|
168
|
+
|
|
169
|
+
### Account
|
|
170
|
+
|
|
171
|
+
- `get_account_usage()` - Get usage statistics
|
|
172
|
+
|
|
173
|
+
## Requirements
|
|
174
|
+
|
|
175
|
+
- Python 3.7+
|
|
176
|
+
- requests >= 2.25.0
|
|
177
|
+
|
|
178
|
+
## Rate Limits
|
|
179
|
+
TODO
|
|
180
|
+
|
|
181
|
+
## Support
|
|
182
|
+
|
|
183
|
+
For API support, email support@podfeed.ai.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Podfeed SDK - A minimal Python SDK for the Podfeed API."""
|
|
2
|
+
|
|
3
|
+
from .client import PodfeedClient
|
|
4
|
+
from .exceptions import PodfeedError, PodfeedAuthError, PodfeedAPIError
|
|
5
|
+
from .types import (
|
|
6
|
+
InputContent,
|
|
7
|
+
VoiceConfig,
|
|
8
|
+
ContentConfig,
|
|
9
|
+
AudioGenerationRequest,
|
|
10
|
+
TaskProgress,
|
|
11
|
+
AudioDetails,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
__version__ = "0.1.0"
|
|
15
|
+
__all__ = [
|
|
16
|
+
"PodfeedClient",
|
|
17
|
+
"PodfeedError",
|
|
18
|
+
"PodfeedAuthError",
|
|
19
|
+
"PodfeedAPIError",
|
|
20
|
+
"InputContent",
|
|
21
|
+
"VoiceConfig",
|
|
22
|
+
"ContentConfig",
|
|
23
|
+
"AudioGenerationRequest",
|
|
24
|
+
"TaskProgress",
|
|
25
|
+
"AudioDetails",
|
|
26
|
+
]
|