openpack


Nameopenpack JSON
Version 2.4.0 PyPI version JSON
download
home_pagehttps://github.com/jaraco/openpack
Summaryopenpack
upload_time2023-08-28 15:25:40
maintainer
docs_urlNone
authorJason R. Coombs
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            .. image:: https://img.shields.io/pypi/v/openpack.svg
   :target: https://pypi.org/project/openpack

.. image:: https://img.shields.io/pypi/pyversions/openpack.svg

.. image:: https://github.com/jaraco/openpack/workflows/tests/badge.svg
   :target: https://github.com/jaraco/openpack/actions?query=workflow%3A%22tests%22
   :alt: tests

.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
    :target: https://github.com/astral-sh/ruff
    :alt: Ruff

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/psf/black
   :alt: Code style: Black

.. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest
..    :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest

.. image:: https://img.shields.io/badge/skeleton-2023-informational
   :target: https://blog.jaraco.com/skeleton

``openpack`` provides base functionality for working with the `Open
Office XML (OOXML) <https://en.wikipedia.org/wiki/Office_Open_XML>`_
format in Python.

Introduction
============

Openpack is a base library for OpenXML documents. It is used by the `paradocx
<https://pypi.org/project/paradocx>`_ and `XlsXcessive
<https://pypi.org/project/xlsxcessive>`_.

Utilities
=========

Openpack includes two utilities for working with OpenXML documents from the
command-line, `part-edit` and `zip-listdir`.

These commands are additionally exposed as modules and may be invoked
using ``python -m``, e.g. ``python -m openpack.part-edit``.

zip-listdir
-----------

``zip-listdir`` isn't specific to OpenXML, and will work on any zip file.
Since OpenXML documents are themselves zip files, however, it is useful to have
when working with OpenXML::

    > zip-listdir ../paradocx/data.docx
      [Content_Types].xml
    d _rels
    d word

``zip-listdir`` lists the files and directories and can be used to list
sub-directories as well::

    > zip-listdir ../paradocx/data.docx/word
    d _rels
      document.xml

part-edit
---------

While ``zip-listdir`` enables inspecting the structure of the zip content of
an OpenXML document, ``part-edit`` facilitates editing the various parts of
those documents using the client's text editor. For example, to edit the
``word/document.xml`` as found in data.docx from the previous example, simply
invoke part-edit::

    > part-edit ../paradocx/data.docx/word/document.xml

The program will attempt to use the default text editor to edit the file. If
the default editor is not sufficient, the user may specify an editor by
setting either XML_EDITOR or EDITOR environment variables.

``part-edit`` will parse the zip file, locate the content within the zip file,
extract that content to a temporary file, and then open that content in an
editor. After the editor is closed, if the file was changed, the zip file
will be updated with the new content.

