OpenSCAD Spider Project

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

OpenSCAD Spider Project

runsun
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.

OpenSCAD_Spider

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:

  1. Create 2 folders in the ...OpenSCAD/libraries folder:

    * spider_food
    * spider_food_store
    
  2. 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

  3. Additionally, libname must be specified, and optionally author:

    > ... --libname <some_name> --author <author>

    Consider: for github, use clone; for thingiverse: use unzip

  4. 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.

  5. 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.

  6. The downloaded file(s) will be saved to

    ...OpenSCAD/libraries/spider_food

  7. A new file, spider_template.scad, is created in the current working folder, containing:

    include <sider_food/<libname>>

  8. Run spider_template.scad in OpenSCAD

  9. Upon exist, ask users if this lib is to be kept. If yes, make a copy to ...OpenSCAD/libraries/spider_food_store

Project Progress

20180313- Project plan outlined in README.md

$ Runsun Pan, PhD
$ libs: scadx, doctest, faces(git), offline doc(git), runscad.py(2,git), editor of choice: CudaText ( OpenSCAD lexer); $ Tips; $ Snippets


Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
$ Runsun Pan, PhD
$ libs: scadx, doctest, faces(git), offline doc(git), runscad.py(2,git), editor of choice: CudaText ( OpenSCAD lexer); $ Tips; $ Snippets