Skip to content

netglade/deepl-streamlit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Translator App 📄

A simple Streamlit application for translating PDF documents using the DeepL API.

Features

  • Two-column layout: Upload on the left, view translated document on the right
  • PDF information display: Shows number of pages and file size
  • Real-time translation progress: Displays spinner with time remaining
  • PDF viewer: Built-in PDF.js viewer for the translated document
  • Download functionality: Download the translated PDF
  • Multiple languages: Support for Spanish, French, German, Italian, Portuguese, Russian, Chinese, and Japanese

Setup

  1. Clone the repository (if applicable) or ensure you have all the files

  2. Install dependencies:

    pip install -r requirements.txt
  3. Get a DeepL API key:

    • Go to DeepL API
    • Sign up for an account
    • Get your API key from the dashboard

Usage

  1. Run the Streamlit app:

    streamlit run app.py
  2. Enter your DeepL API key in the sidebar

  3. Select target language from the dropdown in the sidebar

  4. Upload a PDF file using the file uploader on the left side

  5. View document info: The app will display the number of pages and file size

  6. Click "Translate Document" to start the translation process

  7. Monitor progress: Watch the spinner and time remaining on the right side

  8. View and download: Once complete, view the translated PDF and download it

Requirements

  • Python 3.7+
  • DeepL API key (Free or Pro account)
  • Internet connection for API calls

Dependencies

  • streamlit: Web app framework
  • deepl: Official DeepL Python client
  • PyPDF2: PDF manipulation library
  • requests: HTTP library for API calls
  • streamlit-pdf-viewer: PDF viewing component

Supported File Types

  • PDF files only (.pdf)

Supported Languages

  • Spanish (ES)
  • French (FR)
  • German (DE)
  • Italian (IT)
  • Portuguese (PT)
  • Russian (RU)
  • Chinese (ZH)
  • Japanese (JA)

Notes

  • The app uses DeepL's document translation API which preserves formatting
  • Translation time depends on document size and API response time
  • Free DeepL accounts have usage limits
  • Large files may take longer to process

Troubleshooting

  1. API Key Issues: Make sure your DeepL API key is valid and has sufficient quota
  2. PDF Reading Errors: Ensure your PDF is not corrupted or password-protected
  3. Translation Failures: Check your internet connection and API quota
  4. Display Issues: Try refreshing the page if the PDF viewer doesn't load properly

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published