Catalog PyPI
Back to packageRELEASE DETAILS

1.0.0

PyPI

AffinitySvgPatcher

A module for patching matplotlib-generated SVG files to make them work Affinity Designer.

Published1 Jul 2024
Direct dependencies0
Transitive dependenciesNot calculated

README

Version 1.0.0 documentation

AffinitySvgPatcher

Patches Matplotlib-generated svg to be able to open them properly in Affinity Designer.

It can be yours simply though

pip install AffinitySvgPatcher

Usage

From python

from AffinitySvgPatcher import AffinitySvgPatcher

patcher = AffinitySvgPatcher('path/to/file.svg')
patcher.patch_svg(save = True, save_dir = 'dir/to/save', postfix = '-patched')

From command line

AffinitySvgPatcher path/to/file.svg --postfix patched --dir .

Patches

For now I have discovered the following tricks:

  • in text elements, replace font attributes with font-size and font-family (font is apparently ignored by AD),
  • in xlink:href (which are deprecated) replace x and y attributes with transform=translate(x y) (AD seems to ignore x or y attributes).

If more issues become known, PRs or GH issues are welcome! :)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

2 collected
AffinitySvgPatcher-1.0.0-py3-none-any.whl

bdist_wheel · 28.7 KB · Python py3

Source file
affinitysvgpatcher-1.0.0.tar.gz

sdist · 39.82 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:05 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:ebaa7b2fc099fe78742819d7fc0bda3ee48d6f5d0b6037e66c53cda85494877f

Other collected versions

View all collected versions →