freezedry


Namefreezedry JSON
Version 0.0.6 PyPI version JSON
download
home_pageNone
SummaryA simple package to save a compressed directory
upload_time2025-01-06 11:54:14
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT
keywords compress compression python code
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # freezedry
A simple method to store a compressed copy of a code repository with customizable filtering of files.

[![PyPI version](https://badge.fury.io/py/freezedry.svg)](https://badge.fury.io/py/freezedry)
[![Documentation Status](https://readthedocs.org/projects/freezedry/badge/?version=latest)](https://freezedry.readthedocs.io/en/latest/?badge=latest)
[![Python Versions](https://img.shields.io/pypi/pyversions/freezedry.svg)](https://pypi.org/project/freezedry/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Tests](https://github.com/landoskape/freezedry/actions/workflows/tests.yml/badge.svg)](https://github.com/landoskape/freezedry/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/landoskape/freezedry/branch/main/graph/badge.svg)](https://codecov.io/gh/landoskape/freezedry)

[Full Documentation](https://freezedry.readthedocs.io/) | [GitHub](https://github.com/landoskape/freezedry) | [PyPI](https://pypi.org/project/freezedry/)

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](https://github.com/mherrmann))
for the useful [gitignore_parser](https://github.com/mherrmann/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``. 

```python
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)
```

In addition, you can specify which files to ignore in two other ways:

1. Direct match strings with ``extra_ignore``. This is a list of strings, and if any string in
the list is contained in a file, that file will be ignored. For example, if 
``extra_ignore=['hi', 'world']`` then ``'../hi/test.py'`` and ``'../myworld.py'`` will be ignored.

2. Regular expression strings with ``regexp_ignore``. This is a list of strings used as regular
expressions. The rules are similar to ``extra_ignore``, except that it uses the ``re.search`` 
method to find matches. 

### Setting the .gitignore
If ``.gitignore`` is not provided, then ``freezedry`` will look for it (non-recursively) in 
``directory_path``. Alternatively, you can provide a ``.gitignore`` directly with the optional
argument ``gitignore_path``. Note that you _always_ have to set ``use_gitignore=True`` regardless
of whether you provided a ``gitignore_path``. 

For example:
```python
from freezedry import freezedry
directory_path = '/..dirs../GitHub/your_repo'
output_path = '/..dirs../results'
gitignore_path = '/..dirs../GitHub/my_other_repo/.gitignore'
freezedry(directory_path, 
          output_path=output_path, 
          ignore_git=True, 
          use_gitignore=True, # if False, won't use gitignore_path even if provided!!! 
          gitignore_path=gitignore_path, 
          verbose=True)
```

## Documentation
For full documentation, check it out [here](https://freezedry.readthedocs.io/). You'll find a complete
API reference and more examples of how to use freezedry. 

## 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. 

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "freezedry",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "compress, compression, python code",
    "author": null,
    "author_email": "Andrew Landau <andrew+tyler+landau+getridofthisanddtheplusses@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/28/78/2f878b3ceb942e05498ae3adff7227adfc0d642d0c0bd7070834463fb038/freezedry-0.0.6.tar.gz",
    "platform": null,
    "description": "# freezedry\nA simple method to store a compressed copy of a code repository with customizable filtering of files.\n\n[![PyPI version](https://badge.fury.io/py/freezedry.svg)](https://badge.fury.io/py/freezedry)\n[![Documentation Status](https://readthedocs.org/projects/freezedry/badge/?version=latest)](https://freezedry.readthedocs.io/en/latest/?badge=latest)\n[![Python Versions](https://img.shields.io/pypi/pyversions/freezedry.svg)](https://pypi.org/project/freezedry/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Tests](https://github.com/landoskape/freezedry/actions/workflows/tests.yml/badge.svg)](https://github.com/landoskape/freezedry/actions/workflows/tests.yml)\n[![codecov](https://codecov.io/gh/landoskape/freezedry/branch/main/graph/badge.svg)](https://codecov.io/gh/landoskape/freezedry)\n\n[Full Documentation](https://freezedry.readthedocs.io/) | [GitHub](https://github.com/landoskape/freezedry) | [PyPI](https://pypi.org/project/freezedry/)\n\nDo you ever wish you knew exactly which version of code you used when you made a figure, ran a job\non a HPC cluster, or anything else? Freezedry is the solution! \n\nWith freezedry, you can easily save a compressed copy of an entire file directory that is designed\nto focus on _code_. Freezedry is a very simple package-- it only has one method you need to use\n(``freezedry``) that takes as input a path to a directory and a path to an output file, along with\na few customizable optional input arguments. \n\nWhat does freezedry include? Everything, if you don't specify. However, it's very easy to ignore:\n- git related files (i.e. anything with the pattern ``.git`` in the file path)\n- anything specified in a ``.gitignore`` file (thank you to [Michael Herrmann](https://github.com/mherrmann))\nfor the useful [gitignore_parser](https://github.com/mherrmann/gitignore_parser) package.\n- anything else you want (including exact string matches and regular expressions).\n\n## Installation\nIt's on PyPI. If there's any issues, please raise one on this GitHub repo to let me know.\n```\npip install freezedry\n```\n\n## Usage\nSuppose that ``/..dirs../GitHub/your_repo`` contains some code you've been working on. And say you\nuse the code in ``your_repo`` to do some analyses that are saved to ``/..dirs../results``. Then,\nthe following block of code will save a copy of your repo to the ``/results`` directory, ignoring\nany ``.git`` related files and ignoring anything in your ``.gitignore``. \n\n```python\nfrom freezedry import freezedry\ndirectory_path = '/..dirs../GitHub/your_repo'\noutput_path = '/..dirs../results'\nfreezedry(directory_path, \n          output_path=output_path, \n          ignore_git=True, \n          use_gitignore=True, \n          verbose=True)\n```\n\nIn addition, you can specify which files to ignore in two other ways:\n\n1. Direct match strings with ``extra_ignore``. This is a list of strings, and if any string in\nthe list is contained in a file, that file will be ignored. For example, if \n``extra_ignore=['hi', 'world']`` then ``'../hi/test.py'`` and ``'../myworld.py'`` will be ignored.\n\n2. Regular expression strings with ``regexp_ignore``. This is a list of strings used as regular\nexpressions. The rules are similar to ``extra_ignore``, except that it uses the ``re.search`` \nmethod to find matches. \n\n### Setting the .gitignore\nIf ``.gitignore`` is not provided, then ``freezedry`` will look for it (non-recursively) in \n``directory_path``. Alternatively, you can provide a ``.gitignore`` directly with the optional\nargument ``gitignore_path``. Note that you _always_ have to set ``use_gitignore=True`` regardless\nof whether you provided a ``gitignore_path``. \n\nFor example:\n```python\nfrom freezedry import freezedry\ndirectory_path = '/..dirs../GitHub/your_repo'\noutput_path = '/..dirs../results'\ngitignore_path = '/..dirs../GitHub/my_other_repo/.gitignore'\nfreezedry(directory_path, \n          output_path=output_path, \n          ignore_git=True, \n          use_gitignore=True, # if False, won't use gitignore_path even if provided!!! \n          gitignore_path=gitignore_path, \n          verbose=True)\n```\n\n## Documentation\nFor full documentation, check it out [here](https://freezedry.readthedocs.io/). You'll find a complete\nAPI reference and more examples of how to use freezedry. \n\n## Contributing\nI'm happy to take issues or pull requests, let me know if you have any ideas on how to make this\nbetter or requests for fixes. \n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple package to save a compressed directory",
    "version": "0.0.6",
    "project_urls": {
        "Documentation": "https://freezedry.readthedocs.io/en/stable/",
        "Homepage": "https://github.com/landoskape/freezedry"
    },
    "split_keywords": [
        "compress",
        " compression",
        " python code"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "defc7dc6e1da0bb729bc7f1865312fc925f17cd6da14bd586d7340b4a6df3a20",
                "md5": "597278f83a64bb154350840f9482c4e2",
                "sha256": "6b22e9f5de25b492312a88bdd8f6c555e9f7eb3f6d2f828487bf7a1b3c614ba5"
            },
            "downloads": -1,
            "filename": "freezedry-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "597278f83a64bb154350840f9482c4e2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3691,
            "upload_time": "2025-01-06T11:54:11",
            "upload_time_iso_8601": "2025-01-06T11:54:11.997311Z",
            "url": "https://files.pythonhosted.org/packages/de/fc/7dc6e1da0bb729bc7f1865312fc925f17cd6da14bd586d7340b4a6df3a20/freezedry-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "28782f878b3ceb942e05498ae3adff7227adfc0d642d0c0bd7070834463fb038",
                "md5": "34a7891f69d61f2dadfd1fe0201903ec",
                "sha256": "db652197ea10626f4e23298e8d715596a937f8757b06e09c84492e39df46cdb6"
            },
            "downloads": -1,
            "filename": "freezedry-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "34a7891f69d61f2dadfd1fe0201903ec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4706,
            "upload_time": "2025-01-06T11:54:14",
            "upload_time_iso_8601": "2025-01-06T11:54:14.741374Z",
            "url": "https://files.pythonhosted.org/packages/28/78/2f878b3ceb942e05498ae3adff7227adfc0d642d0c0bd7070834463fb038/freezedry-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-06 11:54:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "landoskape",
    "github_project": "freezedry",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "freezedry"
}
        
Elapsed time: 0.36001s