shlep
shlep lets you package your directory's content in a format that can be easily passed to ChatGPT. This is especially
useful when using the code interpreter plugin!
It automatically excludes files that match what's in your .gitignore file, as well as any additional exclude patterns you provide.
Installation
You can install shlep from PyPI, but the recommended installation for the CLI is through pipx.
pipx install shlep
Features
- Supports various output formats: JSON, CSV, and plain text
- Excludes files and directories matching patterns in your
.gitignorefile - Allows you to provide additional exclude patterns
- Can write output to a file or print it to stdout
Demo
https://github.com/knowsuchagency/shlep/assets/11974795/ebfdae55-35f2-4edc-b0cb-089d2f99a7ca
Usage
shlep can be used as a command-line tool or programmatically in your Python code.
Command-line usage
usage: shlep [-h] [-o OUTPUT_FILE] [-i INDENT] [-e EXCLUDE] [-f {json,csv,plaintext}] directory
Gather directory contents into a single output.
positional arguments:
directory The directory to analyze.
optional arguments:
-h, --help show this help message and exit
-o OUTPUT_FILE, --output-file OUTPUT_FILE
The output file to generate. If not specified, output is printed to stdout.
-i INDENT, --indent INDENT
The number of spaces to use for indentation in the output JSON.
-e EXCLUDE, --exclude EXCLUDE
Additional files or directories to exclude.
-f {json,csv,plaintext}, --format {json,csv,plaintext}
The output format. Can be 'json', 'csv', or 'plaintext'. Default is 'json'.
Programmatically in Python
from shlep import shlep
directory = "path/to/your/directory"
indent = 2
additional_excludes = [".env", "node_modules/"]
output_format = "json"
output_file = "output.json"
shlep(directory, indent, additional_excludes, output_format, output_file)
License
This project is licensed under the Apache License 2.0. You can find the full license text in the LICENSE file.
Metadata
Release files for shlep 3.2.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 | |
|---|---|---|---|---|
| shlep-3.2.1.tar.gz | 7.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| shlep-3.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.2 kB
Release files / shlep-3.2.1.tar.gz
| Download URL | shlep-3.2.1.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
692c03b2300bda05d33509bdce9a7788d5b60ea44d5ec8c28c85bef097eabcd2
|
|
BLAKE2b-256 checksum How to use checksums |
2c27915c581299e83ebedd1aab82c4b390b6fb10f98c2734be121bcefdea0446
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / shlep-3.2.1-py3-none-any.whl
| Download URL | shlep-3.2.1-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
470fd3e98d547ab2bda5b00405854fb3f47d7280547b73a21ff486e4129cf0f0
|
|
BLAKE2b-256 checksum How to use checksums |
c8d6d118b92e4f1b7414b49524a4a26fb2ece8241f5df45d456916fd3ac23a0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for shlep 3.2.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.