Skip to main content

A simple routing library

Project description

CodeRouter

A simple routing library for Python applications.

Installation

pip install coderouter

Usage

from coderouter import Router

router = Router()

def home_handler():
    return "Welcome home!"

def about_handler():
    return "About page"

router.add_route("/", home_handler)
router.add_route("/about", about_handler, methods=["GET", "POST"])

# Handle requests
result = router.handle("/")  # Returns "Welcome home!"
result = router.handle("/about", "POST")  # Returns "About page"

License

MIT

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

coderouter-0.1.0.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coderouter-0.1.0-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file coderouter-0.1.0.tar.gz.

File metadata

  • Download URL: coderouter-0.1.0.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for coderouter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e486fad75db732eb689db4579cccc9ec6cb03f4c96f8e24d9ebea6935370a143
MD5 5ec81a2215fc3d4b456a59c837d93fe1
BLAKE2b-256 14ed00a0459c0c81612d65af3feccb468f85ea1d0428362d436944d3a21d8550

See more details on using hashes here.

File details

Details for the file coderouter-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: coderouter-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for coderouter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 205fde590197c632320b667cb0b025d6563a20110ccd712ee95d20e8e0c763d8
MD5 5d13bb5a58b8316e8aa00dcc19f634fd
BLAKE2b-256 37b09b3f818f9b8080e5e5a1c29da04f066b3996d3539ab8f3279928544f046b

See more details on using hashes here.

Supported by

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