Transactions on existing SVG documents: inject/extract/modify
Project description
svg|pipe
Transactions for existing SVG documents
Note: The project is in an early stage of development. 0.x.x versions do not garantee a stable API.
inject
data and SVG content into an existing document, keeping its structure intact.
extract
data and SVG content from an existing document (planned).
transfer
data, attributes, etc. between existing SVG elements (planned).
Motivation
Graphics applications are often picky (extremely picky) about the formatting of graphics documents. In order to have SVG files interpreted by your/everybodies favourite vector graphics application, the file structure not only needs to follow the SVG specs, but should follow a precise structure of layers, ids, and other unwritten conventions.
The project wants to facilitate transactions on existing documents for graphics-based workflows:
- automated SVG generation (e.g. for data visualisation)
- smooth integration with interactive vector graphics/CAD applications
- automated data-import into complex pre-formatted graphics documents for visualisation
Philosophy
svg|pipe
not only uses SVG documents for import/export of graphical content into/from some existing stock of data. SVG documents are XML documents and can serve as data structures themselves.
Requirements and Installation
Currently under development using:
- Python 3.7
- Pytest 5.2.2.
Install and test
pip install svgpipe
(on Windows with older pythons you may need python -m pip install svgpipe
)
run tests
When in the package directory, just type:
pytest
When the package was installed via pip
:
pytest --pyargs svgpipe
visual inspection of test results
To get a file output of the SVG content involved in the testing:
- Set environment variable
SVGPIPE_TEST_SVG_OUT
to point to the desired output directory. - Make sure the directory/folder exists.
After the test run, for each svg injection test there will be three SVG files:
XXXX_test.svg
(before the injection)XXXX_result.svg
(what was actually the case after the injection)XXXX_expect.svg
(what should be the case after the injection)
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 Distribution
Built Distribution
File details
Details for the file svgpipe-0.2.0.tar.gz
.
File metadata
- Download URL: svgpipe-0.2.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a570959119e77ab24cc66a46fdabf997187381b079f59cfe962929f2463cca9f |
|
MD5 | 2eda1d126d7a462af7a302c5ef017a1d |
|
BLAKE2b-256 | f95405b5b980714cbb985d57ead7bf2108b2812499c9c6b254fcdd1d353f31b3 |
File details
Details for the file svgpipe-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: svgpipe-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32eacdee9669dbc6df78200f2363c5030beb9babd70a1c05c5339c72555ae724 |
|
MD5 | b23303d3da7fc47b1f2836c620e8ab2f |
|
BLAKE2b-256 | 9738249350825ca17d27ac50ca5078510a4fe0cb93f6c1dc88ddc9b731776780 |