Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sadministrator/ziggurat
A Rust utility for translating ebooks into different languages.
https://github.com/sadministrator/ziggurat
epub pdf rust translate
Last synced: about 1 month ago
JSON representation
A Rust utility for translating ebooks into different languages.
- Host: GitHub
- URL: https://github.com/sadministrator/ziggurat
- Owner: sadministrator
- Created: 2024-10-08T22:01:30.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-10-24T05:53:55.000Z (2 months ago)
- Last Synced: 2024-10-24T20:59:40.422Z (2 months ago)
- Topics: epub, pdf, rust, translate
- Language: Rust
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![babel](https://github.com/user-attachments/assets/6a89d44e-41b3-4ece-a1b3-7ea84a305d7c)
# Ziggurat: PDF and EPUB Translator
A command-line utility written in Rust that translates PDF and EPUB files into different languages using the Google Translate API.## Prerequisites
- Google Cloud account with Translation API enabled
- Google API key## Installation
1. Clone this repository:
```
git clone https://github.com/sadministrator/ziggurat
cd ziggurat
```2. Install the project:
`cargo install --release --path .`## Configuration
You can provide a Google API key in one of several ways (listed in order of priority):
1. Pass it in the CLI command with `--api-key `.
2. Pass in the path to a JSON config file which contains the key with `--config /path/to/your/config`. Config file contents should look like `{"api_key": "YOUR_API_KEY" }`.
3. Create a `.env` file in the project root directory and add `ZIGGURAT_API_KEY=`.
4. Set it as an environment variable with `export ZIGGURAT_API_KEY=`.## Usage
`ziggurat [OPTIONS] --input --output --to `### Required Flags
- `-i, --input `: Input file (PDF or EPUB)
- `-o, --output `: Output file
- `--to `: Target language code (e.g., 'es' for Spanish, 'fr' for French)### Options:
- `--api-key `: API key
- `-v, --verbose`: Enable verbose mode
- `-h, --help`: Print help
- `-V, --version`: Print version### Example:
`ziggurat --input book.pdf --output libro.pdf --to es`This command translates `book.pdf` to Spanish and saves the result as `libro.pdf`.
## Supported Languages
This utility supports all languages available in the Google Translate API. Use the appropriate language code when specifying the target language.## Notes
- The translation quality depends on the Google Translate API.
- Processing large files may take some time and consume API quota.