A batteries included web framework written in python
Project description
MarsRouter
MarsRouter is a lightweight and flexible dynamic routing system for Python. It allows you to define URL patterns with dynamic segments and map them to controller functions. The routing system matches incoming URLs to the defined patterns, extracts dynamic parameters, and provides a simple interface to handle requests based on these parameters.
Features
- Dynamic URL pattern matching
- Simple function-based controllers
- Flexible parameter extraction
- Easy integration into existing Python projects
Usage
router = Router()
router.add_route('/user/{username}', user_profile)
result = router.dispatch('/user/john')
# {'controller': user_profile, 'params': {'username': 'john'}}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
marsrouter-0.20.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for MarsRouter-0.20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d94413cc2416e4a5ce7179633f1e5aa3ec033ba3ab8eb0bb0e7f85880bb591a |
|
MD5 | 4deae1c21fdaf9db3f3ce868569bf628 |
|
BLAKE2b-256 | 2c4acfa8012682883baad6944f0299db9a3102d943457f8f47811481e5d0fd59 |