Download remote OpenSCAD files
A python script to download remote OpenSCAD files. The idea is similar
to the pip package installer in python.
-
Create 2 folders in the
...OpenSCAD/librariesfolder:* spider_food * spider_food_store -
Download OpenSCAD file(s) from one of SPIDER_WEBS. It is defined in a dict in python and contains urls of remote sites:
SPIDER_WEBS={ 'github':'https://github.com' ,'thingiverse':'https://www.thingiverse.com' }and is specified in a call to this file:
> python openscad_spider.py --web github -
Additionally,
libnamemust be specified, and optionallyauthor:> ... --libname <some_name> --author <author>Consider: for github, use
clone; for thingiverse: useunzip -
Users can also specify a url not in SPIDER_WEBS:
> python openscad_spider.py --web http://a/b/cwhich directly points to a
.scadfile.In this case,
libnameandauthorare to be ignored. -
When
--webis not a direct url to a.scadfile, 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
...OpenSCAD/libraries/spider_food -
A new file,
spider_template.scad, is created in the current working folder, containing:include <sider_food/<libname>> -
Run
spider_template.scadin OpenSCAD -
Upon exist, ask users if this lib is to be kept. If yes, make a copy to
...OpenSCAD/libraries/spider_food_store
20180313- Project plan outlined in README.md