A simple way to link strings to functions
Project description
String-routing
Connect strings to functions. Best usage with input commands.
Usage
import route
sr = route.StringRouter() # Construct the string router
@sr.route("login")
def login():
print("Running login...")
To run the login function with the command:
command = input("Command: ") # Input command for example
sr.trigger(command) # <- will run the command if it has a link
Command: login
Running login...
Typing:
print(sr)
Will ouput:
{'login': <function login at 0xPOINTER>}
For each of the links connected
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
string-routing-0.0.1.tar.gz
(2.0 kB
view details)
Built Distribution
File details
Details for the file string-routing-0.0.1.tar.gz
.
File metadata
- Download URL: string-routing-0.0.1.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c4df14ecca27b59b1d0330dfce36597cfae6adae4dcc52a5f250c2531c07d1e |
|
MD5 | 9870ac75d9ba891e98358955c321ee65 |
|
BLAKE2b-256 | 471f3609e29923215a3aac7766ae176204ea3f321661c3a15de1aec55bc61239 |
File details
Details for the file string_routing-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: string_routing-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9ad266902a2e16ba53a9304f5987d19b3c84e8ef7f8a6639b16d4c67b00d107 |
|
MD5 | 074adff4704f8c48427c4d8e967f0fa9 |
|
BLAKE2b-256 | 69ee33898242981963c41b68f2daad704d28393805814e45dcbb092c57b778ab |