{"id":21275290,"url":"https://github.com/ffreemt/deepl-fastapi","last_synced_at":"2025-06-16T13:05:21.528Z","repository":{"id":60971259,"uuid":"348075895","full_name":"ffreemt/deepl-fastapi","owner":"ffreemt","description":"your own deepl server via fastapi, cross-platform (Windows/Linux/Mac)","archived":false,"fork":false,"pushed_at":"2023-01-18T06:03:14.000Z","size":362,"stargazers_count":49,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-09T09:48:53.066Z","etag":null,"topics":["asyncio","deepl","fastapi","pyppeteer","pyppeteer2","scraper"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ffreemt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-15T18:11:53.000Z","updated_at":"2024-06-24T14:35:56.000Z","dependencies_parsed_at":"2023-02-10T13:20:23.847Z","dependency_job_id":null,"html_url":"https://github.com/ffreemt/deepl-fastapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffreemt%2Fdeepl-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffreemt%2Fdeepl-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffreemt%2Fdeepl-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffreemt%2Fdeepl-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ffreemt","download_url":"https://codeload.github.com/ffreemt/deepl-fastapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225704504,"owners_count":17511107,"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":["asyncio","deepl","fastapi","pyppeteer","pyppeteer2","scraper"],"created_at":"2024-11-21T09:29:19.806Z","updated_at":"2024-11-21T09:29:20.311Z","avatar_url":"https://github.com/ffreemt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deepl-fastapi\n\u003c!--- repo-name  pypi-name  mod_name func_name ---\u003e\n[![tests](https://github.com/ffreemt/deepl-fastapi/actions/workflows/routine-tests.yml/badge.svg)][![python](https://img.shields.io/static/v1?label=python+\u0026message=3.7%2B\u0026color=blue)](https://img.shields.io/static/v1?label=python+\u0026message=3.7%2B\u0026color=blue)[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)[![PyPI version](https://badge.fury.io/py/deepl-fastapi.svg)](https://badge.fury.io/py/deepl-fastapi)\n\nYour own deepl server via fastapi, cross-platform (Windows/Linux/MacOs) with API for OmegaT\n\n## Installation\n*   Create a virual environment: optional but recommended\n    e.g.,\n    ```bash\n    # Linux and friends\n    python3.7 -m venv .venv\n    source .venv/bin/activate\n\n    # Windows\n    # py -3.7 -m venv .venv\n    # .venv\\Scripts\\activate\n    ```\n\n```bash\npip install deepl-fastapi\n```\nor (if your use poetry)\n```bash\npoetry add deepl-fastapi\n```\nor\n```\n pip install git+https://github.com/ffreemt/deepl-fastapi.git\n```\nor\n*   Clone the repo [https://github.com/ffreemt/deepl-fastapi.git](https://github.com/ffreemt/deepl-fastapi.git)\n    ```bash\n    git clone https://github.com/ffreemt/deepl-fastapi.git\n    ```\n    and `cd deepl-fastapi`\n*   `pip install -r requirements.txt\n    * or ``poetry install``\n\n## Usage\n\n*   Start the server\n\nUse uvicorn directly (note the `deepl_server` module, not `run_uvicorn`)\n```bash\nuvicorn deepl_fastapi.deepl_server:app\n```\n\nor\n```bash\ndeepl-fastapi\n# this option is available only if installed via pip install or poetry add\n```\n\nor\n```bash\npython3.7 -m deepl_fastapi.run_uvicorn\n```\n\nor run the server on the external net, for example at port 9888\n```\nuvicorn deepl_fastapi.deepl_server:app --reload --host 0.0.0.0 --port 9888\n```\n\n*   Explore and consume\n\nPoint your browser to [http://127.0.0.1:8000/text/?q=test\u0026to_lang=zh](http://127.0.0.1:8000/text/?q=test\u0026to_lang=zh)\n\nOr in python code (`pip install requests` first)\n```python\nimport requests\n\n# get\nurl =  \"http://127.0.0.1:8000/text/?q=test me\u0026to_lang=zh\"\nprint(requests.get(url).json())\n# {'q': 'test me', 'from_lang': None, 'to_lang': 'zh',\n# 'trtext': '考我 试探我 测试我 试探'}\n\n# post\ntext = \"test this and that\"\ndata = {\"text\": text, \"to_lang\": \"zh\"}\nresp = requests.post(\"http://127.0.0.1:8000/text\", json=data)\nprint(resp.json())\n# {'q': {'text': 'test this and that', 'from_lang': None, 'to_lang': 'zh', 'description': None},\n# 'result': '试探 左右逢源 检验 审时度势'}\n\n```\n\n## Interactive Docs (Swagger UI)\n\n [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs)\n\n## OmegaT ``Fake MT`` plugin setup\n* Copy ``omegat-plugin-fake-mt-1.0.0.jar`` （available at https://github.com/briacp/omegat-plugin-fake-mt） to OmegaT\\plugins （e.g., C:\\Program Files\\OmegaT\\plugins） \n\nRun``OmegaT``and setup ``omegat-plugin-fake-mt``\n```bash\nOmegaT/Preferences/Machine Translation/Fake MT/Configure\n\tName: Fake Deepl MT\n\tURL: http://localhost:8000/text\n\tSource Parameter: from_lang\n\tTarget Parameter: to_lang\n\tText Parameter: q\n```\n![](img/plugin-setup.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffreemt%2Fdeepl-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fffreemt%2Fdeepl-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffreemt%2Fdeepl-fastapi/lists"}