tools2fast-fastapi 0.1.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.
@@ -0,0 +1,11 @@
1
+ from .models.mixins import AuditMixin, IdMixin, TimestampMixin
2
+ from . import schemas
3
+ from .__version__ import __version__
4
+
5
+ __all__ = [
6
+ "IdMixin",
7
+ "TimestampMixin",
8
+ "AuditMixin",
9
+ "schemas",
10
+ "__version__",
11
+ ]
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,7 @@
1
+ from .mixins import IdMixin, TimestampMixin, AuditMixin
2
+
3
+ __all__ = [
4
+ "IdMixin",
5
+ "TimestampMixin",
6
+ "AuditMixin",
7
+ ]
@@ -0,0 +1,42 @@
1
+ from datetime import datetime, timezone
2
+
3
+ from sqlalchemy import DateTime, func
4
+ from sqlmodel import BigInteger, Field
5
+
6
+
7
+ class IdMixin:
8
+ """Mixin para proveer clave primaria autoincremental tipo BigInteger."""
9
+
10
+ id: int | None = Field(default=None, primary_key=True, index=True, sa_type=BigInteger)
11
+
12
+
13
+ class TimestampMixin:
14
+ """Mixin reutilizable para marcas de tiempo en UTC."""
15
+
16
+ created_at: datetime = Field(
17
+ default_factory=lambda: datetime.now(timezone.utc),
18
+ nullable=False,
19
+ sa_type=DateTime(timezone=True),
20
+ )
21
+ updated_at: datetime = Field(
22
+ default_factory=lambda: datetime.now(timezone.utc),
23
+ nullable=False,
24
+ sa_type=DateTime(timezone=True),
25
+ sa_column_kwargs={"onupdate": func.now()},
26
+ )
27
+
28
+
29
+ class AuditMixin:
30
+ """Mixin para rastrear el usuario que crea y actualiza un registro."""
31
+
32
+ created_by: int | None = Field(
33
+ default=None,
34
+ description="ID of the user who created this record.",
35
+ sa_type=BigInteger,
36
+ )
37
+ updated_by: int | None = Field(
38
+ default=None,
39
+ description="ID of the user who last updated this record.",
40
+ sa_type=BigInteger,
41
+ )
42
+
@@ -0,0 +1,7 @@
1
+ from .mixins import AuditMixin, IdMixin, TimestampMixin
2
+
3
+ __all__ = [
4
+ "IdMixin",
5
+ "TimestampMixin",
6
+ "AuditMixin",
7
+ ]
@@ -0,0 +1,23 @@
1
+ from datetime import datetime
2
+
3
+ from sqlmodel import SQLModel
4
+
5
+
6
+ class IdMixin(SQLModel):
7
+ """Schema mixin for resources that have an integer ID."""
8
+
9
+ id: int
10
+
11
+
12
+ class TimestampMixin(SQLModel):
13
+ """Schema mixin for resources that include created and updated timestamps."""
14
+
15
+ created_at: datetime
16
+ updated_at: datetime
17
+
18
+
19
+ class AuditMixin(SQLModel):
20
+ """Schema mixin for resources that include audit user IDs."""
21
+
22
+ created_by: int | None = None
23
+ updated_by: int | None = None
@@ -0,0 +1,84 @@
1
+ Metadata-Version: 2.4
2
+ Name: tools2fast-fastapi
3
+ Version: 0.1.0
4
+ Summary: Shared tools, mixins, and base services for FastAPI applications - Solautyc Team internal use
5
+ Author-email: Angel Daniel Sanchez Castillo <angeldaniel.sanchezcastillo@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Angel Daniel Sanchez Castillo
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/AngelDanielSanchezCastillo/tools2fast-fastapi
29
+ Project-URL: Documentation, https://github.com/AngelDanielSanchezCastillo/tools2fast-fastapi/tree/main/docs
30
+ Project-URL: Repository, https://github.com/AngelDanielSanchezCastillo/tools2fast-fastapi
31
+ Project-URL: Issues, https://github.com/AngelDanielSanchezCastillo/tools2fast-fastapi/issues
32
+ Keywords: fastapi,tools,mixins,services,sqlmodel
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.10
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Framework :: FastAPI
41
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
42
+ Requires-Python: >=3.10
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Requires-Dist: fastapi>=0.100.0
46
+ Requires-Dist: sqlmodel>=0.0.16
47
+ Dynamic: license-file
48
+
49
+ # Tools2Fast FastAPI
50
+
51
+ Shared tools, mixins, and base services for FastAPI applications. Designed for internal use by the Solautyc Team to standardize model definitions and common services across multiple packages.
52
+
53
+ ## Installation
54
+
55
+ You can install this package from PyPI (if published) or use it locally within your workspace:
56
+
57
+ ```bash
58
+ pip install tools2fast-fastapi
59
+ ```
60
+
61
+ Locally with UV:
62
+ ```bash
63
+ uv pip install -e path/to/tools2fast-fastapi
64
+ ```
65
+
66
+ ## Features
67
+
68
+ - **SQLModel Mixins**: Standardized `IdMixin`, `TimestampMixin`, and `AuditMixin`.
69
+ - **Base Models**: Core models setup to be inherited across all entity definitions.
70
+ - **Shared Services**: Reusable services logic for basic CRUD and related queries (coming soon).
71
+
72
+ ## Documentation
73
+
74
+ See the `docs/` folder for more detailed instructions and usage guides:
75
+
76
+ - [Usage Guide](docs/guide.md)
77
+
78
+ ## Examples
79
+
80
+ Check the `examples/` folder for sample implementation.
81
+
82
+ ## License
83
+
84
+ This project is licensed under the MIT License.
@@ -0,0 +1,11 @@
1
+ tools2fast_fastapi/__init__.py,sha256=smwhi4EUPRuM4oKv1VFolzwpZskAYdBCbz5qB-Ujjfc,226
2
+ tools2fast_fastapi/__version__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
3
+ tools2fast_fastapi/models/__init__.py,sha256=I2PkqSgzOPfEhxUaKtwdMl7lyr40tvXgVbXTwaxSoRk,126
4
+ tools2fast_fastapi/models/mixins.py,sha256=oAEkzFkk_ZYT023dFSOFrjtaZIy4oVoOoM22no2b_2k,1181
5
+ tools2fast_fastapi/schemas/__init__.py,sha256=d-8WdKTDtjLuwxwoPOdIOC4-axtEYrI8uxlVcZL47m0,126
6
+ tools2fast_fastapi/schemas/mixins.py,sha256=-5sMsB1IuqRrzdQjNy0k5YBuzTEHyIwP-Re-wiwKC-E,495
7
+ tools2fast_fastapi-0.1.0.dist-info/licenses/LICENSE,sha256=CkISX1hNEwxxrPTOXet3IYMEH28Bn7SoUyKniRjg68I,1086
8
+ tools2fast_fastapi-0.1.0.dist-info/METADATA,sha256=vS4cqBBhe4-b0oS_E9D0P17gndlMfDhfy3wnm7-ylBQ,3538
9
+ tools2fast_fastapi-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
10
+ tools2fast_fastapi-0.1.0.dist-info/top_level.txt,sha256=XikknpQ46ndkjCvWX_Njfz4S0XyUKjXqfA4tTEGvzwQ,19
11
+ tools2fast_fastapi-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Angel Daniel Sanchez Castillo
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.
@@ -0,0 +1 @@
1
+ tools2fast_fastapi