Inspired by the recent contributions of package manager(s) and related discussions, I thought I'd write a simple downloader (intended to be like the pip installer in python) that could serve as a quick fix before any package manager becomes standardized or widely accepted.
The project OpenSCAD Spider is hosted on github. It would most likely contain only one python file. Currently only the README is done. Please give comments, thx.
Download remote OpenSCAD files
A python script to download remote OpenSCAD files. The idea is similar
to the pip package installer in python.
What openscad_spider.py does:
Create 2 folders in the ...OpenSCAD/libraries folder:
Download OpenSCAD file(s) from one of SPIDER_WEBS. It is defined
in a dict in python and contains urls of remote sites:
Additionally, libname must be specified, and optionally author:
> ... --libname <some_name> --author <author>
Consider: for github, use clone; for thingiverse: use unzip
Users can also specify a url not in SPIDER_WEBS:
> python openscad_spider.py --web http://a/b/c
which directly points to a .scad file.
In this case, libname and author are to be ignored.
When --web is not a direct url to a .scad file, this prog needs
to srape through the given webpage to dig out the direct download url.
This can be done with either python itself, or consider the other
webpage scrapping tool like BeautifulSoup or Scrapy.
The downloaded file(s) will be saved to
A new file, spider_template.scad, is created in the current
working folder, containing:
Run spider_template.scad in OpenSCAD
Upon exist, ask users if this lib is to be kept. If yes, make
a copy to ...OpenSCAD/libraries/spider_food_store