tachyon-api 0.5.5__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.

Potentially problematic release.


This version of tachyon-api might be problematic. Click here for more details.

@@ -0,0 +1,239 @@
1
+ Metadata-Version: 2.3
2
+ Name: tachyon-api
3
+ Version: 0.5.5
4
+ Summary: A lightweight, FastAPI-inspired web framework
5
+ License: GPL-3.0-or-later
6
+ Author: Juan Manuel Panozzo Zรฉnere
7
+ Author-email: jm.panozzozenere@gmail.com
8
+ Requires-Python: >=3.10,<4.0
9
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Requires-Dist: msgspec (>=0.19.0,<0.20.0)
16
+ Requires-Dist: orjson (>=3.11.1,<4.0.0)
17
+ Requires-Dist: ruff (>=0.12.7,<0.13.0)
18
+ Requires-Dist: starlette (>=0.47.2,<0.48.0)
19
+ Requires-Dist: typer (>=0.16.0,<0.17.0)
20
+ Requires-Dist: uvicorn (>=0.35.0,<0.36.0)
21
+ Description-Content-Type: text/markdown
22
+
23
+ # ๐Ÿš€ Tachyon API
24
+
25
+ ![Version](https://img.shields.io/badge/version-0.5.5-blue.svg)
26
+ ![Python](https://img.shields.io/badge/python-3.10+-brightgreen.svg)
27
+ ![License](https://img.shields.io/badge/license-GPL--3.0-orange.svg)
28
+ ![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)
29
+
30
+ **A lightweight, high-performance API framework for Python with the elegance of FastAPI and the speed of light.**
31
+
32
+ Tachyon API combines the intuitive decorator-based syntax you love with minimal dependencies and maximal performance. Built with Test-Driven Development from the ground up, it offers a cleaner, faster alternative with full ASGI compatibility.
33
+
34
+ ```python
35
+ from tachyon_api import Tachyon
36
+ from tachyon_api.models import Struct
37
+
38
+ app = Tachyon()
39
+
40
+ class User(Struct):
41
+ name: str
42
+ age: int
43
+
44
+ @app.get("/")
45
+ def hello_world():
46
+ return {"message": "Tachyon is running at lightspeed!"}
47
+
48
+ @app.post("/users")
49
+ def create_user(user: User):
50
+ return {"created": user.name}
51
+ ```
52
+
53
+ ## โœจ Features
54
+
55
+ - ๐Ÿ” **Intuitive API** - Elegant decorator-based routing inspired by FastAPI
56
+ - ๐Ÿงฉ **Implicit & Explicit Dependency Injection** - Both supported for maximum flexibility
57
+ - ๐Ÿ“š **Automatic OpenAPI Documentation** - With Scalar UI, Swagger UI, and ReDoc support
58
+ - ๐Ÿ› ๏ธ **Router System** - Organize your API endpoints with powerful route grouping
59
+ - ๐Ÿงช **Built with TDD** - Comprehensive test suite ensures stability and correctness
60
+ - ๐Ÿ”„ **Middleware Support** - Both class-based and decorator-based approaches
61
+ - ๐Ÿš€ **High-Performance JSON** - Powered by msgspec and orjson for lightning-fast processing
62
+ - ๐Ÿชถ **Minimal Dependencies** - Lean core with only what you really need
63
+
64
+ ## ๐Ÿ“ฆ Installation
65
+
66
+ Tachyon API is currently in beta. The package will be available on PyPI and Poetry repositories soon!
67
+
68
+ ### From source (Currently the only method)
69
+
70
+ ```bash
71
+ git clone https://github.com/jmpanozzoz/tachyon_api.git
72
+ cd tachyon-api
73
+ pip install -r requirements.txt
74
+ ```
75
+
76
+ > **Note:** The `pip install tachyon-api` and `poetry add tachyon-api` commands will be available once the package is published to PyPI.
77
+
78
+ ## ๐Ÿ” Key Differences from FastAPI
79
+
80
+ While inspired by FastAPI's elegant API design, Tachyon API takes a different approach in several key areas:
81
+
82
+ | Feature | Tachyon API | FastAPI |
83
+ |---------|------------|---------|
84
+ | **Core Dependencies** | Minimalist: Starlette + msgspec + orjson | Pydantic + multiple dependencies |
85
+ | **Validation Engine** | msgspec (faster, lighter) | Pydantic (more features, heavier) |
86
+ | **Dependency Injection** | Both implicit and explicit | Primarily explicit |
87
+ | **Middleware Approach** | Dual API (class + decorator) | Class-based |
88
+ | **Development Approach** | Test-Driven from the start | Feature-driven |
89
+ | **Documentation UI** | Scalar UI (default), Swagger, ReDoc | Swagger UI (default), ReDoc |
90
+ | **Size** | Lightweight, focused | Comprehensive, full-featured |
91
+
92
+ ## ๐Ÿงช Test-Driven Development
93
+
94
+ Tachyon API is built with TDD principles at its core:
95
+
96
+ - Every feature starts with a test
97
+ - Comprehensive test coverage
98
+ - Self-contained test architecture
99
+ - Clear test documentation
100
+
101
+ This ensures stability, maintainability, and prevents regressions as the framework evolves.
102
+
103
+ ## ๐Ÿ”Œ Core Dependencies
104
+
105
+ Tachyon API maintains a minimal, carefully selected set of dependencies:
106
+
107
+ - **[Starlette](https://www.starlette.io/)**: ASGI framework providing solid foundations
108
+ - **[msgspec](https://jcristharif.com/msgspec/)**: Ultra-fast serialization and validation
109
+ - **[orjson](https://github.com/ijl/orjson)**: High-performance JSON parser
110
+ - **[uvicorn](https://www.uvicorn.org/)**: ASGI server for development and production
111
+
112
+ These were chosen for their performance, lightweight nature, and focused functionality.
113
+
114
+ ## ๐Ÿ’‰ Dependency Injection System
115
+
116
+ Tachyon API offers a flexible dependency injection system:
117
+
118
+ ### Implicit Injection
119
+
120
+ ```python
121
+ @injectable
122
+ class UserService:
123
+ def __init__(self, repository: UserRepository): # Auto-injected!
124
+ self.repository = repository
125
+
126
+ @app.get("/users/{user_id}")
127
+ def get_user(user_id: int, service: UserService): # Auto-injected!
128
+ return service.get_user(user_id)
129
+ ```
130
+
131
+ ### Explicit Injection
132
+
133
+ ```python
134
+ @app.get("/users/{user_id}")
135
+ def get_user(user_id: int, service: UserService = Depends()):
136
+ return service.get_user(user_id)
137
+ ```
138
+
139
+ ## ๐Ÿ”„ Middleware Support
140
+
141
+ Tachyon API supports middlewares in two elegant ways:
142
+
143
+ ### Class-based Approach
144
+
145
+ ```python
146
+ from tachyon_api.middlewares import CORSMiddleware, LoggerMiddleware
147
+
148
+ # Add built-in CORS middleware
149
+ app.add_middleware(
150
+ CORSMiddleware,
151
+ allow_origins=["*"],
152
+ allow_methods=["*"],
153
+ allow_headers=["*"],
154
+ allow_credentials=False,
155
+ )
156
+
157
+ # Add built-in Logger middleware
158
+ app.add_middleware(
159
+ LoggerMiddleware,
160
+ include_headers=True,
161
+ redact_headers=["authorization"],
162
+ )
163
+ ```
164
+
165
+ ### Decorator-based Approach
166
+
167
+ ```python
168
+ @app.middleware()
169
+ async def timing_middleware(scope, receive, send, app):
170
+ start_time = time.time()
171
+ await app(scope, receive, send)
172
+ print(f"Request took {time.time() - start_time:.4f}s")
173
+ ```
174
+
175
+ ### Built-in Middlewares
176
+
177
+ - CORSMiddleware: Handles preflight requests and injects CORS headers into responses. Highly configurable with allow_origins, allow_methods, allow_headers, allow_credentials, expose_headers, and max_age.
178
+ - LoggerMiddleware: Logs request start/end, duration, status code, and optionally headers and a non-intrusive body preview.
179
+
180
+ Both middlewares are standard ASGI middlewares and can be used with `app.add_middleware(...)`.
181
+
182
+ ## ๐Ÿ“š Example Application
183
+
184
+ For a complete example showcasing all features, see the [example directory](./example). It demonstrates:
185
+
186
+ - Clean architecture with models, services, and repositories
187
+ - Router organization
188
+ - Middleware implementation
189
+ - Dependency injection patterns
190
+ - OpenAPI documentation
191
+
192
+ Built-in CORS and Logger middlewares are integrated in the example for convenience. You can toggle settings in `example/app.py`.
193
+
194
+ Run the example with:
195
+
196
+ ```bash
197
+ cd example
198
+ python app.py
199
+ ```
200
+
201
+ Then visit:
202
+ - **API**: http://localhost:8000/
203
+ - **Documentation**: http://localhost:8000/docs
204
+
205
+ ## ๐Ÿ“ Contributing
206
+
207
+ Contributions are welcome! Please feel free to submit a Pull Request.
208
+
209
+ 1. Fork the repository
210
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
211
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
212
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
213
+ 5. Open a Pull Request
214
+
215
+ ## ๐Ÿ“œ License
216
+
217
+ This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
218
+
219
+ ## ๐Ÿ”ฎ Roadmap
220
+
221
+ - [ ] **Exception System**: Standardized exception handling and error responses
222
+ - [ ] **Environment Management**: Built-in environment variable handling and uvicorn integration
223
+ - [ ] **CLI Tool**: Project scaffolding and service generation
224
+ - Directory structure generation
225
+ - Service and repository templates
226
+ - API endpoint generation
227
+ - [ ] **Code Quality Tools**: Ruff integration for linting and formatting
228
+ - [ ] **Performance Optimization**: Cython compilation for service layer via CLI
229
+ - [ ] **Authentication Middleware**: Built-in auth patterns and middleware
230
+ - [ ] **Performance Benchmarks**: Comparisons against other frameworks
231
+ - [ ] **More Example Applications**: Demonstrating different use cases
232
+ - [ ] **Plugin System**: Extensibility through plugins
233
+ - [ ] **Deployment Guides**: Documentation for various deployment scenarios
234
+ - [ ] **And much more!**
235
+
236
+ ---
237
+
238
+ *Built with ๐Ÿ’œ by developers, for developers*
239
+
@@ -0,0 +1,16 @@
1
+ tachyon_api/__init__.py,sha256=MrwA2s-dfpygkU3iY6SghCeuWuF_tNwdWPQ9Onp-pmM,776
2
+ tachyon_api/app.py,sha256=Gt_ufNXdHAOR9lYJ8inLO_n-BuO_8VYmjTsuiab-r-k,24271
3
+ tachyon_api/di.py,sha256=FyFghfUjU0OaE_lW2BqItgsZWXFbLvwFsvVywqFjl6c,1505
4
+ tachyon_api/middlewares/__init__.py,sha256=BR1kqTj2IKdwhvVZCVn9p_rOFS0aOYoaC0bNX0C_0q4,121
5
+ tachyon_api/middlewares/core.py,sha256=-dJTrI6KJbQzatopCUC5lau_JIZpl063697qdE4W0SY,1440
6
+ tachyon_api/middlewares/cors.py,sha256=jZMqfFSz-14dwNIOOMqKaQm8Dypnf0V_WVW_4Uuc4AE,5716
7
+ tachyon_api/middlewares/logger.py,sha256=8W543kmfu7f5LpDQOox8Z4t3QT1knko7bUx7kWLCzWw,4832
8
+ tachyon_api/models.py,sha256=9pA5_ddMAcWW2dErAgeyG926NFezfCU68uuhW0qGMs4,2224
9
+ tachyon_api/openapi.py,sha256=MHrA7DnVW88gyh1fiiLx1-uE1mc-eU4yseD6dCf_wxs,11688
10
+ tachyon_api/params.py,sha256=gLGIsFEGr33_G0kakpqOFHRrf86w3egFJAjquZp3Lo0,2810
11
+ tachyon_api/responses.py,sha256=FaPv4xTXTw4jvyErsA7Gkp0l0POln-0_0bE6rbtsmcE,1574
12
+ tachyon_api/router.py,sha256=TlzgJ-UAfxBAQKy4YNVQIBObIDNzlebQ4G9qxsswJQ0,4204
13
+ tachyon_api-0.5.5.dist-info/LICENSE,sha256=UZXUTSuWBt8V377-2_YE4ug9t6rcBAKrfOVhIBQ8zhk,712
14
+ tachyon_api-0.5.5.dist-info/METADATA,sha256=F2WE9mBCeW6YJaYTaygrRphBpjCWkRLeQ1DjQNGjl2k,8413
15
+ tachyon_api-0.5.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
16
+ tachyon_api-0.5.5.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.1.3
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any