fastlib-py 0.2.8__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/LICENSE +21 -21
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/PKG-INFO +1 -1
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/__init__.py +0 -2
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/cache/manager.py +3 -3
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/config/loader.py +1 -1
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/config/manager.py +4 -4
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/i18n/messages.py +1 -1
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/middleware/jwt.py +2 -1
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib_py.egg-info/PKG-INFO +1 -1
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib_py.egg-info/SOURCES.txt +7 -9
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/pyproject.toml +127 -127
- fastlib_py-0.2.8/fastlib/constant/__init__.py +0 -20
- fastlib_py-0.2.8/fastlib/session/__init__.py +0 -6
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/README.md +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/cache/__init__.py +0 -0
- /fastlib_py-0.2.8/fastlib/cache/disk_cache.py → /fastlib_py-0.3.1/fastlib/cache/_disk_cache.py +0 -0
- /fastlib_py-0.2.8/fastlib/cache/redis_cache.py → /fastlib_py-0.3.1/fastlib/cache/_redis_cache.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/cache/base.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/config/__init__.py +0 -0
- /fastlib_py-0.2.8/fastlib/config/database_config.py → /fastlib_py-0.3.1/fastlib/config/_database_config.py +0 -0
- /fastlib_py-0.2.8/fastlib/config/security_config.py → /fastlib_py-0.3.1/fastlib/config/_security_config.py +0 -0
- /fastlib_py-0.2.8/fastlib/config/server_config.py → /fastlib_py-0.3.1/fastlib/config/_server_config.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/config/base.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/config/registry.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/config/utils.py +0 -0
- /fastlib_py-0.2.8/fastlib/constant/constant.py → /fastlib_py-0.3.1/fastlib/constants.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/contextvars.py +0 -0
- {fastlib_py-0.2.8/fastlib/session → fastlib_py-0.3.1/fastlib}/db_engine.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/enums.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/exception/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/exception/base.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/exception/exception_handler.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/exception/exception_manager.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/i18n/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/i18n/manager.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/i18n/types.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/i18n/utils.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/logging/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/logging/config.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/logging/handlers.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/mapper/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/mapper/base_mapper.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/mapper/impl/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/mapper/impl/base_mapper_impl.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/middleware/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/middleware/db_session.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/middleware/i18n.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/migrate.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/openapi.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/py.typed +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/request.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/response.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/router.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/schema.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/security/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/security/security.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/security/utils.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/service/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/service/base_service.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/service/impl/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/service/impl/base_service_impl.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/stream/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/stream/enums.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/stream/event.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/stream/handler.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/stream/schema.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/stream/sse.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/utils/__init__.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/utils/excel_util.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/utils/file_util.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/utils/http_util.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/utils/ip_util.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/utils/snowflake_util.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib/utils/str_util.py +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib_py.egg-info/dependency_links.txt +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib_py.egg-info/requires.txt +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/fastlib_py.egg-info/top_level.txt +0 -0
- {fastlib_py-0.2.8 → fastlib_py-0.3.1}/setup.cfg +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 tyvekzhang
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 tyvekzhang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"""Fastlib Application Libraries Package."""
|
|
3
3
|
|
|
4
4
|
from .config import ConfigManager as ConfigManager
|
|
5
|
-
from .constant import constant as constant
|
|
6
5
|
from .logging import LogConfig as LogConfig
|
|
7
6
|
from .logging import Logger as Logger
|
|
8
7
|
from .openapi import register_offline_openapi as register_offline_openapi
|
|
@@ -11,6 +10,5 @@ __all__ = [
|
|
|
11
10
|
"ConfigManager",
|
|
12
11
|
"Logger",
|
|
13
12
|
"LogConfig",
|
|
14
|
-
"constant",
|
|
15
13
|
"register_offline_openapi",
|
|
16
14
|
]
|
|
@@ -11,15 +11,15 @@ async def get_cache_client() -> Cache:
|
|
|
11
11
|
Returns:
|
|
12
12
|
Cache: Redis client if Redis is enabled in config, otherwise returns page cache.
|
|
13
13
|
"""
|
|
14
|
-
from fastlib.cache.
|
|
14
|
+
from fastlib.cache._redis_cache import RedisManager
|
|
15
15
|
|
|
16
16
|
config = ConfigManager.get_database_config()
|
|
17
17
|
if config.enable_redis:
|
|
18
|
-
from fastlib.cache.
|
|
18
|
+
from fastlib.cache._redis_cache import RedisCache
|
|
19
19
|
|
|
20
20
|
redis_client = await RedisManager.get_instance()
|
|
21
21
|
return RedisCache(redis_client)
|
|
22
22
|
else:
|
|
23
|
-
from fastlib.cache.
|
|
23
|
+
from fastlib.cache._disk_cache import PageCache
|
|
24
24
|
|
|
25
25
|
return PageCache()
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
import os
|
|
5
5
|
from typing import Any, Optional
|
|
6
6
|
|
|
7
|
-
from fastlib import constant
|
|
7
|
+
from fastlib import constants as constant
|
|
8
8
|
from fastlib.config import utils as config_util
|
|
9
|
+
from fastlib.config._database_config import DatabaseConfig
|
|
10
|
+
from fastlib.config._security_config import SecurityConfig
|
|
11
|
+
from fastlib.config._server_config import ServerConfig
|
|
9
12
|
from fastlib.config.base import BaseConfig
|
|
10
|
-
from fastlib.config.database_config import DatabaseConfig
|
|
11
13
|
from fastlib.config.loader import ConfigLoader
|
|
12
14
|
from fastlib.config.registry import ConfigRegistry
|
|
13
|
-
from fastlib.config.security_config import SecurityConfig
|
|
14
|
-
from fastlib.config.server_config import ServerConfig
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
# Decorator for easy registration
|
|
@@ -9,7 +9,8 @@ from jwt.exceptions import PyJWTError
|
|
|
9
9
|
from loguru import logger
|
|
10
10
|
from starlette.responses import JSONResponse
|
|
11
11
|
|
|
12
|
-
from fastlib import ConfigManager,
|
|
12
|
+
from fastlib import ConfigManager, security
|
|
13
|
+
from fastlib import constants as constant
|
|
13
14
|
from fastlib.contextvars import clear_current_user, set_current_user
|
|
14
15
|
from fastlib.enums import MediaTypeEnum
|
|
15
16
|
from fastlib.schema import UserCredential
|
|
@@ -2,7 +2,9 @@ LICENSE
|
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
4
|
fastlib/__init__.py
|
|
5
|
+
fastlib/constants.py
|
|
5
6
|
fastlib/contextvars.py
|
|
7
|
+
fastlib/db_engine.py
|
|
6
8
|
fastlib/enums.py
|
|
7
9
|
fastlib/migrate.py
|
|
8
10
|
fastlib/openapi.py
|
|
@@ -12,21 +14,19 @@ fastlib/response.py
|
|
|
12
14
|
fastlib/router.py
|
|
13
15
|
fastlib/schema.py
|
|
14
16
|
fastlib/cache/__init__.py
|
|
17
|
+
fastlib/cache/_disk_cache.py
|
|
18
|
+
fastlib/cache/_redis_cache.py
|
|
15
19
|
fastlib/cache/base.py
|
|
16
|
-
fastlib/cache/disk_cache.py
|
|
17
20
|
fastlib/cache/manager.py
|
|
18
|
-
fastlib/cache/redis_cache.py
|
|
19
21
|
fastlib/config/__init__.py
|
|
22
|
+
fastlib/config/_database_config.py
|
|
23
|
+
fastlib/config/_security_config.py
|
|
24
|
+
fastlib/config/_server_config.py
|
|
20
25
|
fastlib/config/base.py
|
|
21
|
-
fastlib/config/database_config.py
|
|
22
26
|
fastlib/config/loader.py
|
|
23
27
|
fastlib/config/manager.py
|
|
24
28
|
fastlib/config/registry.py
|
|
25
|
-
fastlib/config/security_config.py
|
|
26
|
-
fastlib/config/server_config.py
|
|
27
29
|
fastlib/config/utils.py
|
|
28
|
-
fastlib/constant/__init__.py
|
|
29
|
-
fastlib/constant/constant.py
|
|
30
30
|
fastlib/exception/__init__.py
|
|
31
31
|
fastlib/exception/base.py
|
|
32
32
|
fastlib/exception/exception_handler.py
|
|
@@ -54,8 +54,6 @@ fastlib/service/__init__.py
|
|
|
54
54
|
fastlib/service/base_service.py
|
|
55
55
|
fastlib/service/impl/__init__.py
|
|
56
56
|
fastlib/service/impl/base_service_impl.py
|
|
57
|
-
fastlib/session/__init__.py
|
|
58
|
-
fastlib/session/db_engine.py
|
|
59
57
|
fastlib/stream/__init__.py
|
|
60
58
|
fastlib/stream/enums.py
|
|
61
59
|
fastlib/stream/event.py
|
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "fastlib-py"
|
|
3
|
-
version = "0.
|
|
4
|
-
description = "Fastlib, high performance, easy to use, fast to code, ready for production"
|
|
5
|
-
readme = "README.md"
|
|
6
|
-
keywords = [
|
|
7
|
-
"fastapi",
|
|
8
|
-
"library",
|
|
9
|
-
"sqlmodel",
|
|
10
|
-
"web",
|
|
11
|
-
]
|
|
12
|
-
license = "MIT"
|
|
13
|
-
maintainers = [
|
|
14
|
-
{ name = "tyvekZhang", email = "tyvekzhang@gmail.com" },
|
|
15
|
-
]
|
|
16
|
-
authors = [
|
|
17
|
-
{ name = "tyvekZhang", email = "tyvekzhang@gmail.com" },
|
|
18
|
-
]
|
|
19
|
-
requires-python = ">=3.9"
|
|
20
|
-
classifiers = [
|
|
21
|
-
"Development Status :: 4 - Beta",
|
|
22
|
-
"Programming Language :: Python",
|
|
23
|
-
"Programming Language :: Python :: 3 :: Only",
|
|
24
|
-
"Programming Language :: Python :: 3.9",
|
|
25
|
-
"Programming Language :: Python :: 3.10",
|
|
26
|
-
"Programming Language :: Python :: 3.11",
|
|
27
|
-
"Programming Language :: Python :: 3.12",
|
|
28
|
-
"Programming Language :: Python :: 3.13",
|
|
29
|
-
"Programming Language :: Python :: Implementation :: CPython",
|
|
30
|
-
"Programming Language :: Python :: Implementation :: PyPy",
|
|
31
|
-
]
|
|
32
|
-
dependencies = [
|
|
33
|
-
"aiosqlite>=0.21",
|
|
34
|
-
"alembic>=1.15.2",
|
|
35
|
-
"asgi-correlation-id>=4.3.4",
|
|
36
|
-
"cryptography>=45.0.6",
|
|
37
|
-
"diskcache>=5.6.3",
|
|
38
|
-
"fastapi[standard]>=0.115.12",
|
|
39
|
-
"loguru>=0.7.3",
|
|
40
|
-
"openpyxl>=3.1.5",
|
|
41
|
-
"pandas>=2.2.3",
|
|
42
|
-
"passlib[bcrypt]>=1.7.4",
|
|
43
|
-
"pyjwt>=2.10.1",
|
|
44
|
-
"sqlmodel>=0.0.24",
|
|
45
|
-
]
|
|
46
|
-
|
|
47
|
-
urls.Homepage = "https://github.com/tyvekzhang/fastlib"
|
|
48
|
-
|
|
49
|
-
[dependency-groups]
|
|
50
|
-
dev = [
|
|
51
|
-
"coverage>=7.8",
|
|
52
|
-
"httpx>=0.28.1",
|
|
53
|
-
"pre-commit>=4.2",
|
|
54
|
-
"pytest>=8.3.5",
|
|
55
|
-
"pytest-asyncio>=1.1",
|
|
56
|
-
]
|
|
57
|
-
|
|
58
|
-
docs = [
|
|
59
|
-
"sphinx>=7.2.6",
|
|
60
|
-
"sphinx-rtd-theme>=2",
|
|
61
|
-
]
|
|
62
|
-
|
|
63
|
-
[tool.ruff]
|
|
64
|
-
line-length = 88
|
|
65
|
-
|
|
66
|
-
include = [ "fastlib/**/*.py", "main.py" ]
|
|
67
|
-
exclude = [ "doc/**/*.py" ]
|
|
68
|
-
|
|
69
|
-
lint.select = [
|
|
70
|
-
"B", # flake8-bugbear
|
|
71
|
-
"C4", # flake8-comprehensions
|
|
72
|
-
"E", # pycodestyle errors
|
|
73
|
-
"F", # pyflakes
|
|
74
|
-
"I", # isort
|
|
75
|
-
"UP", # pyupgrade
|
|
76
|
-
"W", # pycodestyle warnings
|
|
77
|
-
]
|
|
78
|
-
lint.ignore = [
|
|
79
|
-
"B008", # do not perform function calls in argument defaults
|
|
80
|
-
"C901", # too complex
|
|
81
|
-
"E501", # line too long, handled by black
|
|
82
|
-
"W191", # indentation contains tabs
|
|
83
|
-
]
|
|
84
|
-
lint.isort.known-third-party = [
|
|
85
|
-
"aiosqlite",
|
|
86
|
-
"alembic",
|
|
87
|
-
"diskcache",
|
|
88
|
-
"fastapi",
|
|
89
|
-
"loguru",
|
|
90
|
-
"openpyxl",
|
|
91
|
-
"pandas",
|
|
92
|
-
"passlib",
|
|
93
|
-
"pyjwt",
|
|
94
|
-
"sqlmodel",
|
|
95
|
-
"starlette",
|
|
96
|
-
"pydantic",
|
|
97
|
-
"bcrypt",
|
|
98
|
-
"cryptography",
|
|
99
|
-
]
|
|
100
|
-
# Preserve types, even if a file imports `from __future__ import annotations`.
|
|
101
|
-
lint.pyupgrade.keep-runtime-typing = true
|
|
102
|
-
|
|
103
|
-
[tool.coverage.run]
|
|
104
|
-
data_file = "coverage/.coverage"
|
|
105
|
-
source = [ "fastlib" ]
|
|
106
|
-
context = '${CONTEXT}'
|
|
107
|
-
dynamic_context = "test_function"
|
|
108
|
-
omit = [
|
|
109
|
-
]
|
|
110
|
-
|
|
111
|
-
[tool.coverage.report]
|
|
112
|
-
fail_under = 90
|
|
113
|
-
show_missing = true
|
|
114
|
-
sort = "-Cover"
|
|
115
|
-
|
|
116
|
-
[tool.coverage.html]
|
|
117
|
-
show_contexts = true
|
|
118
|
-
directory = "coverage/html"
|
|
119
|
-
title = "FastLib Coverage Report"
|
|
120
|
-
|
|
121
|
-
[tool.mypy]
|
|
122
|
-
strict = true
|
|
123
|
-
|
|
124
|
-
[[tool.uv.index]]
|
|
125
|
-
name = "tsinghua"
|
|
126
|
-
url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
|
|
127
|
-
default = true
|
|
1
|
+
[project]
|
|
2
|
+
name = "fastlib-py"
|
|
3
|
+
version = "0.3.1"
|
|
4
|
+
description = "Fastlib, high performance, easy to use, fast to code, ready for production"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
keywords = [
|
|
7
|
+
"fastapi",
|
|
8
|
+
"library",
|
|
9
|
+
"sqlmodel",
|
|
10
|
+
"web",
|
|
11
|
+
]
|
|
12
|
+
license = "MIT"
|
|
13
|
+
maintainers = [
|
|
14
|
+
{ name = "tyvekZhang", email = "tyvekzhang@gmail.com" },
|
|
15
|
+
]
|
|
16
|
+
authors = [
|
|
17
|
+
{ name = "tyvekZhang", email = "tyvekzhang@gmail.com" },
|
|
18
|
+
]
|
|
19
|
+
requires-python = ">=3.9"
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 4 - Beta",
|
|
22
|
+
"Programming Language :: Python",
|
|
23
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
24
|
+
"Programming Language :: Python :: 3.9",
|
|
25
|
+
"Programming Language :: Python :: 3.10",
|
|
26
|
+
"Programming Language :: Python :: 3.11",
|
|
27
|
+
"Programming Language :: Python :: 3.12",
|
|
28
|
+
"Programming Language :: Python :: 3.13",
|
|
29
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
30
|
+
"Programming Language :: Python :: Implementation :: PyPy",
|
|
31
|
+
]
|
|
32
|
+
dependencies = [
|
|
33
|
+
"aiosqlite>=0.21",
|
|
34
|
+
"alembic>=1.15.2",
|
|
35
|
+
"asgi-correlation-id>=4.3.4",
|
|
36
|
+
"cryptography>=45.0.6",
|
|
37
|
+
"diskcache>=5.6.3",
|
|
38
|
+
"fastapi[standard]>=0.115.12",
|
|
39
|
+
"loguru>=0.7.3",
|
|
40
|
+
"openpyxl>=3.1.5",
|
|
41
|
+
"pandas>=2.2.3",
|
|
42
|
+
"passlib[bcrypt]>=1.7.4",
|
|
43
|
+
"pyjwt>=2.10.1",
|
|
44
|
+
"sqlmodel>=0.0.24",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
urls.Homepage = "https://github.com/tyvekzhang/fastlib"
|
|
48
|
+
|
|
49
|
+
[dependency-groups]
|
|
50
|
+
dev = [
|
|
51
|
+
"coverage>=7.8",
|
|
52
|
+
"httpx>=0.28.1",
|
|
53
|
+
"pre-commit>=4.2",
|
|
54
|
+
"pytest>=8.3.5",
|
|
55
|
+
"pytest-asyncio>=1.1",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
docs = [
|
|
59
|
+
"sphinx>=7.2.6",
|
|
60
|
+
"sphinx-rtd-theme>=2",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
[tool.ruff]
|
|
64
|
+
line-length = 88
|
|
65
|
+
|
|
66
|
+
include = [ "fastlib/**/*.py", "main.py" ]
|
|
67
|
+
exclude = [ "doc/**/*.py" ]
|
|
68
|
+
|
|
69
|
+
lint.select = [
|
|
70
|
+
"B", # flake8-bugbear
|
|
71
|
+
"C4", # flake8-comprehensions
|
|
72
|
+
"E", # pycodestyle errors
|
|
73
|
+
"F", # pyflakes
|
|
74
|
+
"I", # isort
|
|
75
|
+
"UP", # pyupgrade
|
|
76
|
+
"W", # pycodestyle warnings
|
|
77
|
+
]
|
|
78
|
+
lint.ignore = [
|
|
79
|
+
"B008", # do not perform function calls in argument defaults
|
|
80
|
+
"C901", # too complex
|
|
81
|
+
"E501", # line too long, handled by black
|
|
82
|
+
"W191", # indentation contains tabs
|
|
83
|
+
]
|
|
84
|
+
lint.isort.known-third-party = [
|
|
85
|
+
"aiosqlite",
|
|
86
|
+
"alembic",
|
|
87
|
+
"diskcache",
|
|
88
|
+
"fastapi",
|
|
89
|
+
"loguru",
|
|
90
|
+
"openpyxl",
|
|
91
|
+
"pandas",
|
|
92
|
+
"passlib",
|
|
93
|
+
"pyjwt",
|
|
94
|
+
"sqlmodel",
|
|
95
|
+
"starlette",
|
|
96
|
+
"pydantic",
|
|
97
|
+
"bcrypt",
|
|
98
|
+
"cryptography",
|
|
99
|
+
]
|
|
100
|
+
# Preserve types, even if a file imports `from __future__ import annotations`.
|
|
101
|
+
lint.pyupgrade.keep-runtime-typing = true
|
|
102
|
+
|
|
103
|
+
[tool.coverage.run]
|
|
104
|
+
data_file = "coverage/.coverage"
|
|
105
|
+
source = [ "fastlib" ]
|
|
106
|
+
context = '${CONTEXT}'
|
|
107
|
+
dynamic_context = "test_function"
|
|
108
|
+
omit = [
|
|
109
|
+
]
|
|
110
|
+
|
|
111
|
+
[tool.coverage.report]
|
|
112
|
+
fail_under = 90
|
|
113
|
+
show_missing = true
|
|
114
|
+
sort = "-Cover"
|
|
115
|
+
|
|
116
|
+
[tool.coverage.html]
|
|
117
|
+
show_contexts = true
|
|
118
|
+
directory = "coverage/html"
|
|
119
|
+
title = "FastLib Coverage Report"
|
|
120
|
+
|
|
121
|
+
[tool.mypy]
|
|
122
|
+
strict = true
|
|
123
|
+
|
|
124
|
+
[[tool.uv.index]]
|
|
125
|
+
name = "tsinghua"
|
|
126
|
+
url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
|
|
127
|
+
default = true
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# SPDX-License-Identifier: MIT
|
|
2
|
-
"""Constant for the application"""
|
|
3
|
-
|
|
4
|
-
from .constant import (
|
|
5
|
-
AUTHORIZATION,
|
|
6
|
-
CONFIG_FILE,
|
|
7
|
-
CONFIG_FILE_NAME,
|
|
8
|
-
ENV,
|
|
9
|
-
RESOURCE_DIR,
|
|
10
|
-
FilterOperators,
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
__all__ = [
|
|
14
|
-
"RESOURCE_DIR",
|
|
15
|
-
"ENV",
|
|
16
|
-
"CONFIG_FILE",
|
|
17
|
-
"AUTHORIZATION",
|
|
18
|
-
"CONFIG_FILE_NAME",
|
|
19
|
-
FilterOperators,
|
|
20
|
-
]
|
|
File without changes
|
|
File without changes
|
/fastlib_py-0.2.8/fastlib/cache/disk_cache.py → /fastlib_py-0.3.1/fastlib/cache/_disk_cache.py
RENAMED
|
File without changes
|
/fastlib_py-0.2.8/fastlib/cache/redis_cache.py → /fastlib_py-0.3.1/fastlib/cache/_redis_cache.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|