cullinan 0.65a1__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.
Files changed (32) hide show
  1. cullinan-0.65a1/LICENSE +21 -0
  2. cullinan-0.65a1/PKG-INFO +226 -0
  3. cullinan-0.65a1/cullinan/__init__.py +11 -0
  4. cullinan-0.65a1/cullinan/application.py +491 -0
  5. cullinan-0.65a1/cullinan/config.py +187 -0
  6. cullinan-0.65a1/cullinan/controller.py +1311 -0
  7. cullinan-0.65a1/cullinan/dao.py +34 -0
  8. cullinan-0.65a1/cullinan/exceptions.py +134 -0
  9. cullinan-0.65a1/cullinan/hooks.py +18 -0
  10. cullinan-0.65a1/cullinan/logging_utils.py +229 -0
  11. cullinan-0.65a1/cullinan/module_scanner.py +619 -0
  12. cullinan-0.65a1/cullinan/registry.py +191 -0
  13. cullinan-0.65a1/cullinan/request.py +121 -0
  14. cullinan-0.65a1/cullinan/service.py +23 -0
  15. cullinan-0.65a1/cullinan/websocket.py +15 -0
  16. cullinan-0.65a1/cullinan.egg-info/PKG-INFO +226 -0
  17. cullinan-0.65a1/cullinan.egg-info/SOURCES.txt +30 -0
  18. cullinan-0.65a1/cullinan.egg-info/dependency_links.txt +1 -0
  19. cullinan-0.65a1/cullinan.egg-info/requires.txt +5 -0
  20. cullinan-0.65a1/cullinan.egg-info/top_level.txt +1 -0
  21. cullinan-0.65a1/setup.cfg +4 -0
  22. cullinan-0.65a1/setup.py +36 -0
  23. cullinan-0.65a1/tests/test_application_coverage.py +199 -0
  24. cullinan-0.65a1/tests/test_compatibility.py +490 -0
  25. cullinan-0.65a1/tests/test_config_coverage.py +192 -0
  26. cullinan-0.65a1/tests/test_controller_coverage.py +487 -0
  27. cullinan-0.65a1/tests/test_core.py +246 -0
  28. cullinan-0.65a1/tests/test_exceptions_logging.py +301 -0
  29. cullinan-0.65a1/tests/test_module_scanner.py +126 -0
  30. cullinan-0.65a1/tests/test_packaging.py +153 -0
  31. cullinan-0.65a1/tests/test_performance.py +366 -0
  32. cullinan-0.65a1/tests/test_registry.py +578 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 PlumeInk
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,226 @@
1
+ Metadata-Version: 2.4
2
+ Name: cullinan
3
+ Version: 0.65a1
4
+ Summary: Cullinan is written based on tornado and Sqlalchemy to help the project quickly build web application
5
+ Home-page: https://github.com/plumeink/Cullinan
6
+ Author: plumeink
7
+ Author-email: official@plumeink.com
8
+ License: http://www.apache.org/licenses/LICENSE-2.0
9
+ Project-URL: Source, https://github.com/plumeink/Cullinan
10
+ Project-URL: Wiki, https://github.com/plumeink/Cullinan/wiki
11
+ Classifier: Programming Language :: Python :: 3.7
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: License :: OSI Approved :: Apache Software License
19
+ Classifier: Operating System :: OS Independent
20
+ Requires-Python: >=3.7
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: tornado
24
+ Requires-Dist: python-dotenv
25
+ Requires-Dist: sqlalchemy
26
+ Requires-Dist: pymysql
27
+ Requires-Dist: contextvars
28
+ Dynamic: author
29
+ Dynamic: author-email
30
+ Dynamic: classifier
31
+ Dynamic: description
32
+ Dynamic: description-content-type
33
+ Dynamic: home-page
34
+ Dynamic: license
35
+ Dynamic: license-file
36
+ Dynamic: project-url
37
+ Dynamic: requires-dist
38
+ Dynamic: requires-python
39
+ Dynamic: summary
40
+
41
+ ![Python version](https://img.shields.io/badge/python-3.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12%20|%203.13-blue)
42
+ ![PyPI version](https://img.shields.io/pypi/v/cullinan.svg?style=flat&logo=pypi&color=green)
43
+ ![PyPI downloads](https://img.shields.io/pypi/dm/cullinan.svg?style=flat&logo=pypi&color=blue)
44
+ ![GitHub stars](https://img.shields.io/github/stars/plumeink/cullinan.svg?style=flat&logo=github&color=white)
45
+ ![License](https://img.shields.io/github/license/plumeink/cullinan.svg?style=flat&color=white)
46
+
47
+ ```
48
+ _____ _ _ _
49
+ / ____| | | (_)
50
+ | | _ _| | |_ _ __ __ _ _ __
51
+ | | | | | | | | | '_ \ / _` | '_ \
52
+ | |___| |_| | | | | | | | (_| | | | |
53
+ \_____\__, _|_|_|_|_| |_|\__,_|_| |_|
54
+ ```
55
+
56
+ # Cullinan
57
+
58
+ **A lightweight, production-ready Python web framework with full packaging support.**
59
+
60
+ Cullinan is built on Tornado and SQLAlchemy, designed to help you quickly build web applications with easy packaging for deployment.
61
+
62
+ ---
63
+
64
+ ## ✨ Features
65
+
66
+ - 🚀 **Easy to Use** - Simple decorator-based routing
67
+ - 📦 **Packaging Ready** - Full Nuitka & PyInstaller support
68
+ - ⚙️ **Flexible Configuration** - Multiple configuration options
69
+ - 🌍 **Cross-Platform** - Windows, Linux, macOS
70
+ - 🏭 **Production Ready** - Built on battle-tested Tornado
71
+ - 🗄️ **SQLAlchemy Integration** - Built-in ORM support
72
+ - 🔧 **Smart Module Loading** - Auto-discovery for development, configurable for packaging
73
+
74
+ ---
75
+
76
+ ## 📚 Documentation
77
+
78
+ ### Language / 语言
79
+
80
+ - **[English Documentation](docs/README.md)** - Complete English documentation
81
+ - **[中文文档](docs/zh/README_zh.md)** - 完整中文文档
82
+
83
+ ---
84
+
85
+ ## 🚀 Quick Start
86
+
87
+ ## 📦 Installation
88
+
89
+ ### From PyPI (Stable Release)
90
+
91
+ ```bash
92
+ pip install cullinan
93
+ ```
94
+
95
+ ### Basic Application
96
+
97
+ ```python
98
+ # app.py
99
+ from cullinan import configure, application
100
+ from cullinan.controller import controller, get_api
101
+
102
+ # Configure for packaging (optional in development)
103
+ configure(user_packages=['your_app'])
104
+
105
+ @controller(url='/api')
106
+ class HelloController:
107
+ @get_api(url='/hello')
108
+ def hello(self, query_params):
109
+ return self.response_build(status=200, message="Hello, Cullinan!" + query_params)
110
+
111
+ if __name__ == '__main__':
112
+ application.run()
113
+ ```
114
+
115
+ ### Run
116
+
117
+ ```bash
118
+ python app.py
119
+ # Visit: http://localhost:4080/api/hello
120
+ ```
121
+
122
+ ---
123
+
124
+ ## 💡 Full Example
125
+
126
+ ### Project Structure
127
+
128
+ ```
129
+ my_app/
130
+ ├── main.py # Entry point
131
+ ├── controllers/ # Controllers
132
+ │ ├── __init__.py
133
+ │ └── api.py
134
+ ├── services/ # Services
135
+ │ ├── __init__.py
136
+ │ └── data.py
137
+ └── models/ # Models
138
+ ├── __init__.py
139
+ └── user.py
140
+ ```
141
+
142
+ ### Controller (`controllers/api.py`)
143
+
144
+ ```python
145
+ from cullinan.controller import controller, get_api, post_api
146
+
147
+
148
+ @controller(url='/api')
149
+ class UserController:
150
+
151
+ @get_api(url='/users', query_params=['id'])
152
+ def get_user(self, query_params):
153
+ user_id = query_params.get('id')
154
+ return self.response_build(status=200, message="User fetched successfully", data={"user_id": user_id})
155
+
156
+ @post_api(url='/users', body_params=['name', 'email'])
157
+ def create_user(self, body_params):
158
+ self.service['UserService'].create_user(
159
+ body_params['name'],
160
+ body_params['email']
161
+ )
162
+ return self.response_build(status=201, message="User created successfully")
163
+ ```
164
+
165
+ ### Application (`main.py`)
166
+
167
+ ```python
168
+ from cullinan import configure, application
169
+
170
+ # Configure for packaging
171
+ configure(
172
+ user_packages=['my_app'],
173
+ verbose=True # Enable logging
174
+ )
175
+
176
+ def main():
177
+ application.run()
178
+
179
+ if __name__ == '__main__':
180
+ main()
181
+ ```
182
+
183
+ ---
184
+
185
+ ## 📖 Documentation Structure
186
+
187
+ ```
188
+ docs/
189
+ ├── README.md # Documentation index
190
+ ├── index.md # Framework overview
191
+ ├── 01-configuration.md # Configuration guide
192
+ ├── 02-packaging.md # Packaging guide
193
+ ├── 03-troubleshooting.md # Troubleshooting
194
+ ├── 04-quick-reference.md # Quick reference
195
+ └── 05-build-scripts.md # Build scripts guide
196
+ ```
197
+
198
+ ---
199
+
200
+ ## 🔗 Links
201
+
202
+ - **Documentation**: [docs/README.md](docs/README.md)
203
+ - **GitHub**: https://github.com/plumeink/Cullinan
204
+ - **PyPI**: https://pypi.org/project/cullinan/
205
+ - **Issues**: https://github.com/plumeink/Cullinan/issues
206
+ - **Discussions**: https://github.com/plumeink/Cullinan/discussions
207
+
208
+ ---
209
+
210
+ ## 📄 License
211
+
212
+ MIT License - see [LICENSE](LICENSE) for details.
213
+
214
+ ---
215
+
216
+ ## 🙏 Acknowledgments
217
+
218
+ - Built on [Tornado](https://www.tornadoweb.org/)
219
+ - ORM powered by [SQLAlchemy](https://www.sqlalchemy.org/)
220
+ - Packaging powered by [Nuitka](https://nuitka.net/) and [PyInstaller](https://pyinstaller.org/)
221
+
222
+ ---
223
+
224
+ ## 💻 Maintainer
225
+
226
+ [<img src="https://avatars.githubusercontent.com/u/104434649?v=4" width = "40" height = "40"/>](https://github.com/plumeink)
@@ -0,0 +1,11 @@
1
+ import logging
2
+
3
+ # Prevent "No handlers could be found" warnings when library is imported
4
+ # Applications should configure logging (console/file) at their entry point.
5
+ logging.getLogger('cullinan').addHandler(logging.NullHandler())
6
+
7
+ # 导出配置接口
8
+ from cullinan.config import configure, get_config, CullinanConfig
9
+
10
+ __all__ = ['configure', 'get_config', 'CullinanConfig']
11
+