python-flashapi 0.1.2__py3-none-any.whl → 0.3.0__py3-none-any.whl

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.
Files changed (49) hide show
  1. flashapi/__init__.py +8 -7
  2. flashapi/adapters/base.py +13 -12
  3. flashapi/adapters/django.py +808 -165
  4. flashapi/adapters/fastapi.py +911 -293
  5. flashapi/adapters/flask.py +762 -232
  6. flashapi/core/__init__.py +11 -3
  7. flashapi/core/custom_routes.py +5 -5
  8. flashapi/core/pluralize.py +80 -80
  9. flashapi/core/relations.py +59 -61
  10. flashapi/core/response.py +36 -33
  11. flashapi/core/schema.py +145 -83
  12. flashapi/core/visibility.py +46 -0
  13. flashapi/django.py +5 -5
  14. flashapi/docs/openapi.py +298 -223
  15. flashapi/fastapi.py +5 -5
  16. flashapi/features/__init__.py +6 -6
  17. flashapi/features/audit.py +84 -0
  18. flashapi/features/auth.py +134 -0
  19. flashapi/features/dashboard.py +412 -0
  20. flashapi/features/export.py +143 -0
  21. flashapi/features/filtering.py +124 -33
  22. flashapi/features/health.py +69 -0
  23. flashapi/features/pagination.py +20 -20
  24. flashapi/features/rate_limit.py +45 -0
  25. flashapi/features/search.py +25 -25
  26. flashapi/features/sorting.py +23 -21
  27. flashapi/features/webhooks.py +84 -0
  28. flashapi/features/websocket.py +129 -0
  29. flashapi/flask.py +5 -5
  30. flashapi/inspectors/__init__.py +3 -3
  31. flashapi/inspectors/base.py +13 -11
  32. flashapi/inspectors/dataclass.py +50 -39
  33. flashapi/inspectors/detect.py +54 -48
  34. flashapi/inspectors/django.py +93 -83
  35. flashapi/inspectors/pydantic.py +99 -84
  36. flashapi/inspectors/sqlalchemy.py +83 -75
  37. flashapi/storage/__init__.py +4 -4
  38. flashapi/storage/auto.py +189 -106
  39. flashapi/storage/base.py +32 -26
  40. flashapi/storage/orm.py +125 -85
  41. flashapi/storage/sqlalchemy.py +56 -13
  42. python_flashapi-0.3.0.dist-info/METADATA +319 -0
  43. python_flashapi-0.3.0.dist-info/RECORD +49 -0
  44. {python_flashapi-0.1.2.dist-info → python_flashapi-0.3.0.dist-info}/WHEEL +1 -1
  45. python_flashapi-0.3.0.dist-info/licenses/LICENSE +190 -0
  46. python_flashapi-0.3.0.dist-info/licenses/NOTICE +5 -0
  47. python_flashapi-0.1.2.dist-info/METADATA +0 -259
  48. python_flashapi-0.1.2.dist-info/RECORD +0 -39
  49. python_flashapi-0.1.2.dist-info/licenses/LICENSE +0 -21
flashapi/__init__.py CHANGED
@@ -1,7 +1,8 @@
1
- """FlashAPI — Define your models. FlashAPI does the rest."""
2
-
3
- from flashapi.core.schema import Model
4
- from flashapi.core.custom_routes import CustomRoute, RouteParam, RouteBody, api_doc
5
-
6
- __version__ = "0.1.0"
7
- __all__ = ["Model", "CustomRoute", "RouteParam", "RouteBody", "api_doc"]
1
+ """FlashAPI — Define your models. FlashAPI does the rest."""
2
+
3
+ from flashapi.core.custom_routes import CustomRoute, RouteBody, RouteParam, api_doc
4
+ from flashapi.core.schema import Model
5
+ from flashapi.features.auth import AuthBackend
6
+
7
+ __version__ = "0.1.0"
8
+ __all__ = ["AuthBackend", "CustomRoute", "Model", "RouteBody", "RouteParam", "api_doc"]
flashapi/adapters/base.py CHANGED
@@ -1,12 +1,13 @@
1
- from __future__ import annotations
2
-
3
- from abc import ABC, abstractmethod
4
- from typing import Any
5
-
6
- from flashapi.core.schema import ModelSchema
7
-
8
-
9
- class Adapter(ABC):
10
- @abstractmethod
11
- def register_model(self, schema: ModelSchema, permissions: list[str], storage: Any) -> None:
12
- ...
1
+ from __future__ import annotations
2
+
3
+ from abc import ABC, abstractmethod
4
+ from typing import TYPE_CHECKING, Any
5
+
6
+ if TYPE_CHECKING:
7
+ from flashapi.core.schema import ModelSchema
8
+
9
+
10
+ class Adapter(ABC):
11
+ @abstractmethod
12
+ def register_model(self, schema: ModelSchema, permissions: list[str], storage: Any) -> None:
13
+ ...