arc-file-extractor


Namearc-file-extractor JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryCLI frontend for unified file extraction on UNIX systems.
upload_time2025-07-15 12:22:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords archive compression extraction cli zip tar gzip
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==================
Arc File Extractor
==================


.. image:: https://img.shields.io/pypi/v/arc_file_extractor.svg
        :target: https://pypi.python.org/pypi/arc_file_extractor

.. image:: https://readthedocs.org/projects/arc-file-extractor/badge/?version=latest
        :target: https://arc-file-extractor.readthedocs.io/en/latest/?version=latest
        :alt: Documentation Status




A unified CLI for file extraction and compression on UNIX systems.

Features
--------

* **Simple extraction**: Extract files with a single command ``arc x file``
* **Easy compression**: Compress files and directories with ``arc c source``
* **Multiple formats**: Support for ZIP, TAR, GZIP, BZIP2, XZ, 7Z, and RAR formats
* **Dependency checking**: Built-in tool to check system dependencies
* **Rich output**: Beautiful colored output with file sizes and progress
* **Cross-platform**: Works on any UNIX-like system (Linux, macOS, BSD)

Installation
------------

Install Arc File Extractor using pip::

    pip install arc-file-extractor

Or install from source::

    git clone https://github.com/alves/arc_file_extractor.git
    cd arc_file_extractor
    pip install .

Usage
-----

Basic Commands
~~~~~~~~~~~~~~

**Extract a file:**

.. code-block:: bash

    arc x archive.zip
    arc x document.tar.gz
    arc x backup.7z

This will extract the file to a directory with the same name (without extension).

**Compress a file or directory:**

.. code-block:: bash

    arc c myfile.txt
    arc c mydirectory/
    arc c source/ -o backup.tar.gz

If no output file is specified, it defaults to creating a .zip file.

**List supported formats:**

.. code-block:: bash

    arc list

**Check system dependencies:**

.. code-block:: bash

    arc check

Advanced Usage
~~~~~~~~~~~~~~

**Verbose output:**

.. code-block:: bash

    arc x archive.zip -v
    arc c mydir/ -v

**Custom output file:**

.. code-block:: bash

    arc c myproject/ -o backup.tar.gz
    arc c documents/ -o docs_backup.7z

Supported Formats
~~~~~~~~~~~~~~~~~

**Extraction:**
- ZIP (.zip)
- TAR (.tar, .tar.gz, .tgz, .tar.bz2, .tbz, .tar.xz, .txz)
- GZIP (.gz)
- BZIP2 (.bz2)
- XZ (.xz)
- 7-Zip (.7z)
- RAR (.rar)

**Compression:**
- ZIP (.zip)
- TAR (.tar, .tar.gz, .tgz, .tar.bz2, .tbz, .tar.xz, .txz)
- 7-Zip (.7z)
- RAR (.rar)

Dependencies
~~~~~~~~~~~~

Arc File Extractor uses system tools for compression and extraction. Install the required tools:

**Ubuntu/Debian:**

.. code-block:: bash

    sudo apt install unzip tar gzip bzip2 xz-utils p7zip-full unrar zip

**Fedora/RHEL:**

.. code-block:: bash

    sudo dnf install unzip tar gzip bzip2 xz p7zip unrar zip

**Arch Linux:**

.. code-block:: bash

    sudo pacman -S unzip tar gzip bzip2 xz p7zip unrar zip

**macOS:**

.. code-block:: bash

    brew install p7zip unrar zip

Examples
--------

**Extract various archive types:**

.. code-block:: bash

    # Extract a ZIP file
    arc x project.zip
    # Creates: project/ directory

    # Extract a TAR.GZ file
    arc x backup.tar.gz
    # Creates: backup/ directory

    # Extract with verbose output
    arc x large_archive.7z -v

**Compress files and directories:**

.. code-block:: bash

    # Compress a directory to ZIP (default)
    arc c myproject/
    # Creates: myproject.zip

    # Compress to TAR.GZ
    arc c documents/ -o docs.tar.gz

    # Compress a single file
    arc c important_file.txt -o compressed.7z

**Check system status:**

.. code-block:: bash

    # Check what tools are installed
    arc check
    
    # List all supported formats
    arc list

Development
-----------

To set up for development::

    git clone https://github.com/alves/arc_file_extractor.git
    cd arc_file_extractor
    pip install -e .[dev]

Run tests::

    pytest

API Reference
-------------

Core Classes
~~~~~~~~~~~~

**ArcFileExtractor**

Main class for file extraction and compression operations.

.. code-block:: python

    from arc_file_extractor import ArcFileExtractor
    
    extractor = ArcFileExtractor()
    
    # Extract a file
    result = extractor.extract("archive.zip")
    
    # Compress a file/directory
    result = extractor.compress("source_dir", "output.tar.gz")

