A simple package to save a compressed directory.
Project description
freezedry
A simple method to store a compressed copy of a code repository with customizable filtering of files.
Do you ever wish you knew exactly which version of code you used when you made a figure, ran a job on a HPC cluster, or anything else? Freezedry is the solution!
With freezedry, you can easily save a compressed copy of an entire file directory that is designed
to focus on code. Freezedry is a very simple package-- it only has one method you need to use
(freezedry
) that takes as input a path to a directory and a path to an output file, along with
a few customizable optional input arguments.
What does freezedry include? Everything, if you don't specify. However, it's very easy to ignore:
- git related files (i.e. anything with the pattern
.git
in the file path) - anything specified in a
.gitignore
file (thank you to Michael Herrmann) for the useful gitignore_parser package. - anything else you want (including exact string matches and regular expressions).
Installation
It's on PyPI. If there's any issues, please raise one on this GitHub repo to let me know.
pip install freezedry
Usage
Suppose that /..dirs../GitHub/your_repo
contains some code you've been working on. And say you
use the code in your_repo
to do some analyses that are saved to /..dirs../results
. Then,
the following block of code will save a copy of your repo to the /results
directory, ignoring
any .git
related files and ignoring anything in your .gitignore
.
from freezedry import freezedry
directory_path = '/..dirs../GitHub/your_repo'
output_path = '/..dirs../results'
freezedry(directory_path, output_path=output_path, ignore_git=True, use_gitignore=True, verbose=True)
Contributing
I'm happy to take issues or pull requests, let me know if you have any ideas on how to make this better or requests for fixes.
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
Built Distribution
Hashes for freezedry-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ddffe9dd82aa4a01b218e6a9d16bad2429b3be8fc7f69afa0371b09b1b887ce |
|
MD5 | ccca67451c46bbd7a0faca0434b8ce28 |
|
BLAKE2b-256 | a90141ee28694c099a8b1e2e22c322b3a362939cb29062d47b2f8a7abe693e8e |