Skip to main content

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.50.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

MarsRouter-0.50-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page