Organize your data in a spatial grid system for CALS, HTML, Office Open XML tables conversion
Project description
Organize your data in a spatial grid system for CALS, HTML, Office Open XML tables conversion
Usage
To convert the tables of a .docx document to CALS format, you can process as follow:
import os import zipfile from benker.converters.ooxml2cals import convert_ooxml2cals # - Unzip the ``.docx`` in a temporary directory src_zip = "/path/to/demo.docx" tmp_dir = "/path/to/tmp/dir/" with zipfile.ZipFile(src_zip) as zf: zf.extractall(tmp_dir) # - Source paths src_xml = os.path.join(tmp_dir, "word/document.xml") styles_xml = os.path.join(tmp_dir, "word/styles.xml") # - Destination path dst_xml = "/path/to/demo.xml" # - Create some options and convert tables options = { 'encoding': 'utf-8', 'styles_path': str(styles_xml), 'width_unit': "mm", 'table_in_tgroup': True, } convert_ooxml2cals(src_xml, dst_xml, **options)
Installation
To install this library, you can create and activate a virtualenv, and run:
pip install benker
Requirements
This library uses lxml library and is tested with the versions 3.x and 4.x.
Usage in you library/application
You can use this library in you own library/application.
To do so, add this library in your setup.py in your project requirements:
setup( name="YourApp", install_requires=['benker'], ... )
To install the dependencies, activate your virtualenv and run:
pip install -e .
And enjoy!
Licence
This library is distributed according to the MIT licence.
Users have legal right to download, modify, or distribute the library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for Benker-0.2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c26d02ebbba0efe3ea33991b5ded5d64d6e1330b9e3a83bfc68dc3586364f9b |
|
MD5 | 99e7d37df8625c89697ba1d523f0b316 |
|
BLAKE2b-256 | efcd3cdbd0408c4a2b46a0418f79dcfa837f5c0c5c50c576fafccd1d2b9d913e |