=========
zip-files
=========
.. image:: https://img.shields.io/badge/github-goerz/zip__files-blue.svg
:alt: Source code on Github
:target: https://github.com/goerz/zip_files
.. image:: https://img.shields.io/pypi/v/zip_files.svg
:alt: zip-files on the Python Package Index
:target: https://pypi.python.org/pypi/zip_files
.. image:: https://img.shields.io/travis/goerz/zip_files.svg
:alt: Travis Continuous Integration
:target: https://travis-ci.org/goerz/zip_files
.. image:: https://ci.appveyor.com/api/projects/status/k2lqxw97gv2m9gpm/branch/master?svg=true
:alt: AppVeyor Continuous Integration
:target: https://ci.appveyor.com/project/goerz/zip-files
.. image:: https://img.shields.io/coveralls/github/goerz/zip_files/master.svg
:alt: Coveralls
:target: https://coveralls.io/github/goerz/zip_files?branch=master
.. image:: https://img.shields.io/badge/License-BSD-green.svg
:alt: BSD License
:target: https://opensource.org/licenses/BSD-3-Clause
Command line utilities for creating zip files.
Provides the ``zip-files`` and ``zip-folder`` command line utilities. These are
intended as an easy platform-independent tool to create zip files with
an arbitrary file name and an arbitrary root (the top-level folder after
extracting a zip) from files and folders at arbitrary locations on the file
system.
Typical usage includes:
* Deploy zip archives of Sphinx-documentation while releasing Python packages:
.. code-block:: shell
zip-folder --auto-root --outfile docs/_build/artifacts/mypackage-v1.0.0.zip docs/_build/html
creates a file ``mypackage-v1.0.0.zip`` in ``docs/_build/artifacts`` that
unzips as a folder ``mypackage-v1.0.0`` containing the files originally in
``docs/_build/html/``.
* Create zip files pulled together from different locations, for emailing:
.. code-block:: shell
zip-files -a -o report.zip ./report2020-01.tex /scratch/project/plots/*.pdf
creates a file ``report.zip`` that unzips as a folder
``report`` containing the file ``report2020-01.tex`` and all the pdf files
originally in ``/scratch/project/plots/``.
.. code-block:: shell
zip-files -f report2020-01 -o report.zip ./report2020-01.tex /scratch/project/plots/*.pdf
does the same, but unzips as a folder ``report2020-01`` instead of ``report``.
Development of zip-files happens on `Github`_.
Installation
------------
To install the latest released version of zip-files, run this command in your terminal:
.. code-block:: shell
pip install zip_files
This is the preferred method to install zip-files, as it will always install
the most recent stable release. It will result in the executable commands
``zip-files`` and ``zip-folder`` being added to your environment's ``bin``
folder.
.. _Github: https://github.com/goerz/zip_files
Usage
-----
zip-files
~~~~~~~~~
.. code-block:: console
Usage: zip-files [OPTIONS] [FILES]...
Create a zip file containing FILES.
Options:
-h, --help Show this message and exit.
--version Show the version and exit.
--debug Activate debug logging.
-f, --root-folder ROOT_FOLDER Folder name to prepend to FILES inside the
zip file.
-c, --compression [stored|deflated|bzip2|lzma]
Zip compression method. The following
methods are available: "stored": no
compression; "deflated": the standard zip
compression method; "bzip2": BZIP2
compression method (part of the zip standard
since 2001); "lzma": LZMA compression method
(part of the zip standard since 2006).
[default: deflated]
-a, --auto-root If given in combination with --outfile, use
the stem of the OUTFILE (without path and
extension) as the value for ROOT_FOLDER
-x, --exclude GLOB_PATTERN Glob-pattern to exclude. This is matched
from the right against all paths in the zip
file, see Python pathlib's Path.match
method. This option can be given multiple
times.
-X, --exclude-from FILE File from which to read a list of glob-
patterns to exclude, cf. --exclude. Each
line in FILE is one pattern. This option can
be given multiple times.
--exclude-dotfiles / --include-dotfiles
Whether or not to include dotfiles in the
zip files. By default, dotfiles are
included.
--exclude-vcs / --include-vcs Whether or not to include files and
directories commonly used by version control
systems. (Git, CVS, RCS, SCCS, SVN, Arch,
Bazaar, Mercurial, and Darcs), e.g.
'.git/', '.gitignore' '.gitmodules'
'.gitattributes' for Git. By default, VCS
are included.
--exclude-git-ignores / --include-git-ignores
Whether or not to look for .gitignore files
and to process them for exclude patterns.
Note that the .gitignore file itself is
still included in the zip archive unless
--exclude-vcs is given. By default,
.gitignore files are not processed.
-o, --outfile OUTFILE The path of the zip file to be written. By
default, the file is written to stdout.
zip-folder
~~~~~~~~~~
.. code-block:: console
Usage: zip-folder [OPTIONS] FOLDER
Create a zip file containing the FOLDER.
Options:
-h, --help Show this message and exit.
--version Show the version and exit.
--debug Activate debug logging.
-f, --root-folder ROOT_FOLDER Folder name to use as the top level folder
inside the zip file (replacing FOLDER).
-c, --compression [stored|deflated|bzip2|lzma]
Zip compression method. The following
methods are available: "stored": no
compression; "deflated": the standard zip
compression method; "bzip2": BZIP2
compression method (part of the zip standard
since 2001); "lzma": LZMA compression method
(part of the zip standard since 2006).
[default: deflated]
-a, --auto-root If given in combination with --outfile, use
the stem of the OUTFILE (without path and
extension) as the value for ROOT_FOLDER
-x, --exclude GLOB_PATTERN Glob-pattern to exclude. This is matched
from the right against all paths in the zip
file, see Python pathlib's Path.match
method. This option can be given multiple
times.
-X, --exclude-from FILE File from which to read a list of glob-
patterns to exclude, cf. --exclude. Each
line in FILE is one pattern. This option can
be given multiple times.
--exclude-dotfiles / --include-dotfiles
Whether or not to include dotfiles in the
zip files. By default, dotfiles are
included.
--exclude-vcs / --include-vcs Whether or not to include files and
directories commonly used by version control
systems. (Git, CVS, RCS, SCCS, SVN, Arch,
Bazaar, Mercurial, and Darcs), e.g.
'.git/', '.gitignore' '.gitmodules'
'.gitattributes' for Git. By default, VCS
are included.
--exclude-git-ignores / --include-git-ignores
Whether or not to look for .gitignore files
and to process them for exclude patterns.
Note that the .gitignore file itself is
still included in the zip archive unless
--exclude-vcs is given. By default,
.gitignore files are not processed.
-o, --outfile OUTFILE The path of the zip file to be written. By
default, the file is written to stdout.
=======
History
=======
0.4.1 (2021-04-21)
------------------
* Bugfix: Permissions (especially executable permissions) were not preserved on Unix
0.4.0 (2021-04-04)
------------------
* Added: options ``--exclude-vcs``, ``--exclude-git-ignores``, and ``--exclude-vcs``
0.3.0 (2020-01-19)
------------------
* Added: option ``--exclude``
0.2.0 (2020-01-17)
------------------
* Added: option ``--auto-root``
0.1.0 (2020-01-17)
------------------
* Initial release
Raw data
{
"_id": null,
"home_page": "https://github.com/goerz/zip_files",
"name": "zip-files",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "zip",
"author": "Michael Goerz",
"author_email": "mail@michaelgoerz.net",
"download_url": "https://files.pythonhosted.org/packages/57/32/f1c1ff96aa74a664a99abf18202a36cab61d981d14d72760e5fe8344cd81/zip_files-0.4.1.tar.gz",
"platform": "",
"description": "=========\nzip-files\n=========\n\n.. image:: https://img.shields.io/badge/github-goerz/zip__files-blue.svg\n :alt: Source code on Github\n :target: https://github.com/goerz/zip_files\n\n.. image:: https://img.shields.io/pypi/v/zip_files.svg\n :alt: zip-files on the Python Package Index\n :target: https://pypi.python.org/pypi/zip_files\n\n.. image:: https://img.shields.io/travis/goerz/zip_files.svg\n :alt: Travis Continuous Integration\n :target: https://travis-ci.org/goerz/zip_files\n\n.. image:: https://ci.appveyor.com/api/projects/status/k2lqxw97gv2m9gpm/branch/master?svg=true\n :alt: AppVeyor Continuous Integration\n :target: https://ci.appveyor.com/project/goerz/zip-files\n\n.. image:: https://img.shields.io/coveralls/github/goerz/zip_files/master.svg\n :alt: Coveralls\n :target: https://coveralls.io/github/goerz/zip_files?branch=master\n\n.. image:: https://img.shields.io/badge/License-BSD-green.svg\n :alt: BSD License\n :target: https://opensource.org/licenses/BSD-3-Clause\n\nCommand line utilities for creating zip files.\n\nProvides the ``zip-files`` and ``zip-folder`` command line utilities. These are\nintended as an easy platform-independent tool to create zip files with\nan arbitrary file name and an arbitrary root (the top-level folder after\nextracting a zip) from files and folders at arbitrary locations on the file\nsystem.\n\nTypical usage includes:\n\n* Deploy zip archives of Sphinx-documentation while releasing Python packages:\n\n .. code-block:: shell\n\n zip-folder --auto-root --outfile docs/_build/artifacts/mypackage-v1.0.0.zip docs/_build/html\n\n creates a file ``mypackage-v1.0.0.zip`` in ``docs/_build/artifacts`` that\n unzips as a folder ``mypackage-v1.0.0`` containing the files originally in\n ``docs/_build/html/``.\n\n* Create zip files pulled together from different locations, for emailing:\n\n .. code-block:: shell\n\n zip-files -a -o report.zip ./report2020-01.tex /scratch/project/plots/*.pdf\n\n creates a file ``report.zip`` that unzips as a folder\n ``report`` containing the file ``report2020-01.tex`` and all the pdf files\n originally in ``/scratch/project/plots/``.\n\n .. code-block:: shell\n\n zip-files -f report2020-01 -o report.zip ./report2020-01.tex /scratch/project/plots/*.pdf\n\n does the same, but unzips as a folder ``report2020-01`` instead of ``report``.\n\n\n\nDevelopment of zip-files happens on `Github`_.\n\n\nInstallation\n------------\n\nTo install the latest released version of zip-files, run this command in your terminal:\n\n.. code-block:: shell\n\n pip install zip_files\n\nThis is the preferred method to install zip-files, as it will always install\nthe most recent stable release. It will result in the executable commands\n``zip-files`` and ``zip-folder`` being added to your environment's ``bin``\nfolder.\n\n.. _Github: https://github.com/goerz/zip_files\n\n\nUsage\n-----\n\nzip-files\n~~~~~~~~~\n\n.. code-block:: console\n\n Usage: zip-files [OPTIONS] [FILES]...\n\n Create a zip file containing FILES.\n\n Options:\n -h, --help Show this message and exit.\n --version Show the version and exit.\n --debug Activate debug logging.\n -f, --root-folder ROOT_FOLDER Folder name to prepend to FILES inside the\n zip file.\n\n -c, --compression [stored|deflated|bzip2|lzma]\n Zip compression method. The following\n methods are available: \"stored\": no\n compression; \"deflated\": the standard zip\n compression method; \"bzip2\": BZIP2\n compression method (part of the zip standard\n since 2001); \"lzma\": LZMA compression method\n (part of the zip standard since 2006).\n [default: deflated]\n\n -a, --auto-root If given in combination with --outfile, use\n the stem of the OUTFILE (without path and\n extension) as the value for ROOT_FOLDER\n\n -x, --exclude GLOB_PATTERN Glob-pattern to exclude. This is matched\n from the right against all paths in the zip\n file, see Python pathlib's Path.match\n method. This option can be given multiple\n times.\n\n -X, --exclude-from FILE File from which to read a list of glob-\n patterns to exclude, cf. --exclude. Each\n line in FILE is one pattern. This option can\n be given multiple times.\n\n --exclude-dotfiles / --include-dotfiles\n Whether or not to include dotfiles in the\n zip files. By default, dotfiles are\n included.\n\n --exclude-vcs / --include-vcs Whether or not to include files and\n directories commonly used by version control\n systems. (Git, CVS, RCS, SCCS, SVN, Arch,\n Bazaar, Mercurial, and Darcs), e.g.\n '.git/', '.gitignore' '.gitmodules'\n '.gitattributes' for Git. By default, VCS\n are included.\n\n --exclude-git-ignores / --include-git-ignores\n Whether or not to look for .gitignore files\n and to process them for exclude patterns.\n Note that the .gitignore file itself is\n still included in the zip archive unless\n --exclude-vcs is given. By default,\n .gitignore files are not processed.\n\n -o, --outfile OUTFILE The path of the zip file to be written. By\n default, the file is written to stdout.\n\nzip-folder\n~~~~~~~~~~\n\n.. code-block:: console\n\n Usage: zip-folder [OPTIONS] FOLDER\n\n Create a zip file containing the FOLDER.\n\n Options:\n -h, --help Show this message and exit.\n --version Show the version and exit.\n --debug Activate debug logging.\n -f, --root-folder ROOT_FOLDER Folder name to use as the top level folder\n inside the zip file (replacing FOLDER).\n\n -c, --compression [stored|deflated|bzip2|lzma]\n Zip compression method. The following\n methods are available: \"stored\": no\n compression; \"deflated\": the standard zip\n compression method; \"bzip2\": BZIP2\n compression method (part of the zip standard\n since 2001); \"lzma\": LZMA compression method\n (part of the zip standard since 2006).\n [default: deflated]\n\n -a, --auto-root If given in combination with --outfile, use\n the stem of the OUTFILE (without path and\n extension) as the value for ROOT_FOLDER\n\n -x, --exclude GLOB_PATTERN Glob-pattern to exclude. This is matched\n from the right against all paths in the zip\n file, see Python pathlib's Path.match\n method. This option can be given multiple\n times.\n\n -X, --exclude-from FILE File from which to read a list of glob-\n patterns to exclude, cf. --exclude. Each\n line in FILE is one pattern. This option can\n be given multiple times.\n\n --exclude-dotfiles / --include-dotfiles\n Whether or not to include dotfiles in the\n zip files. By default, dotfiles are\n included.\n\n --exclude-vcs / --include-vcs Whether or not to include files and\n directories commonly used by version control\n systems. (Git, CVS, RCS, SCCS, SVN, Arch,\n Bazaar, Mercurial, and Darcs), e.g.\n '.git/', '.gitignore' '.gitmodules'\n '.gitattributes' for Git. By default, VCS\n are included.\n\n --exclude-git-ignores / --include-git-ignores\n Whether or not to look for .gitignore files\n and to process them for exclude patterns.\n Note that the .gitignore file itself is\n still included in the zip archive unless\n --exclude-vcs is given. By default,\n .gitignore files are not processed.\n\n -o, --outfile OUTFILE The path of the zip file to be written. By\n default, the file is written to stdout.\n\n\n=======\nHistory\n=======\n\n\n0.4.1 (2021-04-21)\n------------------\n\n* Bugfix: Permissions (especially executable permissions) were not preserved on Unix\n\n\n0.4.0 (2021-04-04)\n------------------\n\n* Added: options ``--exclude-vcs``, ``--exclude-git-ignores``, and ``--exclude-vcs``\n\n\n0.3.0 (2020-01-19)\n------------------\n\n* Added: option ``--exclude``\n\n\n0.2.0 (2020-01-17)\n------------------\n\n* Added: option ``--auto-root``\n\n\n0.1.0 (2020-01-17)\n------------------\n\n* Initial release\n\n\n",
"bugtrack_url": null,
"license": "BSD license",
"summary": "Command line utilities for creating zip files",
"version": "0.4.1",
"split_keywords": [
"zip"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d1cdac639dba1ce48dc465e44dcd98a68d1c53743da7687345f2b494d1ac5ae7",
"md5": "9a3e85419cdbd0ca173c65e9e2e25a29",
"sha256": "d94dd40c5abd01666668c62931a23f2c800601170e7b3d5ba5d309bd70f5bcab"
},
"downloads": -1,
"filename": "zip_files-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9a3e85419cdbd0ca173c65e9e2e25a29",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 12838,
"upload_time": "2021-04-21T17:25:17",
"upload_time_iso_8601": "2021-04-21T17:25:17.351473Z",
"url": "https://files.pythonhosted.org/packages/d1/cd/ac639dba1ce48dc465e44dcd98a68d1c53743da7687345f2b494d1ac5ae7/zip_files-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5732f1c1ff96aa74a664a99abf18202a36cab61d981d14d72760e5fe8344cd81",
"md5": "778b1e57443cc9b76504acfb490b913d",
"sha256": "fc797a78b92d44f9c5e740896771f12d41d240f47f8b185321d4a3766847dc97"
},
"downloads": -1,
"filename": "zip_files-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "778b1e57443cc9b76504acfb490b913d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 43538,
"upload_time": "2021-04-21T17:25:18",
"upload_time_iso_8601": "2021-04-21T17:25:18.712286Z",
"url": "https://files.pythonhosted.org/packages/57/32/f1c1ff96aa74a664a99abf18202a36cab61d981d14d72760e5fe8344cd81/zip_files-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-04-21 17:25:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "goerz",
"github_project": "zip_files",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"appveyor": true,
"tox": true,
"lcname": "zip-files"
}