Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

OnShapePy - a python package for OnShape

ethan_keller924ethan_keller924 Member, csevp Posts: 42 PRO
Hello all, 

About a month ago I set out to build a general purpose OnShape python package, OnShapePy. Today I have the first MVP launched and available to install through pip. The documentation is available here. The goal is to unlock the vast Python scientific libraries to OnShape parts. At AguaClara, we will be using OnShapePy in conjunction with our hydraulics library to scale a drinking water treatment plant based on physics principles coded in Python. OnShapePy allows us to manipulate the configuration of any PartStudio straight from Python and lets us access measurements defined within the PartStudio. 

Please use OnShapePy in your own projects, and let me know what you think, either by commenting here on this thread or in the issues on our GitHub repo. I'm always looking for collaborators!

Comments

  • ethan_keller924ethan_keller924 Member, csevp Posts: 42 PRO
    This should be OnshapePy. For some unknown reason, I thought Onshape had a capital S! This will be updated when I release the next version of the software/documentation. 
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    There are two of us that still maintain that OnShape is the correct spelling and that they just got their literature wrong and are trying to claim that they meant the lower case s all along...
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • Don_Van_ZileDon_Van_Zile Member Posts: 195 PRO

    Just ran across this and thought it was "somewhat" relevant.


  • tsung_ren_hungtsung_ren_hung Member Posts: 9 EDU
    ethan_keller924 How can I use onshapepy in windows ? I can't create a noname file with extension ".onshapepy" in windows.
  • ethan_keller924ethan_keller924 Member, csevp Posts: 42 PRO
    Hi @tsung_ren_hung! Glad to hear you're using Onshapepy! To create a dotfile, [look here for instructions.](https://gist.github.com/ozh/4131243). Good luck! and feel free to message me if you need any more help :smile:


  • anna_bengtsson419anna_bengtsson419 Member Posts: 3
    edited October 2018
    Hi @ethan_keller924! I'm trying to use Onshapepy on windows, I have tried both with configuration from file (created a dotfile as described in (https://gist.github.com/ozh/4131243) and saved it in my home directory) and configuration from python. But in both ways I get the error message:

    self._access_key = creds['access_key'].encode('utf-8')
    TypeError: 'NoneType' object is not subscriptable

    You have any idea what I'm doing wrong? Thank you in advance!

    Update:Solved it
  • ethan_keller924ethan_keller924 Member, csevp Posts: 42 PRO
    Hi @anna_bengtsson419, unfortunately I haven't yet tested onshapepy on windows- only mac. So my guess is there is some issue with how I was constructing the path to the configuration file, and thus it was unable to find the credentials. I should be able to get a hotfix out for this either later today or tomorrow. I'll keep you posted! 
  • ErgoflexErgoflex Member Posts: 4 PRO
    Hi Ethan,
    Thanks for sharing this with us, I think the documentations' link is no longer working! Is it possible to share another working link?
Sign In or Register to comment.