🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

string-routing

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-routing

A simple way to link strings to functions

0.0.1
PyPI
Maintainers
1

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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts