![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
xtract
|pipeline|_ |coverage|_
Code: https://rolln.de/knoppo/xtract
Documentation: https://docs.rolln.de/knoppo/xtract/master
Coverage: https://coverage.rolln.de/knoppo/xtract/master
Python library providing an API to unpack/decompress and pack/compress directories and files. It's a wrapper around the supported archive and compression formats.
Supported Archives:
Archives are always unpacked to a new directory!
rar
zip
tar
no compression (See usage examples below for an example of adding compression)
Supported Compressions:
gz
xz
bz2
.. code-block:: bash
pip install xtract
See the quickstart documentation <https://docs.rolln.de/knoppo/xtract/master/quickstart.html#installation>
_
for more detailed installation instructions.
The convenience function xtract
can be used to unpack/decompress anything:
.. code-block:: python
from xtract import xtract xtract('my-directory.tar.gz') '/home//my-directory.tar'
Use the all
switch to loop until FileTypeNotSupported
is raised:
.. code-block:: python
xtract('my-directory.tar.gz', all=True) '/home//my-directory'
Compress a file:
.. code-block:: python
from xtract import bz2 bz2('my-file.txt', delete_source=True) '/home//my-file.txt.bz2'
Every function returns the destination (if successful) to chain them:
This creates an intermediate .tar file! Use delete_source=True
to delete it afterwards.
.. code-block:: python
from xtract import tar, gzip gzip( tar('my-directory', ['file1.txt', 'file2.txt']), delete_source=True ) '/home//my-directory.tar.gz'
See the manual <https://docs.rolln.de/knoppo/xtract/master/manual.html>
_
for more examples.
Copyright (c) 2017 Mathias Stelzer
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
.. |pipeline| image:: https://rolln.de/knoppo/xtract/badges/master/pipeline.svg .. _pipeline: https://rolln.de/knoppo/xtract/commits/master .. |coverage| image:: https://rolln.de/knoppo/xtract/badges/master/coverage.svg .. _coverage: https://rolln.de/knoppo/xtract/commits/master
FAQs
Library to (un)pack archives and (de)compress files
We found that xtract demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.