Skip to main content

SimpleRoute

A simple router / treelib for python.

Usage

Installation

pip install simpleroute

Import

Note: as simpleroute uses two dictionaries internally rather than an OOP-based node system,

Traverse replaces the standard "Node" class present in most other tree libraries.

from simpleroute import BaseRouter, Router, Traverse

Classes

router = BaseRouter([]) # list of paths sep by /
path, kwargs = router.match("SOME_STR_HERE") #match wildcards, eg /etc/1 to /etc/:num
router = Router({}) # dict of paths:datavals sep by /
path, kwargs, data = router.match("SOME_STR_HERE") #match wildcards, eg /etc/1 to /etc/:num
traverse = Traverse.go(router, path="SOME_PATH_HERE") #returns an object of Traverse, optional path to go
#use get_child, get_children, get_parent, get_data, get_path, get_sub to manipulate the object

Metadata

Release files for simpleroute 0.0.3

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

Source distribution (sdist)

Source distribution for simpleroute 0.0.3
File Size Uploaded
simpleroute-0.0.3.tar.gz 8.6 kB Details

Built distribution (wheel)

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

Total release size: 17.3 kB

Release files / simpleroute-0.0.3.tar.gz

Download URL simpleroute-0.0.3.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6b6d25248d06663b896f2547729674cb8887f65957cc8e09e9e333710398946b
BLAKE2b-256 checksum
How to use checksums
edf8359c2e2538276ac64420515fd3451eee2d9660f076b4002aac1994b3fbfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / simpleroute-0.0.3-py3-none-any.whl

Download URL simpleroute-0.0.3-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0dacfdc30188d74375afdd1fa41ee1dd338eb165fc840102dc85b141aad32120
BLAKE2b-256 checksum
How to use checksums
c88742cdd45492425287b63579c96b5b53812928aa792e262180f34cac513e25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

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