Skip to main content
https://github.com/futursolo/destination/actions/workflows/everything.yml/badge.svg https://coveralls.io/repos/github/futursolo/destination/badge.svg?branch=master

Destination is a framework agnostic regular expression based path routing library.

Installation

$ pip install -U destination

Thread Safety

Currently, destination is not thread safe. Hence, you should deepcopy instances or add a mutex lock before using dispatchers and rules in the other threads.

Usage

The default implementation of url parsing uses regular expressions. This is similar to Django and Tornado. You can create rules and dispatchers to resolve and parse your url using regular expressions set in the rules.

Generally, you should start with ReRule and Dispatcher. You can create a ReRule with the regular expression that is going to be used to parse (and possibly compose) the url, and an optional identifier to help you identify which rule is parsed, if an identifier is not provided or its value is set to None, the rule itself will be used as an identifier. A Dispatcher may be instantiated with no arguments as a storage of multiple rules. You can add or remove rules at any time.

ReSubDispatcher is a sub-dispatcher that can be added to a dispatcher as a rule. It uses regular expressions to chop off the part matched to the regular expression and dispatches the rest part to the rules added to it.

BaseRule and BaseDispatcher can be used to create custom rules and dispatchers.

Licence

MIT License

Copyright (c) 2021 Kaede Hoshikawa

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for destination 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for destination 1.3.0
File Size Uploaded
destination-1.3.0.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for destination 1.3.0
File Interpreter ABI Platform
destination-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / destination-1.3.0.tar.gz

Download URL destination-1.3.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f52222c82f54c094648d937e8d87f1399bba45eceeee40f5a859d8ac197da239
BLAKE2b-256 checksum
How to use checksums
b97aa11f4df3f660377fc0dd140f738f53c28d9b75e8f12588ba1f8aea5cd2d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.6.13 Linux/5.8.0-1033-azure

Release files / destination-1.3.0-py3-none-any.whl

Download URL destination-1.3.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2c1edd1d8a147509eea7ece4a1b9a24833471db8057d499e33ef9773bf62477
BLAKE2b-256 checksum
How to use checksums
0fce4963d52c502aabc88a4a77e41a66bd0e49a95bbc40517b4f34dd183f2cd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.6.13 Linux/5.8.0-1033-azure

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page