Route
Route is a Python package for generating directory tree, especially in any python project or package.
Installation
pip install route
Usage
from route import directory_tree
directory_tree(path=".", save_to_file=True, display_output=True)
Output:
🛸 route
├── README.md
├── run_me.py
├── setup.py
└── 🚀 route
├── dir.py
├── directory_tree.py
├── emoji.py
├── generate_get_dir_prefix.py
├── setup_utils.py
└── starts_with.py
How to Use Route in Your Python Package
- Use the following code at the top of your
setup.pyfile (Script 1) - Add
post_install_commandandpost_develop_commandto thecmdclassargument in thesetupfunction (Script 2) - See the
setup.pyfile for an example.
Script 1
from route import get_post_develop_command, get_post_install_command
import os
# Define the arguments for the dir function
dir_path = os.getcwd()
ignore_ends_with={'.pyc', '.egg-info', '.ipynb'}
ignore_exact_match={
'__init__.py', '__pycache__', '.git', '.idea', '.pytest_cache', '.ipynb_checkpoints',
'dist', 'build', '.gitignore'
}
specific_prefixes = {
'* is_root': '🛸',
'* is_module': '🚀',
'* is_test_dir': '🧪',
'test': '🧪',
'tests': '🧪'
}
dir_args = {
'path': dir_path,
'ignore_ends_with': ignore_ends_with,
'ignore_exact_match': ignore_exact_match,
'specific_prefixes': specific_prefixes,
'save_to_file': True, # This creates a Markdown file
'output_file': 'DIRECTORY.md' # This is the name of the file that will be created
}
post_develop_command = get_post_develop_command(dir_args=dir_args)
post_install_command = get_post_install_command(dir_args=dir_args)
Script 2
setup(
...
cmdclass={
"install": post_install_command,
"develop": post_develop_command,
},
...
)
Metadata
Release files for route 2025.2.23.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| route-2025.2.23.1.tar.gz | 8.4 kB | Without provenance | Details for route-2025.2.23.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| route-2025.2.23.1-py3-none-any.whl | Python 3 | none | any | Details for route-2025.2.23.1-py3-none-any.whl |
Total release size: 16.8 kB
Release files / route-2025.2.23.1.tar.gz
| Download URL | route-2025.2.23.1.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d43d4a058c55ec4d1c345be318dd8d55e7e410717e0fc721ee92f3a3d158273
|
|
BLAKE2b-256 checksum How to use checksums |
6c0189a4393c911a82a9666c2613cccfa5f3b482955a70ace0fc30b159be6b14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.15
|
Release files / route-2025.2.23.1-py3-none-any.whl
| Download URL | route-2025.2.23.1-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e8d7335666b46c74a02831e368233cf1bd9dbea52980b11f290436c879bb3d4
|
|
BLAKE2b-256 checksum How to use checksums |
372eee80b0565d9f773f979387d3449b43acb269e0fca6571ee2cf6f96d726a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.15
|
Security for route 2025.2.23.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.