Catalog PyPI
PACKAGE EXPLORERView in registry

AffinitySvgPatcher

PyPI

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

Versions collected1
Direct dependencies0From release 1.0.0
Last observed20 Oct, 21:05 UTC

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.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.01 Jul 20240

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

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:21446daf90a7cd7a43fa4d2a4a96278633f0d9f1a92d1b644ff538e3bd03f988