u-transkript 1.0.0__py3-none-any.whl
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,284 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: u-transkript
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: YouTube videolarını otomatik olarak çıkarıp AI ile çeviren güçlü Python kütüphanesi
|
|
5
|
+
Home-page: https://github.com/U-C4N/u-transkript
|
|
6
|
+
Author: U-C4N
|
|
7
|
+
Author-email: noreply@deuz.ai
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Documentation, https://github.com/U-C4N/u-transkript/blob/main/README.md
|
|
10
|
+
Project-URL: Source, https://github.com/U-C4N/u-transkript/
|
|
11
|
+
Project-URL: Tracker, https://github.com/U-C4N/u-transkript/issues
|
|
12
|
+
Keywords: youtube,transcript,translation,ai,gemini,subtitle,video,nlp,machine-learning,automation
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Education
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Classifier: Topic :: Multimedia :: Video
|
|
27
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
29
|
+
Requires-Python: >=3.7
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
Requires-Dist: requests>=2.25.1
|
|
32
|
+
Requires-Dist: lxml>=4.6.0
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-cov>=2.0; extra == "dev"
|
|
36
|
+
Requires-Dist: black>=21.0; extra == "dev"
|
|
37
|
+
Requires-Dist: flake8>=3.8; extra == "dev"
|
|
38
|
+
Requires-Dist: mypy>=0.800; extra == "dev"
|
|
39
|
+
Provides-Extra: docs
|
|
40
|
+
Requires-Dist: sphinx>=4.0; extra == "docs"
|
|
41
|
+
Requires-Dist: sphinx-rtd-theme>=1.0; extra == "docs"
|
|
42
|
+
Dynamic: author
|
|
43
|
+
Dynamic: author-email
|
|
44
|
+
Dynamic: classifier
|
|
45
|
+
Dynamic: description
|
|
46
|
+
Dynamic: description-content-type
|
|
47
|
+
Dynamic: home-page
|
|
48
|
+
Dynamic: keywords
|
|
49
|
+
Dynamic: license
|
|
50
|
+
Dynamic: project-url
|
|
51
|
+
Dynamic: provides-extra
|
|
52
|
+
Dynamic: requires-dist
|
|
53
|
+
Dynamic: requires-python
|
|
54
|
+
Dynamic: summary
|
|
55
|
+
|
|
56
|
+
# 🎬 U-Transkript
|
|
57
|
+
|
|
58
|
+
[](https://python.org)
|
|
59
|
+
[](LICENSE)
|
|
60
|
+
[](https://pypi.org/project/u-transkript/)
|
|
61
|
+
[](https://ai.google.dev/)
|
|
62
|
+
|
|
63
|
+
**Powerful Python library to automatically extract and translate YouTube videos with AI**
|
|
64
|
+
|
|
65
|
+
U-Transkript is a modern and user-friendly Python package that extracts transcripts (subtitles) from YouTube videos and translates them into your desired language using Google Gemini AI. It offers an excellent solution for education, research, content creation, and much more.
|
|
66
|
+
|
|
67
|
+
## ✨ Features
|
|
68
|
+
|
|
69
|
+
🤖 **AI-Powered Translation** - High-quality translations with Google Gemini AI
|
|
70
|
+
🌍 **Multi-Language Support** - Ability to translate into 50+ languages
|
|
71
|
+
📊 **Flexible Output Formats** - Get results in TXT, JSON, XML formats
|
|
72
|
+
🔗 **Method Chaining** - Easy to use with chained function calls
|
|
73
|
+
⚡ **Fast and Efficient** - Optimized performance
|
|
74
|
+
🛡️ **Secure** - Error handling and secure API calls
|
|
75
|
+
📝 **Detailed Documentation** - Comprehensive user guide
|
|
76
|
+
|
|
77
|
+
## 🚀 Quick Start
|
|
78
|
+
|
|
79
|
+
### Installation
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pip install u-transkript
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Basic Usage
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from u_transkript import AITranscriptTranslator
|
|
89
|
+
|
|
90
|
+
# Create Translator
|
|
91
|
+
translator = AITranscriptTranslator("YOUR_GEMINI_API_KEY")
|
|
92
|
+
|
|
93
|
+
# Translate Video
|
|
94
|
+
result = translator.set_lang("English").translate_transcript("dQw4w9WgXcQ")
|
|
95
|
+
print(result)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Advanced Usage with Method Chaining
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
# Set all settings at once
|
|
102
|
+
result = (translator
|
|
103
|
+
.set_model("gemini-2.5-flash")
|
|
104
|
+
.set_lang("English")
|
|
105
|
+
.set_type("json")
|
|
106
|
+
.translate_transcript("VIDEO_ID"))
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 📖 Detailed Documentation
|
|
110
|
+
|
|
111
|
+
### Main Functions
|
|
112
|
+
|
|
113
|
+
| Function | Description | Example |
|
|
114
|
+
|-----------|----------|-------|
|
|
115
|
+
| `set_model(model)` | Set the Gemini model | `translator.set_model("gemini-2.5-flash")` |
|
|
116
|
+
| `set_api(api_key)` | Set the API key | `translator.set_api("YOUR_API_KEY")` |
|
|
117
|
+
| `set_lang(language)` | Set the target language | `translator.set_lang("English")` |
|
|
118
|
+
| `set_type(format)` | Set the output format | `translator.set_type("json")` |
|
|
119
|
+
| `translate_transcript(video_id)` | Main translation function | `translator.translate_transcript("VIDEO_ID")` |
|
|
120
|
+
|
|
121
|
+
### Supported Output Formats
|
|
122
|
+
|
|
123
|
+
#### 📄 TXT Format
|
|
124
|
+
```python
|
|
125
|
+
translator.set_type("txt")
|
|
126
|
+
# Output: "Hello, this is an example translation..."
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### 📋 JSON Format
|
|
130
|
+
```python
|
|
131
|
+
translator.set_type("json")
|
|
132
|
+
# Output: Structured JSON data (with metadata)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### 🏷️ XML Format
|
|
136
|
+
```python
|
|
137
|
+
translator.set_type("xml")
|
|
138
|
+
# Output: Full data structure in XML format
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Supported Languages
|
|
142
|
+
|
|
143
|
+
🇹🇷 Turkish • 🇺🇸 English • 🇪🇸 Spanish • 🇫🇷 French • 🇩🇪 German • 🇮🇹 Italian • 🇵🇹 Portuguese • 🇷🇺 Russian • 🇯🇵 Japanese • 🇰🇷 Korean • 🇨🇳 Chinese • 🇸🇦 Arabic
|
|
144
|
+
|
|
145
|
+
## 💡 Use Cases
|
|
146
|
+
|
|
147
|
+
### 📰 News Content
|
|
148
|
+
```python
|
|
149
|
+
# Translating news videos
|
|
150
|
+
result = translator.set_lang("English").translate_transcript("NEWS_VIDEO_ID")
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 💼 Business Presentations
|
|
154
|
+
```python
|
|
155
|
+
# Translating technical presentations
|
|
156
|
+
result = translator.set_type("json").translate_transcript("PRESENTATION_ID")
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 🎬 Content Creation
|
|
160
|
+
```python
|
|
161
|
+
# Translating YouTube content into different languages
|
|
162
|
+
video_ids = ["VIDEO1", "VIDEO2", "VIDEO3"]
|
|
163
|
+
for video_id in video_ids:
|
|
164
|
+
result = translator.set_lang("English").translate_transcript(video_id)
|
|
165
|
+
with open(f"{video_id}_en.txt", "w") as f:
|
|
166
|
+
f.write(result)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## 🔧 Advanced Features
|
|
170
|
+
|
|
171
|
+
### Custom Prompt Usage
|
|
172
|
+
```python
|
|
173
|
+
custom_prompt = """
|
|
174
|
+
Please translate this text into {language}:
|
|
175
|
+
- Preserve technical terms
|
|
176
|
+
- Use natural language
|
|
177
|
+
- Maintain context
|
|
178
|
+
|
|
179
|
+
Text: {text}
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
result = translator.translate_transcript(
|
|
183
|
+
"VIDEO_ID",
|
|
184
|
+
custom_prompt=custom_prompt
|
|
185
|
+
)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Batch Processing
|
|
189
|
+
```python
|
|
190
|
+
videos = ["VIDEO1", "VIDEO2", "VIDEO3"]
|
|
191
|
+
results = []
|
|
192
|
+
|
|
193
|
+
for video in videos:
|
|
194
|
+
try:
|
|
195
|
+
result = translator.set_lang("English").translate_transcript(video)
|
|
196
|
+
results.append({"video": video, "translation": result})
|
|
197
|
+
except Exception as e:
|
|
198
|
+
results.append({"video": video, "error": str(e)})
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Saving to File
|
|
202
|
+
```python
|
|
203
|
+
# Saving in JSON format
|
|
204
|
+
result = translator.set_type("json").translate_transcript("VIDEO_ID")
|
|
205
|
+
with open("translation.json", "w", encoding="utf-8") as f:
|
|
206
|
+
f.write(result)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## 📊 Performance
|
|
211
|
+
|
|
212
|
+
| Model | Speed | Quality | Usage |
|
|
213
|
+
|-------|-----|--------|----------|
|
|
214
|
+
| `gemini-2.0-flash-exp` | ⚡⚡⚡ | ⭐⭐⭐ | Fast translations |
|
|
215
|
+
| `gemini-2.5-flash` | ⚡⚡ | ⭐⭐⭐⭐ | Balanced performance |
|
|
216
|
+
| `gemini-pro` | ⚡ | ⭐⭐⭐⭐⭐ | Highest quality |
|
|
217
|
+
|
|
218
|
+
## 🔍 Troubleshooting
|
|
219
|
+
|
|
220
|
+
### Common Errors
|
|
221
|
+
|
|
222
|
+
**API Key Error**
|
|
223
|
+
```python
|
|
224
|
+
# ❌ Incorrect
|
|
225
|
+
translator = AITranscriptTranslator("")
|
|
226
|
+
|
|
227
|
+
# ✅ Correct
|
|
228
|
+
translator = AITranscriptTranslator("VALID_API_KEY")
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**Video Not Found**
|
|
232
|
+
```python
|
|
233
|
+
# Ensure the Video ID is correct
|
|
234
|
+
video_id = "dQw4w9WgXcQ" # 11 characters
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Language Error**
|
|
238
|
+
```python
|
|
239
|
+
# ❌ Incorrect
|
|
240
|
+
translator.set_lang("en")
|
|
241
|
+
|
|
242
|
+
# ✅ Correct
|
|
243
|
+
translator.set_lang("English")
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Debug Mode
|
|
247
|
+
```python
|
|
248
|
+
import logging
|
|
249
|
+
logging.basicConfig(level=logging.DEBUG)
|
|
250
|
+
|
|
251
|
+
try:
|
|
252
|
+
result = translator.translate_transcript("VIDEO_ID")
|
|
253
|
+
except Exception as e:
|
|
254
|
+
print(f"Error: {e}")
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## 📈 Roadmap
|
|
258
|
+
|
|
259
|
+
- [ ] **v1.1.0** - Batch processing support
|
|
260
|
+
- [ ] **v1.2.0** - Caching system
|
|
261
|
+
- [ ] **v1.3.0** - CLI interface
|
|
262
|
+
- [ ] **v1.4.0** - Web interface
|
|
263
|
+
- [ ] **v1.5.0** - Support for more AI models
|
|
264
|
+
|
|
265
|
+
## 🤝 Contributing
|
|
266
|
+
|
|
267
|
+
We welcome your contributions!
|
|
268
|
+
|
|
269
|
+
1. Fork it
|
|
270
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
271
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
272
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
273
|
+
5. Open a Pull Request
|
|
274
|
+
|
|
275
|
+
## 📄 License
|
|
276
|
+
|
|
277
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
## 📞 Contact
|
|
281
|
+
|
|
282
|
+
- **GitHub**: [u-transkript](https://github.com/U-C4N/u-transkript)
|
|
283
|
+
- **PyPI**: [u-transkript](https://pypi.org/project/u-transkript/)
|
|
284
|
+
- **Documentation**: [example.md](example.md)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
u_transkript-1.0.0.dist-info/METADATA,sha256=guKqwez7icdKgT_et0kgnbclY_JboEZt2rao6Oe6jYU,8706
|
|
2
|
+
u_transkript-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
3
|
+
u_transkript-1.0.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
4
|
+
u_transkript-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|