Skip to main content

Script to intelligently extract multiple archive types

Project description

GitHub PyPI version PyPI pyversions GitHub Workflow Status

dtrx

"Do The Right eXtraction" - don't remember what set of tar flags or where to pipe the output to extract it? no worries!

TL;DR

pip install dtrx

dtrx yolo.tar.gz

This is a copy-paste of the original dtrx repo, and all credit for this software should be attributed to the original author, Brett Smith @brettcs:

https://github.com/brettcs/dtrx

See the original README for more details on what this does!

Changes in this repo

This repo contains some patches on top of the original source to enable using dtrx with python3. The original motivation was to enable dtrx on Ubuntu 20.04+, where the dtrx apt package was removed from the default ppas (likely due to being python2 only).

I attempted to get the tests all working via tox , for which I used a Dockerfile to try to get some kind of environment consistency. You can run the tests by running (requires Docker installed):

./test.sh

Development

Contributions

Contributions are gladly welcomed! Feel free to open a Pull Request with any changes.

Issues

When posting an issue, it can be very handy to provide any example files (for example, the archive that failed to extract) or reproduction steps so we can address the problem quickly.

Releases

Releases are tagged in this repo and published to pypi.org. The release process for maintainers is the below steps:

  1. update the version specifier:

    # update the VERSION value in dtrx/dtrx.py, then:
    ❯ git add dtrx/dtrx.py
    ❯ git commit  # fill in the commit message
    
  2. create an annotated tag for the release. usually good to put a list of new commits since the previous tag, for example by listing them with:

    ❯ git log $(git describe --tags --abbrev=0)..HEAD --oneline
    # create the annotated tag
    ❯ git tag -a <version number>
    

    be sure to push the tag, git push --tags.

  3. use the make publish-release command to build and publish to GitHub and PyPi

See the Makefile for details on what that rule does.

Tests

There is a suite of tests that can be run either on the local python environment, or across all the supported python environments via docker:

# run the suite from the current python environment
pip install pyyaml  # test dependency
python tests/compare.py

# run the tests in docker across all supported python versions (takes a while)
./test.sh

# run the tests in docker on one python version
RUN_JOB=quick-test ./test.sh

Linting

Linting is provided by pre-commit. To use it, first install the pre-commit hook:

pip install pre-commit
pre-commit install

pre-commit will run anytime git commit runs (disable with --no-verify). You can manually run it with pre-commit run.

It's also run in CI.

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

dtrx-8.3.1.tar.gz (32.5 kB view hashes)

Uploaded source

Built Distribution

dtrx-8.3.1-py2.py3-none-any.whl (30.8 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page