When installing with pip3, svg2paths is not matching documentation
First time using svgpathtools today, also not too experienced with python. I basically want to use svgpathtools to run some checks and based on them change the path element slightly. That's just how I got to the issue though:
The documentation specifies the following function arguments:
svg2paths(svg_file_location, return_svg_attributes=False, convert_circles_to_paths=True, convert_ellipses_to_paths=True, convert_lines_to_paths=True, convert_polylines_to_paths=True, convert_polygons_to_paths=True, convert_rectangles_to_paths=True)
I installed svgpathtools with pip3 install svgpathtools. When checking for the function used with inspect.getsource(svg2paths), I get the following:
def svg2paths(svg_file_location,
convert_lines_to_paths=True,
convert_polylines_to_paths=True,
convert_polygons_to_paths=True,
return_svg_attributes=False):
"""
Converts an SVG file into a list of Path objects and a list of
dictionaries containing their attributes. This currently supports
SVG Path, Line, Polyline, and Polygon elements.
:param svg_file_location: the location of the svg file
:param convert_lines_to_paths: Set to False to disclude SVG-Line objects
(converted to Paths)
:param convert_polylines_to_paths: Set to False to disclude SVG-Polyline
objects (converted to Paths)
:param convert_polygons_to_paths: Set to False to disclude SVG-Polygon
objects (converted to Paths)
:param return_svg_attributes: Set to True and a dictionary of
svg-attributes will be extracted and returned
:return: list of Path objects, list of path attribute dictionaries, and
(optionally) a dictionary of svg-attributes
Where does this decrepancy come from? Just a general question, since until now, I didn't have any problems installing modules with pip3
@mewitte Did you ever get an answer to this? ...or figure out how to fix the issue?
If anyone is reading this and looking for a solution, you can download the package from github, run setup.py, and add the files generated in the build folder to svgpathtools folder in your library. (So I added svgpathtools via pip3, found the library files in my computers path by running 'pip3 show svgpythontools' and then copied the build files into that folder)
I installed it from the repository (just clone and run python setup.py install from project root). This worked consistently on different machines for me.