This project is a Python-based FastAPI application that allows users to upload documents and translate them into one or more target languages using Azure AI Translator.
-
π Translate documents into multiple languages using Azure AI
-
π€ Upload a single file via FastAPI endpoints
-
π₯οΈ Support for local file translation or API-based translation
-
π§ Language detection and validation via Azure
-
ποΈ Automatically returns translated files or zipped package for multiple outputs
-
πͺΆ Built using Python, FastAPI, and Azure Translator SDKs
src/
βββ api/
β βββ main.py # FastAPI app entrypoint
β βββ routes/
β β βββ translation.py # Upload and translate files
β β βββ languages.py # Fetch available languages
βββ clients/
β βββ doc_intel_client.py # Azure document translation client
β βββ text_client.py # Azure text translation client
βββ config/
β βββ local_env.py # Environment variable loader
βββ libs/
β βββ format_extensions.py # Maps file extensions to MIME types
βββ modules/
β βββ get_language_info.py # Azure language info fetcher
β βββ translate_documents.py # Core document translation logic
- Install dependencies
pip install -r requirements.txt
-
Set environment variables (via .env or system):
-
AZURE_AI_TRANSLATION_ENDPOINT
-
AZURE_AI_TRANSLATION_KEY
-
AZURE_AI_TRANSLATION_REGION
-
AZURE_AI_DOCUMENT_TRANSLATION
-
AZURE_AI_KEY
-
-
Run the app
uvicorn src.api.main:app --reload
POST /translation/upload: Upload and translate a file.
GET /languages/get_languages: Get available translation languages.
- Create the Modules needed for Azure AI translation - Done
- Create FastAPI endpoints for it - Done
- Create a streamlit app to run the application
- Create a notebook working through it
- Give option for using App Config