Metadata-Version: 2.4
Name: trns
Version: 0.1.1
Summary: Transcription and summarization tool for YouTube, Twitter/X.com videos, and local files with automatic translation and language model processing
Author-email: "Misha S." <862andfurther@gmai.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/kakoyvostorg/trns
Project-URL: Documentation, https://github.com/kakoyvostorg/trns/tree/main/docs
Project-URL: Repository, https://github.com/kakoyvostorg/trns
Project-URL: Issues, https://github.com/kakoyvostorg/trns/issues
Keywords: transcription,whisper,youtube,telegram,translation,language-model
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: youtube-transcript-api>=0.6.0
Requires-Dist: yt-dlp>=2023.10.7
Requires-Dist: faster-whisper>=0.9.0
Requires-Dist: deep-translator>=1.11.4
Requires-Dist: openai>=1.0.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: python-telegram-bot>=20.0
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# TRNS - Transcription and Language Model Processing

TRNS is a powerful tool for transcribing YouTube videos, Twitter/X.com videos, and local video files with automatic translation and language model processing. It provides both a command-line interface and a Telegram bot for easy access.

## Features

- 🎥 **Multi-source support**: YouTube videos, Twitter/X.com videos, and local video files
- 🗣️ **Speech-to-text**: Uses Whisper for high-quality transcription
- 🌍 **Automatic translation**: Translates transcriptions to Russian
- 🤖 **Language model processing**: Processes transcriptions through OpenRouter.ai for intelligent summaries
- 📱 **Telegram bot**: Interactive bot interface with real-time transcription updates
- 🖥️ **CLI tool**: Simple command-line interface: `trns <url>`

## Quick Start

### Installation

```bash
pip install trns
```

### CLI Usage

```bash
# Transcribe a YouTube video
trns https://www.youtube.com/watch?v=VIDEO_ID

# Transcribe a Twitter/X.com video
trns https://twitter.com/user/status/1234567890

# Transcribe a local video file
trns /path/to/video.mp4
```

### Telegram Bot Setup

1. Create a Telegram bot via [@BotFather](https://t.me/botfather)
2. Set environment variables or create config files:
   ```bash
   export BOT_TOKEN=your_bot_token
   export AUTH_KEY=your_auth_key
   export OPENROUTER_API_KEY=your_api_key
   export ALLOWED_USER_IDS=123456789,987654321
   ```
3. Run the bot:
   ```bash
   python -m trns.bot.server
   ```
4. Configure webhook (see [SETUP.md](docs/SETUP.md) for details)

## Configuration

TRNS supports both environment variables and file-based configuration:

### Environment Variables

- `BOT_TOKEN`: Telegram bot token
- `AUTH_KEY`: Authentication key for bot access
- `OPENROUTER_API_KEY`: OpenRouter.ai API key
- `ALLOWED_USER_IDS`: Comma-separated list of allowed Telegram user IDs
- `HOST`: Server host (default: 0.0.0.0)
- `PORT`: Server port (default: 8000)
- `CONFIG_PATH`: Path to config.json (default: config.json)
- `METADATA_PATH`: Path to metadata.json (default: metadata.json)

### File-based Configuration

Create the following files in the project root:

- `bot_key.txt`: Telegram bot token
- `key.txt`: Authentication key
- `api_key.txt`: OpenRouter.ai API key (one per line)
- `allowed_ids.txt`: Allowed user IDs (one per line)
- `config.json`: Application configuration
- `metadata.json`: Localization and metadata

See `config/` directory for example files.

## Requirements

- Python 3.8+
- FFmpeg (for audio processing)
  - macOS: `brew install ffmpeg`
  - Linux: `sudo apt-get install ffmpeg`
  - Windows: Download from [ffmpeg.org](https://ffmpeg.org/download.html)

## Documentation

- [Setup Guide](docs/SETUP.md) - Detailed setup instructions
- [Deployment Guide](docs/DEPLOYMENT.md) - Cloud deployment instructions
- [Architecture](docs/ARCHITECTURE.md) - System architecture documentation
- [Architecture (Russian)](docs/ARCHITECTURE_RU.md) - Архитектура системы
- [User Guide (Russian)](docs/USER_GUIDE_RU.md) - Руководство пользователя Telegram бота

## Development

```bash
# Clone the repository
git clone https://github.com/yourusername/trns.git
cd trns

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Format code
ruff format .

# Type checking
mypy src/
```

## Docker

```bash
# Build image
docker build -f docker/Dockerfile -t trns .

# Run with docker-compose
docker-compose -f docker/docker-compose.yml up
```

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests.

## Support

For issues and questions, please open an issue on GitHub.