**Methods:**

- ``extract(file_path: str) -> int``: Extract a file to a directory with the same name
- ``compress(source_path: str, output_file: str = None) -> int``: Compress a file or directory

Utility Functions
~~~~~~~~~~~~~~~~~

**check_dependencies() -> List[str]**

Check if required external tools are installed. Returns a list of missing dependencies.

**get_supported_formats() -> dict**

Get supported file formats for extraction and compression.

**validate_file_path(file_path: str) -> bool**

Validate if a file path exists and is readable.

**get_file_size(file_path: str) -> str**

Get human-readable file size.

Contributing
------------

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests for new functionality
5. Run the test suite
6. Submit a pull request

Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "arc-file-extractor",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Pedro Henrique Alves <nukhes@protonmail.com>",
    "keywords": "archive, compression, extraction, cli, zip, tar, gzip",
    "author": null,
    "author_email": "Pedro Henrique Alves <nukhes@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/74/bb/73e80b8abb02d84f724123f59f1e4b0a72e2f717994f8342190f8960ea29/arc_file_extractor-0.1.0.tar.gz",
    "platform": null,
    "description": "==================\nArc File Extractor\n==================\n\n\n.. image:: https://img.shields.io/pypi/v/arc_file_extractor.svg\n        :target: https://pypi.python.org/pypi/arc_file_extractor\n\n.. image:: https://readthedocs.org/projects/arc-file-extractor/badge/?version=latest\n        :target: https://arc-file-extractor.readthedocs.io/en/latest/?version=latest\n        :alt: Documentation Status\n\n\n\n\nA unified CLI for file extraction and compression on UNIX systems.\n\nFeatures\n--------\n\n* **Simple extraction**: Extract files with a single command ``arc x file``\n* **Easy compression**: Compress files and directories with ``arc c source``\n* **Multiple formats**: Support for ZIP, TAR, GZIP, BZIP2, XZ, 7Z, and RAR formats\n* **Dependency checking**: Built-in tool to check system dependencies\n* **Rich output**: Beautiful colored output with file sizes and progress\n* **Cross-platform**: Works on any UNIX-like system (Linux, macOS, BSD)\n\nInstallation\n------------\n\nInstall Arc File Extractor using pip::\n\n    pip install arc-file-extractor\n\nOr install from source::\n\n    git clone https://github.com/alves/arc_file_extractor.git\n    cd arc_file_extractor\n    pip install .\n\nUsage\n-----\n\nBasic Commands\n~~~~~~~~~~~~~~\n\n**Extract a file:**\n\n.. code-block:: bash\n\n    arc x archive.zip\n    arc x document.tar.gz\n    arc x backup.7z\n\nThis will extract the file to a directory with the same name (without extension).\n\n**Compress a file or directory:**\n\n.. code-block:: bash\n\n    arc c myfile.txt\n    arc c mydirectory/\n    arc c source/ -o backup.tar.gz\n\nIf no output file is specified, it defaults to creating a .zip file.\n\n**List supported formats:**\n\n.. code-block:: bash\n\n    arc list\n\n**Check system dependencies:**\n\n.. code-block:: bash\n\n    arc check\n\nAdvanced Usage\n~~~~~~~~~~~~~~\n\n**Verbose output:**\n\n.. code-block:: bash\n\n    arc x archive.zip -v\n    arc c mydir/ -v\n\n**Custom output file:**\n\n.. code-block:: bash\n\n    arc c myproject/ -o backup.tar.gz\n    arc c documents/ -o docs_backup.7z\n\nSupported Formats\n~~~~~~~~~~~~~~~~~\n\n**Extraction:**\n- ZIP (.zip)\n- TAR (.tar, .tar.gz, .tgz, .tar.bz2, .tbz, .tar.xz, .txz)\n- GZIP (.gz)\n- BZIP2 (.bz2)\n- XZ (.xz)\n- 7-Zip (.7z)\n- RAR (.rar)\n\n**Compression:**\n- ZIP (.zip)\n- TAR (.tar, .tar.gz, .tgz, .tar.bz2, .tbz, .tar.xz, .txz)\n- 7-Zip (.7z)\n- RAR (.rar)\n\nDependencies\n~~~~~~~~~~~~\n\nArc File Extractor uses system tools for compression and extraction. Install the required tools:\n\n**Ubuntu/Debian:**\n\n.. code-block:: bash\n\n    sudo apt install unzip tar gzip bzip2 xz-utils p7zip-full unrar zip\n\n**Fedora/RHEL:**\n\n.. code-block:: bash\n\n    sudo dnf install unzip tar gzip bzip2 xz p7zip unrar zip\n\n**Arch Linux:**\n\n.. code-block:: bash\n\n    sudo pacman -S unzip tar gzip bzip2 xz p7zip unrar zip\n\n**macOS:**\n\n.. code-block:: bash\n\n    brew install p7zip unrar zip\n\nExamples\n--------\n\n**Extract various archive types:**\n\n.. code-block:: bash\n\n    # Extract a ZIP file\n    arc x project.zip\n    # Creates: project/ directory\n\n    # Extract a TAR.GZ file\n    arc x backup.tar.gz\n    # Creates: backup/ directory\n\n    # Extract with verbose output\n    arc x large_archive.7z -v\n\n**Compress files and directories:**\n\n.. code-block:: bash\n\n    # Compress a directory to ZIP (default)\n    arc c myproject/\n    # Creates: myproject.zip\n\n    # Compress to TAR.GZ\n    arc c documents/ -o docs.tar.gz\n\n    # Compress a single file\n    arc c important_file.txt -o compressed.7z\n\n**Check system status:**\n\n.. code-block:: bash\n\n    # Check what tools are installed\n    arc check\n    \n    # List all supported formats\n    arc list\n\nDevelopment\n-----------\n\nTo set up for development::\n\n    git clone https://github.com/alves/arc_file_extractor.git\n    cd arc_file_extractor\n    pip install -e .[dev]\n\nRun tests::\n\n    pytest\n\nAPI Reference\n-------------\n\nCore Classes\n~~~~~~~~~~~~\n\n**ArcFileExtractor**\n\nMain class for file extraction and compression operations.\n\n.. code-block:: python\n\n    from arc_file_extractor import ArcFileExtractor\n    \n    extractor = ArcFileExtractor()\n    \n    # Extract a file\n    result = extractor.extract(\"archive.zip\")\n    \n    # Compress a file/directory\n    result = extractor.compress(\"source_dir\", \"output.tar.gz\")\n\n**Methods:**\n\n- ``extract(file_path: str) -> int``: Extract a file to a directory with the same name\n- ``compress(source_path: str, output_file: str = None) -> int``: Compress a file or directory\n\nUtility Functions\n~~~~~~~~~~~~~~~~~\n\n**check_dependencies() -> List[str]**\n\nCheck if required external tools are installed. Returns a list of missing dependencies.\n\n**get_supported_formats() -> dict**\n\nGet supported file formats for extraction and compression.\n\n**validate_file_path(file_path: str) -> bool**\n\nValidate if a file path exists and is readable.\n\n**get_file_size(file_path: str) -> str**\n\nGet human-readable file size.\n\nContributing\n------------\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new functionality\n5. Run the test suite\n6. Submit a pull request\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "CLI frontend for unified file extraction on UNIX systems.",
    "version": "0.1.0",
    "project_urls": {
        "bugs": "https://github.com/nukhes/arc_file_extractor/issues",
        "changelog": "https://github.com/nukhes/arc_file_extractor/blob/master/HISTORY.rst",
        "documentation": "https://arc-file-extractor.readthedocs.io",
        "homepage": "https://github.com/nukhes/arc_file_extractor",
        "repository": "https://github.com/nukhes/arc_file_extractor"
    },
    "split_keywords": [
        "archive",
        " compression",
        " extraction",
        " cli",
        " zip",
        " tar",
        " gzip"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4fdec3936524ccb7a62812ee6b774bedcd9af21ef6d7a62c9e9268522774a04d",
                "md5": "19af6c7ed2c988f4a54194562c377547",
                "sha256": "51695b896d7cbff3605def812f6f72f88fa28f7efd7f4df478d6c90e2ec399ca"
            },
            "downloads": -1,
            "filename": "arc_file_extractor-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "19af6c7ed2c988f4a54194562c377547",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10411,
            "upload_time": "2025-07-15T12:22:19",
            "upload_time_iso_8601": "2025-07-15T12:22:19.620975Z",
            "url": "https://files.pythonhosted.org/packages/4f/de/c3936524ccb7a62812ee6b774bedcd9af21ef6d7a62c9e9268522774a04d/arc_file_extractor-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "74bb73e80b8abb02d84f724123f59f1e4b0a72e2f717994f8342190f8960ea29",
                "md5": "53b713f9c396d5fd52759151cbf10886",
                "sha256": "aff6ca36ab54b05ffc85355f7d71ea0f536f36a80caa024c28b5cbcab6b27770"
            },
            "downloads": -1,
            "filename": "arc_file_extractor-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "53b713f9c396d5fd52759151cbf10886",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 15462,
            "upload_time": "2025-07-15T12:22:20",
            "upload_time_iso_8601": "2025-07-15T12:22:20.941061Z",
            "url": "https://files.pythonhosted.org/packages/74/bb/73e80b8abb02d84f724123f59f1e4b0a72e2f717994f8342190f8960ea29/arc_file_extractor-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-15 12:22:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nukhes",
    "github_project": "arc_file_extractor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "arc-file-extractor"
}
        
Elapsed time: 0.80306s