# README
## 1. Quick start
Install the package:
```shell
pip install fastapi-i18n
```
Usage in your project:
```python
import i18n
from fastapi import FastAPI, Depends
app = FastAPI()
@app.on_event("startup")
async def startup():
await i18n.init()
@app.get('/')
async def root(translator: i18n.Translator = Depends(i18n.Translator)):
return {"message": translator.t('hello.world')}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/TrickerPan/fastapi-i18n",
"name": "fastapi-i18n",
"maintainer": "tricker.pan",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "tricker.pan@gmail.com",
"keywords": "fastapi,i18n",
"author": "tricker.pan",
"author_email": "tricker.pan@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c2/80/972223583f8c50d7e994c49945a8a209d7a1885d89466fce6a6dd9a87007/fastapi_i18n-0.1.3.tar.gz",
"platform": null,
"description": "# README\n\n## 1. Quick start\n\nInstall the package:\n\n```shell\npip install fastapi-i18n\n```\n\nUsage in your project:\n\n```python\nimport i18n\nfrom fastapi import FastAPI, Depends\n\napp = FastAPI()\n\n\n@app.on_event(\"startup\")\nasync def startup():\n await i18n.init()\n\n@app.get('/')\nasync def root(translator: i18n.Translator = Depends(i18n.Translator)):\n return {\"message\": translator.t('hello.world')}\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Fastapi i18n",
"version": "0.1.3",
"split_keywords": [
"fastapi",
"i18n"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "35471e4b13940a09392b8e5f9e1eb258b8719eca50b4035546664ffb62c8d579",
"md5": "6df21580361354e0b9b861e17d4ef8c3",
"sha256": "1239876eb4272909d74ab37c3327061f0b08a19addd362b487c763077f1a0d82"
},
"downloads": -1,
"filename": "fastapi_i18n-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6df21580361354e0b9b861e17d4ef8c3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 3752,
"upload_time": "2023-01-08T11:22:59",
"upload_time_iso_8601": "2023-01-08T11:22:59.086353Z",
"url": "https://files.pythonhosted.org/packages/35/47/1e4b13940a09392b8e5f9e1eb258b8719eca50b4035546664ffb62c8d579/fastapi_i18n-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c280972223583f8c50d7e994c49945a8a209d7a1885d89466fce6a6dd9a87007",
"md5": "3d3fc72e4505be2e12475486b507dda1",
"sha256": "73b3ffb4e74a870184dd1450136f4b16f9373f24afa2a2311f36421e71ee18c2"
},
"downloads": -1,
"filename": "fastapi_i18n-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "3d3fc72e4505be2e12475486b507dda1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 3417,
"upload_time": "2023-01-08T11:23:01",
"upload_time_iso_8601": "2023-01-08T11:23:01.071742Z",
"url": "https://files.pythonhosted.org/packages/c2/80/972223583f8c50d7e994c49945a8a209d7a1885d89466fce6a6dd9a87007/fastapi_i18n-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-08 11:23:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "TrickerPan",
"github_project": "fastapi-i18n",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fastapi-i18n"
}