{"id":26906738,"url":"https://github.com/notyusheng/xlsx-translate","last_synced_at":"2025-04-01T11:18:31.437Z","repository":{"id":285405073,"uuid":"957773074","full_name":"NotYuSheng/xlsx-translate","owner":"NotYuSheng","description":"A tool for batch-translating .xlsx spreadsheets from Arabic to English using a locally hosted LLM in LM Studio","archived":false,"fork":false,"pushed_at":"2025-03-31T15:29:53.000Z","size":28,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T15:54:08.181Z","etag":null,"topics":["docker","docker-compose","fastapi","lm-studio","mistral","openai","openpyxl","streamlit","translate"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NotYuSheng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-31T05:24:34.000Z","updated_at":"2025-03-31T15:29:57.000Z","dependencies_parsed_at":"2025-03-31T16:04:59.480Z","dependency_job_id":null,"html_url":"https://github.com/NotYuSheng/xlsx-translate","commit_stats":null,"previous_names":["notyusheng/xlsx-translate"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2Fxlsx-translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2Fxlsx-translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2Fxlsx-translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2Fxlsx-translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NotYuSheng","download_url":"https://codeload.github.com/NotYuSheng/xlsx-translate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246628227,"owners_count":20808107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","fastapi","lm-studio","mistral","openai","openpyxl","streamlit","translate"],"created_at":"2025-04-01T11:18:30.795Z","updated_at":"2025-04-01T11:18:31.423Z","avatar_url":"https://github.com/NotYuSheng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📄 Arabic-to-English XLSX Translator\n\nA tool for batch-translating `.xlsx` spreadsheets from **Arabic to English** using a locally hosted LLM in **LM Studio**. It supports:\n\n- ✅ Multi-sheet Excel files\n- ✅ Cell-by-cell translation (only if Arabic is detected)\n- ✅ Original formatting preserved (fonts, borders, colors, etc.)\n- ✅ Translated sheet names\n- ✅ Streamlit frontend for file uploads + downloads\n- ✅ FastAPI backend for processing logic\n\n## 🚀 Features\n\n- Upload and translate multiple `.xlsx` files at once\n- Only cells with Arabic text are translated\n- Translated cells are formatted as:\n  ```\n  Original: [Arabic]\n  Translated: [English]\n  ```\n- Preserves original Excel formatting using `openpyxl`\n- Works entirely offline using [LM Studio](https://lmstudio.ai/)\n- Easy to use via web UI or API\n\n## 📆 Tech Stack\n\n- **Python 3.10**\n- **FastAPI** — backend API\n- **Streamlit** — frontend UI\n- **OpenAI SDK** — calls LM Studio over OpenAI-compatible API\n- **openpyxl** — for cell-wise translation with formatting\n- **Docker + Docker Compose** — for full containerization\n\n## 🧑‍💻 Setup\n\n### 1. Prerequisites\n\n- [Docker](https://www.docker.com/)\n- [LM Studio](https://lmstudio.ai/) running with a supported LLM (e.g., `Nous-Hermes-2-Mistral-7B-DPO-GGUF`)\n\n\u003e LM Studio must be running at `http://192.168.1.121:1234` (or update the URL in `translate.py`)\n\n### 2. Clone the repo\n\n```bash\ngit clone https://github.com/notyusheng/xlsx-translate.git\ncd xlsx-translate\n```\n\n### 3. Start the app\n\n```bash\ndocker compose up --build\n```\n\n- Streamlit UI: [http://localhost:8501](http://localhost:8501)\n- FastAPI backend: [http://localhost:8000/docs](http://localhost:8000/docs)\n\n## 🗀️ Using the App\n\n1. Open the Streamlit UI in your browser.\n2. Upload one or more `.xlsx` files.\n3. Click **Translate**.\n4. Download the translated files with formatting and cell structure preserved.\n\n## 🧠 How It Works\n\n- Files are uploaded to the FastAPI backend\n- Each `.xlsx` workbook is loaded via `openpyxl`\n- The app:\n  - Loops through each sheet\n  - Translates Arabic cells using a local LLM\n  - Translates sheet names if in Arabic\n  - Writes values back to the workbook **without altering formatting**\n- Files are returned for download via the frontend\n\n## 💠 Customize\n\n### Change LLM endpoint\n\nEdit this line in `translate.py`:\n\n```python\nclient = openai.OpenAI(\n    base_url=\"http://192.168.1.1:1234/v1\",\n    api_key=\"lm-studio\"\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotyusheng%2Fxlsx-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotyusheng%2Fxlsx-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotyusheng%2Fxlsx-translate/lists"}