Python CLI commands for data manipulation and file operations.
All commands are namespaced to ds so there should be little to no clashing with any existing commands in your local shell environment.
Note: This project is still in development. The tested executable is currently a batch file (ds.bat) for Windows.
To create a ds executable, use PyInstaller with the provided spec file:
pyinstaller ds.specThis will create a build directory, update ds.spec, and generate the executable in the dist directory. Add the executable from dist to your PATH.
Alternatively, for development, you can use the ds.bat wrapper (Windows) or create a similar shell script for Unix systems that calls python ds.py with the current directory as the first argument.
The executable automatically uses the current directory as the working context.
Install dev dependencies (including pytest), then run the suite from the repository root:
pip install -r requirements.txt
python -m pytestRun a single file, for example: python -m pytest tests/test_power.py.
Run ds <command> where <command> is one of the available commands below. The current directory is automatically used as the working context.
To list all available commands, run:
ds commandsor equivalently:
ds --helpTo include incomplete stub commands in the listing:
ds commands --allYou can also get detailed help for a specific command with:
ds <command> --helpds move <source> <target> [--filter]- Move files or directories with optional filteringds copy <source> <target> [--filter]- Copy files or directories with optional filteringds dup_files <dirpath>- Identify and remove duplicate files
ds join <file1> [file2]- Join data filesds transpose [filepath]- Transpose tabular datads index [filepath]- Print lines indexedds field_counts [file]- Count fields in datads inferfs [filepath]- Infer field separator from datads case <tocase> [text]- Convert text caseds matches <file1> <file2> [--key] [--fs]- Get matching records between two filesds power <file> [--min] [--choose]- Combinatorial frequency analysis of field valuesds random [mode] [text]- Generate a random number or randomize textds unicode [conversion]- Convert UTF-8 unicode representations from stdin
ds git_status [base_dir] [--track-non-repos]- Show git status for all repos under a directoryds git_branch [base_dir]- List branches for all local git reposds git_purge_local <base_dir> <branches...>- Purge branches from local repos (WIP)
ds conda_check <packages...>- Check which conda environments have given packagesds conda_envs [--json] [--sort]- List conda environments with details
ds kill_port <port> [--force] [--dry-run]- Kill all processes bound to a port
ds graph [--print-bases]- Extract graph relationships from DAG data (stdin)ds stagger <filepath> [--stag-size]- Print tabular data in staggered rowsds pivot <file> -y <keys> -x <keys>- Pivot tabular datads hist- Print histograms for numeric fields (stdin)
ds agg- Aggregate field-based text datads asgn- Print lines matching assignment pattern
Stubs (hidden from ds commands by default — use ds commands --all)
These commands are wired up but their Python ports are incomplete. They are tagged [STUB] and hidden from the default command listing.
ds diff_fields <file1> <file2> <op>- Elementwise diff of two datasetsds fit- Fit fielded data in columns with dynamic widthds reo- Reorder, repeat, or slice data by rows and columnsds sortm- Sort with inferred multi-char field separatords subsep <filepath> <pattern>- Extend fields by a common sub-separatords inferh- Infer if headers are present in a file (still AWK)ds cardinality <filepath>- Calculate distinct values per fieldds prod <files...>- Cartesian product of lines from multiple filesds shape- Print data shape by length or pattern (stdin)ds field_uniques [fields]- Get unique values from fields (stdin)ds enti <filepath>- Print text entities separated by a pattern
To report bugs please contact: tomhall.main@gmail.com