# Fastapi Helpers
This pip packages will help you to make your life easier when working with fastapi and ormar.
For installing this package:
```bash
pip install fastapi-helpers
```
If you need a default settings for your app, it includes an implementation BaseSettings of pydantic.
```python
from fastapi_helpers import DefaultSettings
from utils import env_path
from typing import Optional
class Settings(DefaultSettings):
app_name = "your-app-name"
redis_url: Optional[str] = 'redis://localhost:6379'
version: Optional[str] = '1.0.0.0'
port: Optional[str] = "8000"
env: Optional[str] = "dev" #dev, test, prod
settings = Settings(env_path)
```
If you need a logger, it includes an implementation a colored console, and in prod envs it will log to aws with the help of watchtower.
```python
from fastapi_helpers import DefaultLogger
from .config import settings
logger = DefaultLogger("your-app-name", settings)
```
If you need to connect to a db superfast, the only thing you need to do is to:
```python
from fastapi_helpers import DbConfig
from core.config import settings
from core.logger import logger
db_config = DbConfig(settings, logger)
```
There are other tools for making the usage of ormar and fastapi even easier.
I would really like to make this tools bigger, but I´m looking for help for documenting this package.
Happy codding!
Raw data
{
"_id": null,
"home_page": "https://github.com/finalsa/fastapi-utils",
"name": "fastapi-helpers",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "fastapi,sqlalchemy,ormar,pydantic",
"author": "Luis Jimenez",
"author_email": "luis@finalsa.com",
"download_url": "https://files.pythonhosted.org/packages/d1/b4/2879ac725288f8b1d68abf9b15a7876aabdf8429d7e134b0f034cf4dfc3e/fastapi_helpers-0.3.0.tar.gz",
"platform": null,
"description": "# Fastapi Helpers\n\nThis pip packages will help you to make your life easier when working with fastapi and ormar.\n\nFor installing this package:\n\n```bash\npip install fastapi-helpers\n```\n\nIf you need a default settings for your app, it includes an implementation BaseSettings of pydantic.\n\n```python\nfrom fastapi_helpers import DefaultSettings\nfrom utils import env_path\nfrom typing import Optional\n\nclass Settings(DefaultSettings):\n app_name = \"your-app-name\"\n redis_url: Optional[str] = 'redis://localhost:6379'\n version: Optional[str] = '1.0.0.0'\n port: Optional[str] = \"8000\"\n env: Optional[str] = \"dev\" #dev, test, prod\n\n\nsettings = Settings(env_path)\n```\n\nIf you need a logger, it includes an implementation a colored console, and in prod envs it will log to aws with the help of watchtower.\n\n```python\nfrom fastapi_helpers import DefaultLogger\nfrom .config import settings\n\nlogger = DefaultLogger(\"your-app-name\", settings)\n```\n\nIf you need to connect to a db superfast, the only thing you need to do is to:\n\n```python\nfrom fastapi_helpers import DbConfig\nfrom core.config import settings\nfrom core.logger import logger\n\ndb_config = DbConfig(settings, logger)\n```\n\nThere are other tools for making the usage of ormar and fastapi even easier.\n\n\nI would really like to make this tools bigger, but I\u00b4m looking for help for documenting this package.\n\n\nHappy codding!\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An utils package for fastapi",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/finalsa/fastapi-utils"
},
"split_keywords": [
"fastapi",
"sqlalchemy",
"ormar",
"pydantic"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a748d03f142d5d2fb0e98d123fec8cd3c2f227051d3639b13a7c3408f21a5bdf",
"md5": "e3acef7a67cf96faa8abb3cf05265d44",
"sha256": "6507511773c9d26db25cb7cc6caae6b566a0d1101e7cf0b2285b0bd50455f059"
},
"downloads": -1,
"filename": "fastapi_helpers-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e3acef7a67cf96faa8abb3cf05265d44",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 19095,
"upload_time": "2023-12-12T05:36:53",
"upload_time_iso_8601": "2023-12-12T05:36:53.111468Z",
"url": "https://files.pythonhosted.org/packages/a7/48/d03f142d5d2fb0e98d123fec8cd3c2f227051d3639b13a7c3408f21a5bdf/fastapi_helpers-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d1b42879ac725288f8b1d68abf9b15a7876aabdf8429d7e134b0f034cf4dfc3e",
"md5": "12540347edbc32e9e4b01b19cbcfa730",
"sha256": "d1e458795d4d21cb8f32205a0c8dd48fafae2c551606eed9e666aac99a44bd73"
},
"downloads": -1,
"filename": "fastapi_helpers-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "12540347edbc32e9e4b01b19cbcfa730",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 12942,
"upload_time": "2023-12-12T05:36:55",
"upload_time_iso_8601": "2023-12-12T05:36:55.007459Z",
"url": "https://files.pythonhosted.org/packages/d1/b4/2879ac725288f8b1d68abf9b15a7876aabdf8429d7e134b0f034cf4dfc3e/fastapi_helpers-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-12 05:36:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "finalsa",
"github_project": "fastapi-utils",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "fastapi-helpers"
}