The user may pass the optional ``--reformat-xml``, in which case the XML will
be pretty-formatted for easier human readability.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jaraco/openpack",
    "name": "openpack",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Jason R. Coombs",
    "author_email": "jaraco@jaraco.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/6c/0139aa0d97fbeca4c56c34e9709da251f57e451cd9c74f301c0d1d1e74ee/openpack-2.4.0.tar.gz",
    "platform": null,
    "description": ".. image:: https://img.shields.io/pypi/v/openpack.svg\n   :target: https://pypi.org/project/openpack\n\n.. image:: https://img.shields.io/pypi/pyversions/openpack.svg\n\n.. image:: https://github.com/jaraco/openpack/workflows/tests/badge.svg\n   :target: https://github.com/jaraco/openpack/actions?query=workflow%3A%22tests%22\n   :alt: tests\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json\n    :target: https://github.com/astral-sh/ruff\n    :alt: Ruff\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n   :alt: Code style: Black\n\n.. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest\n..    :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest\n\n.. image:: https://img.shields.io/badge/skeleton-2023-informational\n   :target: https://blog.jaraco.com/skeleton\n\n``openpack`` provides base functionality for working with the `Open\nOffice XML (OOXML) <https://en.wikipedia.org/wiki/Office_Open_XML>`_\nformat in Python.\n\nIntroduction\n============\n\nOpenpack is a base library for OpenXML documents. It is used by the `paradocx\n<https://pypi.org/project/paradocx>`_ and `XlsXcessive\n<https://pypi.org/project/xlsxcessive>`_.\n\nUtilities\n=========\n\nOpenpack includes two utilities for working with OpenXML documents from the\ncommand-line, `part-edit` and `zip-listdir`.\n\nThese commands are additionally exposed as modules and may be invoked\nusing ``python -m``, e.g. ``python -m openpack.part-edit``.\n\nzip-listdir\n-----------\n\n``zip-listdir`` isn't specific to OpenXML, and will work on any zip file.\nSince OpenXML documents are themselves zip files, however, it is useful to have\nwhen working with OpenXML::\n\n    > zip-listdir ../paradocx/data.docx\n      [Content_Types].xml\n    d _rels\n    d word\n\n``zip-listdir`` lists the files and directories and can be used to list\nsub-directories as well::\n\n    > zip-listdir ../paradocx/data.docx/word\n    d _rels\n      document.xml\n\npart-edit\n---------\n\nWhile ``zip-listdir`` enables inspecting the structure of the zip content of\nan OpenXML document, ``part-edit`` facilitates editing the various parts of\nthose documents using the client's text editor. For example, to edit the\n``word/document.xml`` as found in data.docx from the previous example, simply\ninvoke part-edit::\n\n    > part-edit ../paradocx/data.docx/word/document.xml\n\nThe program will attempt to use the default text editor to edit the file. If\nthe default editor is not sufficient, the user may specify an editor by\nsetting either XML_EDITOR or EDITOR environment variables.\n\n``part-edit`` will parse the zip file, locate the content within the zip file,\nextract that content to a temporary file, and then open that content in an\neditor. After the editor is closed, if the file was changed, the zip file\nwill be updated with the new content.\n\nThe user may pass the optional ``--reformat-xml``, in which case the XML will\nbe pretty-formatted for easier human readability.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "openpack",
    "version": "2.4.0",
    "project_urls": {
        "Homepage": "https://github.com/jaraco/openpack"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45b00f4602d5c5570b681190bd06812133ec73ec6ef90165d0a0f41c309b3c44",
                "md5": "0e3e374b8b820dcc409d9ba684a5b310",
                "sha256": "95bab4725c411082db55480dd333c30c5f9138ba3a983255f18b831cba2bffc6"
            },
            "downloads": -1,
            "filename": "openpack-2.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0e3e374b8b820dcc409d9ba684a5b310",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15864,
            "upload_time": "2023-08-28T15:25:38",
            "upload_time_iso_8601": "2023-08-28T15:25:38.543465Z",
            "url": "https://files.pythonhosted.org/packages/45/b0/0f4602d5c5570b681190bd06812133ec73ec6ef90165d0a0f41c309b3c44/openpack-2.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c6c0139aa0d97fbeca4c56c34e9709da251f57e451cd9c74f301c0d1d1e74ee",
                "md5": "3d512c8e5b5649f8c7540c9b94ccc9b8",
                "sha256": "3e43151b3d56b35e72b147e51bb41f0b41b036ffcfb8d625bbfc580a62d24abd"
            },
            "downloads": -1,
            "filename": "openpack-2.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3d512c8e5b5649f8c7540c9b94ccc9b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 91657,
            "upload_time": "2023-08-28T15:25:40",
            "upload_time_iso_8601": "2023-08-28T15:25:40.305317Z",
            "url": "https://files.pythonhosted.org/packages/6c/6c/0139aa0d97fbeca4c56c34e9709da251f57e451cd9c74f301c0d1d1e74ee/openpack-2.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-28 15:25:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jaraco",
    "github_project": "openpack",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "openpack"
}
        
Elapsed time: 0.18398s