Skip to main content

Compare directory trees and output unified diff

Project description

PyPI PyPI - License Documentation Tests Run on Ubuntu Python Versions Tests Run on Macos Python Versions Tests Run on Windows Python Versions Github Repo

treecomp

Overview

A CLI and Python API to recursively compare directory trees and output a unified diff. Supports ignoring and targeting file and folder patterns with .gitignore-style syntax. Plays well with other tools: pipe output to dunk for pretty diffs and use -f json to output to JSON for use with jq and other tools.

Getting Started

The recommended way to install treecomp is with pipx, though it can also be installed with pip.

pipx install flexlate

Or, if you don't have/don't want to install pipx:

pip install flexlate

The unidiff output from this tool is best viewed using dunk, which can also be installed via pipx/pip.

pipx install dunk

Compare two file trees recursively and output unified diffs.

treecomp my_folder_1 my_folder_2 | dunk

It supports ignoring and targeting patterns with .gitignore-style syntax. It also has a strongly-typed Python API.

See examples in the documentation.

Development Status

This project is currently in early-stage development. There may be breaking changes often. While the major version is 0, minor version upgrades will often have breaking changes.

Developing

First ensure that you have pipx installed, if not, install it with pip install pipx.

Then clone the repo and run npm install and pipenv sync. Run pipenv shell to use the virtual environment. Make your changes and then run nox to run formatting, linting, and tests.

Develop documentation by running nox -s docs to start up a dev server.

To run tests only, run nox -s test. You can pass additional arguments to pytest by adding them after --, e.g. nox -s test -- -k test_something.

Author

Created by Nick DeRobertis. MIT License.

Links

See the documentation here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

treecomp-1.0.0.tar.gz (12.1 kB view hashes)

Uploaded Source

Built Distribution

treecomp-1.0.0-py3-none-any.whl (11.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page