This repository stores the method to auto-generate all the REST API endpoints for Onshape (in Python snippets). Please note that this repository is not at production quality, and it is only meant to serve as a reference. To learn the basics of API calls, please see this guide. The official documentation of all API endpoints can be found here.
To use the Python snippets in Jupyter notebooks, we recommend coding in Google Colab and follow the steps below to import the snippets to your own notebook:
- Download
API_Snippets.ipynb
from this repository. - Upload
API_Snippets.ipynb
to your Google Drive with Google Colab available to your Google account. - In your own project notebook (which you would like these API snippets imported into), go to "Tools" and select "Settings". Under "Site" on the left panel, you can copy and paste the URL of the uploaded
API_Snippets.ipynb
to the "Custome snippet notebook URL" textbox. - Once you refresh the notebook, you should be able to see and import the code snippets under "Code Snippets" on the left panel of the webpage (the <> icon).
Please note that you will need to first import and run section 0 from API_Snippets.ipynb
for any project before other code snippets can function properly.
For more information on obtaining your Onshape API keys, kindly follow the steps under section 2 of this guide.
API_Snippets.ipynb
: the main product of this repository with all Python-version API endpointsAPI_generator.py
: functions used to generate and format every API endpointmaster_writer.py
: the main code used to generate theAPI_Snippets.ipynb