| Name | dukatools JSON |
| Version |
0.3.0
JSON |
| download |
| home_page | None |
| Summary | Small cross-platform CLI toolbelt: treex, dirproc, and more. |
| upload_time | 2025-10-19 16:47:29 |
| maintainer | None |
| docs_url | None |
| author | rexologue |
| requires_python | >=3.10 |
| license | None |
| keywords |
cli
utilities
filesystem
tree
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# dukatools
> A small, batteries-included command line toolbox for working with directories and media across Linux, macOS, and Windows.
## Table of contents
- [Features at a glance](#features-at-a-glance)
- [Installation](#installation)
- [Upgrading](#upgrading)
- [Quick start](#quick-start)
- [CLI utilities](#cli-utilities)
- [treex — directory trees with excludes](#treex--directory-trees-with-excludes)
- [dirproc — batch dump directory files](#dirproc--batch-dump-directory-files)
- [vidcut — fast and accurate video trimming](#vidcut--fast-and-accurate-video-trimming)
- [pydown — grab python-build-standalone releases](#pydown--grab-python-build-standalone-releases)
- [Configuration & environment variables](#configuration--environment-variables)
- [Development](#development)
- [License](#license)
## Features at a glance
- **Cross-platform binaries** via `uv tool`, `pipx`, or `pip` — no manual PATH setup required.
- **Tree inspection with smart excludes** through `treex`, ideal for sharing repository structure without build artifacts.
- **Directory dumping** with on-the-fly encoding detection (`dirproc`) for audits, backups, and quick reviews.
- **FFmpeg-powered video trimming** (`vidcut`) with automatic fallback from stream-copy to frame-accurate cuts.
- **One-file Python downloads** (`pydown`) for fetching and unpacking python-build-standalone releases without manual API spelunking.
- **Zero-config defaults** plus optional environment overrides when you need extra control.
## Installation
`dukatools` is distributed as a standard Python package targeting Python 3.8+.
### Using [uv](https://docs.astral.sh/uv/)
```bash
uv tool install dukatools
```
### Using [pipx](https://pipx.pypa.io/)
```bash
pipx install dukatools
```
### Using pip
```bash
python -m pip install --user dukatools
```
All installation methods place the `treex`, `dirproc`, `vidcut`, and `pydown` entry points on your PATH.
## Upgrading
Stay current with the latest enhancements and fixes:
```bash
uv tool upgrade dukatools
# or
pipx upgrade dukatools
# or
python -m pip install --upgrade dukatools
```
## Quick start
```bash
# Explore a repository without build artifacts
$ treex --path . --exclude .git --exclude-pattern "*.pyc" "build"
# Dump every text file in a directory into stdout (recursively)
$ dirproc ./notes --exclude-pattern "^archive/"
# Trim the first five seconds off a video without re-encoding
$ vidcut sample.mp4 --trim-start 5s --overwrite
# Download and extract a python-build-standalone release into ~/python-builds
$ pydown --dest ~/python-builds --version 3.12 --extract
```
## CLI utilities
### treex — directory trees with excludes
`treex` renders a directory structure in a friendly tree format while supporting both exact-name excludes and glob patterns.
**Highlights**
- Exclude generated folders such as `__pycache__`, `build`, or `node_modules` with a single command.
- Handles deeply nested projects and gracefully reports permission errors.
- Works great for quickly sharing repository layouts in issues, documentation, or chats.
**Usage**
```bash
treex --path PATH \
[--exclude NAME ...] \
[--exclude-pattern GLOB ...]
```
**Example output**
```
Directory tree for: ./project
Excluded patterns: *.pyc
├── pyproject.toml
├── README.md
└── src
├── __init__.py
└── project
└── core.py
```
### dirproc — batch dump directory files
`dirproc` walks a directory, opening each text file, detecting its encoding (via `chardet`), and streaming the content either to stdout or to a UTF-8 file you specify.
**Highlights**
- Recursive by default, with `--non-recursive` available for shallow inspections.
- Combine `--exclude-name` and `--exclude-pattern` (regex) to skip sensitive or noisy paths.
- Emits friendly messages when files are unreadable, including the error reason.
- Perfect for quickly packaging logs, notes, or configuration snapshots for debugging.
**Usage**
```bash
dirproc ROOT_DIR \
[--output-file OUTPUT.txt] \
[--non-recursive] \
[--exclude-name NAME ...] \
[--exclude-pattern REGEX ...]
```
**Writing to a file**
```bash
dirproc ./config --output-file artifacts/config-dump.txt --exclude-pattern "\.git/"
```
### vidcut — fast and accurate video trimming
`vidcut` wraps FFmpeg and provides a friendly interface for clipping one or more video files. It prefers stream-copy (no re-encode) for speed, then transparently falls back to a frame-accurate re-encode when necessary.
**Highlights**
- Accepts flexible time formats (`90`, `45.5`, `00:01:02.300`, `5s`, `2m`, etc.).
- Supports batch processing using glob patterns (`"*.mp4"`).
- Automatically discovers FFmpeg: explicit path, `DUKATOOLS_FFMPEG`, bundled `imageio-ffmpeg`, or system PATH.
- Provides a `--doctor` command to inspect and pre-download the FFmpeg binary.
- Adds MP4-friendly flags such as `+faststart` for streaming-optimized outputs.
**Usage**
```bash
vidcut INPUT [INPUT ...] \
[--out OUTPUT.mp4] \
[--suffix _cut] \
[--from START] [--to END] [--duration DURATION] \
[--trim-start SECONDS] [--trim-end SECONDS] \
[--accurate | --fast] \
[--overwrite] [--dry-run] [--ffmpeg PATH] [--doctor]
```
**Common scenarios**
```bash
# Keep a 12 second clip (fast copy mode)
vidcut clip.mp4 --from 00:00:05 --duration 12s --overwrite
# Batch trim all MOV files, append suffix, and overwrite existing clips
vidcut "videos/*.mov" --trim-start 3s --suffix _trimmed --overwrite
# Force frame-accurate cutting
vidcut input.mp4 --from 1m --duration 5s --accurate --overwrite
# Preview the ffmpeg command without running it
vidcut input.mp4 --from 10s --duration 15s --dry-run
# Ensure FFmpeg is available (downloads via imageio-ffmpeg if needed)
vidcut --doctor
```
### pydown — grab python-build-standalone releases
`pydown` automates downloading python-build-standalone artifacts from GitHub, selecting the right CPU/OS triplet and variant, and optionally extracting the archive for you.
**Highlights**
- Detects the correct `python-build-standalone` triplet for Linux (glibc/musl), macOS, and Windows hosts, with manual overrides when you need them.
- Supports picking variants (`install_only_stripped`, `install_only`, `full`, `debug`) and specific Python versions.
- Can extract archives in place and create helpful shims to add the installed Python to your PATH.
- Works with anonymous GitHub access or an optional `GITHUB_TOKEN` for higher rate limits.
**Usage**
```bash
pydown --dest PATH \
[--version 3.12.6] \
[--variant install_only_stripped] \
[--extract] \
[--triplet aarch64-apple-darwin]
```
**Common scenarios**
```bash
# Download the latest CPython build for your platform and extract it
pydown --dest ~/python-builds --extract
# Grab Python 3.12.6 and unpack it into a versioned directory
pydown --dest ./pbs --version 3.12.6 --extract
# Override the platform triplet (useful for cross-deployment scripting)
pydown --dest ./artifacts --triplet x86_64-unknown-linux-gnu
```
## Configuration & environment variables
- `DUKATOOLS_FFMPEG` — absolute path to an FFmpeg binary. Overrides auto-detection for `vidcut`.
- Standard locale and encoding settings (e.g., `LANG`, `LC_ALL`) influence how output is rendered in your terminal.
## Development
Interested in hacking on `dukatools`? Clone the repository and install local dependencies with your preferred workflow. A concise developer walkthrough lives in [DEV.md](DEV.md), covering how to add new CLI tools, build wheels, and publish releases.
## License
`dukatools` is released under the MIT License. See [LICENSE](LICENSE) for the full text.
Raw data
{
"_id": null,
"home_page": null,
"name": "dukatools",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "cli, utilities, filesystem, tree",
"author": "rexologue",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/51/8e/25991843ef6803022360b31e4f65ec78752dfe183dbac844813bb022dbf9/dukatools-0.3.0.tar.gz",
"platform": null,
"description": "# dukatools\n\n> A small, batteries-included command line toolbox for working with directories and media across Linux, macOS, and Windows.\n\n## Table of contents\n- [Features at a glance](#features-at-a-glance)\n- [Installation](#installation)\n- [Upgrading](#upgrading)\n- [Quick start](#quick-start)\n- [CLI utilities](#cli-utilities)\n - [treex \u2014 directory trees with excludes](#treex--directory-trees-with-excludes)\n - [dirproc \u2014 batch dump directory files](#dirproc--batch-dump-directory-files)\n - [vidcut \u2014 fast and accurate video trimming](#vidcut--fast-and-accurate-video-trimming)\n - [pydown \u2014 grab python-build-standalone releases](#pydown--grab-python-build-standalone-releases)\n- [Configuration & environment variables](#configuration--environment-variables)\n- [Development](#development)\n- [License](#license)\n\n## Features at a glance\n- **Cross-platform binaries** via `uv tool`, `pipx`, or `pip` \u2014 no manual PATH setup required.\n- **Tree inspection with smart excludes** through `treex`, ideal for sharing repository structure without build artifacts.\n- **Directory dumping** with on-the-fly encoding detection (`dirproc`) for audits, backups, and quick reviews.\n- **FFmpeg-powered video trimming** (`vidcut`) with automatic fallback from stream-copy to frame-accurate cuts.\n- **One-file Python downloads** (`pydown`) for fetching and unpacking python-build-standalone releases without manual API spelunking.\n- **Zero-config defaults** plus optional environment overrides when you need extra control.\n\n## Installation\n`dukatools` is distributed as a standard Python package targeting Python 3.8+.\n\n### Using [uv](https://docs.astral.sh/uv/)\n```bash\nuv tool install dukatools\n```\n\n### Using [pipx](https://pipx.pypa.io/)\n```bash\npipx install dukatools\n```\n\n### Using pip\n```bash\npython -m pip install --user dukatools\n```\n\nAll installation methods place the `treex`, `dirproc`, `vidcut`, and `pydown` entry points on your PATH.\n\n## Upgrading\nStay current with the latest enhancements and fixes:\n\n```bash\nuv tool upgrade dukatools\n# or\npipx upgrade dukatools\n# or\npython -m pip install --upgrade dukatools\n```\n\n## Quick start\n```bash\n# Explore a repository without build artifacts\n$ treex --path . --exclude .git --exclude-pattern \"*.pyc\" \"build\"\n\n# Dump every text file in a directory into stdout (recursively)\n$ dirproc ./notes --exclude-pattern \"^archive/\"\n\n# Trim the first five seconds off a video without re-encoding\n$ vidcut sample.mp4 --trim-start 5s --overwrite\n\n# Download and extract a python-build-standalone release into ~/python-builds\n$ pydown --dest ~/python-builds --version 3.12 --extract\n```\n\n## CLI utilities\n\n### treex \u2014 directory trees with excludes\n`treex` renders a directory structure in a friendly tree format while supporting both exact-name excludes and glob patterns.\n\n**Highlights**\n- Exclude generated folders such as `__pycache__`, `build`, or `node_modules` with a single command.\n- Handles deeply nested projects and gracefully reports permission errors.\n- Works great for quickly sharing repository layouts in issues, documentation, or chats.\n\n**Usage**\n```bash\ntreex --path PATH \\\n [--exclude NAME ...] \\\n [--exclude-pattern GLOB ...]\n```\n\n**Example output**\n```\nDirectory tree for: ./project\nExcluded patterns: *.pyc\n\u251c\u2500\u2500 pyproject.toml\n\u251c\u2500\u2500 README.md\n\u2514\u2500\u2500 src\n \u251c\u2500\u2500 __init__.py\n \u2514\u2500\u2500 project\n \u2514\u2500\u2500 core.py\n```\n\n### dirproc \u2014 batch dump directory files\n`dirproc` walks a directory, opening each text file, detecting its encoding (via `chardet`), and streaming the content either to stdout or to a UTF-8 file you specify.\n\n**Highlights**\n- Recursive by default, with `--non-recursive` available for shallow inspections.\n- Combine `--exclude-name` and `--exclude-pattern` (regex) to skip sensitive or noisy paths.\n- Emits friendly messages when files are unreadable, including the error reason.\n- Perfect for quickly packaging logs, notes, or configuration snapshots for debugging.\n\n**Usage**\n```bash\ndirproc ROOT_DIR \\\n [--output-file OUTPUT.txt] \\\n [--non-recursive] \\\n [--exclude-name NAME ...] \\\n [--exclude-pattern REGEX ...]\n```\n\n**Writing to a file**\n```bash\ndirproc ./config --output-file artifacts/config-dump.txt --exclude-pattern \"\\.git/\"\n```\n\n### vidcut \u2014 fast and accurate video trimming\n`vidcut` wraps FFmpeg and provides a friendly interface for clipping one or more video files. It prefers stream-copy (no re-encode) for speed, then transparently falls back to a frame-accurate re-encode when necessary.\n\n**Highlights**\n- Accepts flexible time formats (`90`, `45.5`, `00:01:02.300`, `5s`, `2m`, etc.).\n- Supports batch processing using glob patterns (`\"*.mp4\"`).\n- Automatically discovers FFmpeg: explicit path, `DUKATOOLS_FFMPEG`, bundled `imageio-ffmpeg`, or system PATH.\n- Provides a `--doctor` command to inspect and pre-download the FFmpeg binary.\n- Adds MP4-friendly flags such as `+faststart` for streaming-optimized outputs.\n\n**Usage**\n```bash\nvidcut INPUT [INPUT ...] \\\n [--out OUTPUT.mp4] \\\n [--suffix _cut] \\\n [--from START] [--to END] [--duration DURATION] \\\n [--trim-start SECONDS] [--trim-end SECONDS] \\\n [--accurate | --fast] \\\n [--overwrite] [--dry-run] [--ffmpeg PATH] [--doctor]\n```\n\n**Common scenarios**\n```bash\n# Keep a 12 second clip (fast copy mode)\nvidcut clip.mp4 --from 00:00:05 --duration 12s --overwrite\n\n# Batch trim all MOV files, append suffix, and overwrite existing clips\nvidcut \"videos/*.mov\" --trim-start 3s --suffix _trimmed --overwrite\n\n# Force frame-accurate cutting\nvidcut input.mp4 --from 1m --duration 5s --accurate --overwrite\n\n# Preview the ffmpeg command without running it\nvidcut input.mp4 --from 10s --duration 15s --dry-run\n\n# Ensure FFmpeg is available (downloads via imageio-ffmpeg if needed)\nvidcut --doctor\n```\n\n### pydown \u2014 grab python-build-standalone releases\n`pydown` automates downloading python-build-standalone artifacts from GitHub, selecting the right CPU/OS triplet and variant, and optionally extracting the archive for you.\n\n**Highlights**\n- Detects the correct `python-build-standalone` triplet for Linux (glibc/musl), macOS, and Windows hosts, with manual overrides when you need them.\n- Supports picking variants (`install_only_stripped`, `install_only`, `full`, `debug`) and specific Python versions.\n- Can extract archives in place and create helpful shims to add the installed Python to your PATH.\n- Works with anonymous GitHub access or an optional `GITHUB_TOKEN` for higher rate limits.\n\n**Usage**\n```bash\npydown --dest PATH \\\n [--version 3.12.6] \\\n [--variant install_only_stripped] \\\n [--extract] \\\n [--triplet aarch64-apple-darwin]\n```\n\n**Common scenarios**\n```bash\n# Download the latest CPython build for your platform and extract it\npydown --dest ~/python-builds --extract\n\n# Grab Python 3.12.6 and unpack it into a versioned directory\npydown --dest ./pbs --version 3.12.6 --extract\n\n# Override the platform triplet (useful for cross-deployment scripting)\npydown --dest ./artifacts --triplet x86_64-unknown-linux-gnu\n```\n\n## Configuration & environment variables\n- `DUKATOOLS_FFMPEG` \u2014 absolute path to an FFmpeg binary. Overrides auto-detection for `vidcut`.\n- Standard locale and encoding settings (e.g., `LANG`, `LC_ALL`) influence how output is rendered in your terminal.\n\n## Development\nInterested in hacking on `dukatools`? Clone the repository and install local dependencies with your preferred workflow. A concise developer walkthrough lives in [DEV.md](DEV.md), covering how to add new CLI tools, build wheels, and publish releases.\n\n## License\n`dukatools` is released under the MIT License. See [LICENSE](LICENSE) for the full text.\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Small cross-platform CLI toolbelt: treex, dirproc, and more.",
"version": "0.3.0",
"project_urls": {
"Bug Tracker": "https://github.com/rexologue/dukatools/issues",
"Homepage": "https://github.com/rexologue/dukatools",
"Repository": "https://github.com/rexologue/dukatools"
},
"split_keywords": [
"cli",
" utilities",
" filesystem",
" tree"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "18ba4b91639bb44a2ca290dcc9fa9067fe5666906081b980be1536b9aa04c785",
"md5": "c7f4eabde84c1757a8da63053eabd949",
"sha256": "f9a7913a9393ecad53ede206f85de0d277ec3ec9518595ca046f0c6180efcdd9"
},
"downloads": -1,
"filename": "dukatools-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c7f4eabde84c1757a8da63053eabd949",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 15338,
"upload_time": "2025-10-19T16:47:28",
"upload_time_iso_8601": "2025-10-19T16:47:28.290778Z",
"url": "https://files.pythonhosted.org/packages/18/ba/4b91639bb44a2ca290dcc9fa9067fe5666906081b980be1536b9aa04c785/dukatools-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "518e25991843ef6803022360b31e4f65ec78752dfe183dbac844813bb022dbf9",
"md5": "7a51d92de55d0ad88a79469beac4b3c4",
"sha256": "defa58f75ceaaaf481d572161391d9f1ea39274379e2ec4624b80f88d3988725"
},
"downloads": -1,
"filename": "dukatools-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "7a51d92de55d0ad88a79469beac4b3c4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 15760,
"upload_time": "2025-10-19T16:47:29",
"upload_time_iso_8601": "2025-10-19T16:47:29.805470Z",
"url": "https://files.pythonhosted.org/packages/51/8e/25991843ef6803022360b31e4f65ec78752dfe183dbac844813bb022dbf9/dukatools-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-19 16:47:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rexologue",
"github_project": "dukatools",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "dukatools"
}