sachinraja / simple-icons-py

python wrapper for simple-icons
https://pypi.org/project/simpleicons/
MIT License
18 stars 3 forks source link

Make svglib/reportlab/pillow extra dependencies? #3

Closed deeplook closed 3 years ago

deeplook commented 3 years ago

Just discovered this nice tool! If I see that correctly svglib, reportlab and pillow are only used when converting to bitmaps, right? As these are pretty heavy dependencies (I know because I'm the original author of svglib ;) one might consider declaring them "extra" dependencies for pip. But I'm not familiar with poetry to know if it supports that.

sachinraja commented 3 years ago

Great idea, I'll get that published soon! Also I'm almost certain I'm not using these packages correctly here. My intent to to convert xml (bytes returned from this function) to a PIL Image. I'm uncertain on how svglib and reportlab work, but seeing as you're the author of svglib, perhaps you could help here?

deeplook commented 3 years ago

Also I'm almost certain I'm not using these packages correctly here. My intent to to convert xml (bytes returned from this function) to a PIL Image. I'm uncertain on how svglib and reportlab work, but seeing as you're the author of svglib, perhaps you could help here?

That looks pretty good to me. What makes you doubt you're doing the right thing?

sachinraja commented 3 years ago

Not sure...using BytesIO always feels a little hacky to me. Especially the first one where I passed in BytesIO(icon_xml) to svg2rlg, feels like there should already be a function that accepts a string.