Grobl
Grobl is a command-line tool designed to generate and copy a complete code project file tree along with the contents of valid text files. It's particularly useful for sharing code projects in communication platforms.
Features
- Generate a file tree for a given list of paths.
- Exclude specific files and directories from the tree display.
- Print contents of valid text files (source code, markdown, txt, etc.).
- Exclude specific files from printing their contents while still showing them in the tree.
- Parse settings from
pyproject.tomlfiles in the directory hierarchy. - Copy the output to the clipboard for easy sharing.
Installation
Prerequisites
- Python 3.11 or later.
pipxfor isolated Python application installations.
Install using pipx
To install grobl, use the following command:
pipx install grobl
If you don't have pipx installed, you can install it using:
python -m pip install --user pipx
python -m pipx ensurepath
Usage
To use grobl, run the following command:
grobl <paths> [--exclude-tree <patterns>] [--exclude-print <patterns>]
Arguments
<paths>: List of file paths to include in the tree.--exclude-tree: Patterns to exclude from the tree display.--exclude-print: Patterns to exclude from file printing.
Example
grobl ./snoop/apriquot ./snoop/weasel --exclude-tree "*.md" --exclude-print "*.css"
This command will:
- Generate the file tree for the specified paths.
- Exclude files matching *.md from the tree display.
- Exclude files matching *.css from being printed.
- Copy the final output to the clipboard.
pyproject.toml Configuration
You can configure grobl using a pyproject.toml file in your directory hierarchy. The settings in this file will affect the directories containing them and override settings from ancestor directories. Example pyproject.toml
[tool.file_tree_printer]
exclude_tree = ["*.jsonl", "*.jsonl.*", "tests/*", "cov.xml", "*.log", "*.tmp"]
exclude_print = ["*.json", "*.html"]
Configuration Details
exclude_tree: A list of glob patterns to exclude from the file tree display. Files and directories matching these patterns will not appear in the tree structure.exclude_print: A list of glob patterns to exclude from file printing. Files matching these patterns will appear in the tree structure but their contents will not be printed.
Example Configuration
Consider the following directory structure:
project-root/
│
├── pyproject.toml
├── src/
│ ├── main.py
│ ├── utils.py
│ └── config.json
├── tests/
│ ├── test_main.py
│ └── test_utils.py
└── README.md
With the following pyproject.toml:
[tool.file_tree_printer]
exclude_tree = ["tests/*", "*.json"]
exclude_print = ["*.md"]
Running grobl project-root/ will:
- Exclude the tests directory and config.json file from the tree display.
- Exclude README.md from being printed.
- Copy the output to the clipboard.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue. License
This project is licensed under the MIT License.
Metadata
Release files for grobl 0.1.0
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 |
|---|---|---|---|---|
| grobl-0.1.0.tar.gz | 6.6 kB | Without provenance | Details for grobl-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| grobl-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for grobl-0.1.0-py3-none-any.whl |
Total release size: 11.0 kB
Release files / grobl-0.1.0.tar.gz
| Download URL | grobl-0.1.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba3745c2de127b52ba450a6088a86739c1196a640814df9241db066de01c29eb
|
|
BLAKE2b-256 checksum How to use checksums |
ee460791d0ce6a4a0a1b2be6e884b9e083cdb0b6d6edfec2612c8d4e7d7fd12d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.9
|
Release files / grobl-0.1.0-py3-none-any.whl
| Download URL | grobl-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8918d22a51f0135f72df9ec4fad838f00a5ef2852c969b7a3e36be927bf76719
|
|
BLAKE2b-256 checksum How to use checksums |
1890d7be6d374ab99049ff39d1769e77262cb59dbe11a06b0113ae02d2612cb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.9
|
Security for grobl 0.1.0
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.