Skip to main content

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


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)

Uploaded Source

Built Distribution

string_routing-0.0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

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

Hashes for string-routing-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8c4df14ecca27b59b1d0330dfce36597cfae6adae4dcc52a5f250c2531c07d1e
MD5 9870ac75d9ba891e98358955c321ee65
BLAKE2b-256 471f3609e29923215a3aac7766ae176204ea3f321661c3a15de1aec55bc61239

See more details on using hashes here.

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

Hashes for string_routing-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9ad266902a2e16ba53a9304f5987d19b3c84e8ef7f8a6639b16d4c67b00d107
MD5 074adff4704f8c48427c4d8e967f0fa9
BLAKE2b-256 69ee33898242981963c41b68f2daad704d28393805814e45dcbb092c57b778ab

See more details on using hashes here.

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