semvec/pypi-packages huggingface dataset:
latex-generator-hw2 0.3.2
A simple Python package
Requires Python: >=3.10

MIT License

Copyright (c) 2024 shamank

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
svg-path-transform 2.0.2
SVG path data transformation toolkit
Requires Python: >=3.6

SVG path data transformation toolkit
====================================

A tool and a library for SVG path data transformations.
Currently it supports a translation and a scaling.

Usage
-----

As a Python library

```python
import svg_path_transform as S
path = S.parse_path("m 2 2 l 2 2")
path = S.translate_and_scale(path, s=(1, 3))
path = S.translate_and_scale(path, t=(3, 4))
path = S.morph(path, lambda p: [p[0] * 2, p[1] * 2])
print(S.path_to_string(path, sfig=4))
```

As a command line tool

```bash
svg_path_transform --dx 100 --dy 100 <<< "m 2 2 l 2 2"
```

Command line parameters

```
usage: svg_path_transform [-h] [--dx N] [--dy N] [--sx N] [--sy N] [--sfig N] [--ndig N] [--seg N] [--pretty-print] [-v]

SVG path data transformer

options:
  -h, --help      show this help message and exit
  --dx N          translate x by N
  --dy N          translate y by N
  --sx N          scale x by N
  --sy N          scale y by N
  --sfig N        round to N significant figures
  --ndig N        round to N decimal places
  --seg N         convert to straight line segments with a given max distance
  --pretty-print  pretty print the input path and exit
  -v, --version   show program's version number and exit
```

Hint: a bash function to transform an SVG with a single path inside

```bash
function svg_transform() {
    selector='//_:path[1]/@d'
    input=$(</dev/stdin)
    old_path="$(xmlstarlet sel -t -v "$selector" <<< "$input")"
    [[ $? -ne 0 ]] && echo "could not parse SVG" && return 1
    new_path="$(svg_path_transform "$@" <<< "$old_path")"
    [[ $? -ne 0 ]] && echo "could not parse path" && return 1
    xmlstarlet ed -u "$selector" -v "$new_path" <<< "$input"
    [[ $? -ne 0 ]] && echo "could not update SVG" && return 1
    return 0
}

svg_transform --sx 2 --sy 2 < intput.svg > output.svg
```

Installation
------------

```bash
pip install svg_path_transform
```