onshape-public / apikey Goto Github PK
View Code? Open in Web Editor NEWLibraries and samples for using APIKeys with Onshape
License: MIT License
Libraries and samples for using APIKeys with Onshape
License: MIT License
The response body is empty for the "copyelement" call. I get a 200 status code, and onshape.py gets to line 210 but res.text is empty.
As the API Explorer outlines in the UI, I am expecting the following response:
angleUnits
elementType
id
lengthUnits
name
thumbnailInfo
thumbnails
type
See errors when running here: https://npm.runkit.com/@onshape/apikey
Wish to download an stl file. Currently using a simple approach:
https://partner.dev.onshape.comapi/documents/d/405396d32ddaf0ae85bbb381/w/84cb220a3415aedfaf4c4c02/e/e02c7ca6c5bc16dd26949153/export?units=inch&scale=1&mode=binary&format=STL
Getting max retries:
Max retries exceeded with url: /documents/d/405396d32ddaf0ae85bbb381/w/84cb220a3415aedfaf4c4c02/e/e02c7ca6c5bc16dd26949153/export?units=inch&scale=1&mode=binary&format=STL
Any clues?
This is what the code looks like:
Here is another code sample:payload = {'format': 'STL', 'mode': 'binary', 'scale': '1', 'units': 'inch'}
response = self._api.request('get', 'api/documents/d/' + did + '/w/' + wid + '/e/' + eid + '/export', query=payload, download=True)
[download] controls streaming = True.
Please make this package available to install via PyPi
I noticed this repo does not have an MIT license, whereas most of your repos do. Assuming this is inadvertent, would you mind changing your license to MIT? I'd like to build off of the Python API.
Thanks.
I tried to use the Python API client from https://github.com/onshape-public/apikey/tree/master/python. I have it setup correctly as I retrieve all the documents in my workspace. I then try and call:
c.upload_blob("fab53b5336649854f782cb0e","37c8c8477dee70a4f6fb1ad4", "/Users/ronanbarrett/Downloads/wing_finish.step")
This results in an error as the MIME type for STEP cannot be mapped to something known. The error is:
Traceback (most recent call last):
File "app.py", line 23, in
print (c.upload_blob("fab53b5336649854f782cb0e","37c8c8477dee70a4f6fb1ad4", "/Users/ronanbarrett/Downloads/wing_finish.step"))
File "/Users/ronanbarrett/go_development/src/github.com/onshape/apikey/python/apikey/client.py", line 194, in upload_blob
payload += 'Content-Type: ' + mimetype + '\r\n\r\n'
TypeError: cannot concatenate 'str' and 'NoneType' objects
Using the api to download stl files results in access denied?
I'm doing
headers = {'Accept' : 'application/vnd.onshape.v1+octet-stream'}
payload = {'format': 'STL', 'mode': 'binary', 'scale': '1', 'units': 'inch'}
response = self._api.request('get', '/api/documents/d/' + did + '/w/' + wid + '/e/' + eid + '/export', headers=headers, query=payload, stream=True)
The "--query" option in the getDocuments.js example does not work because it is passing "query" to getDocuments(). The API reference lists "q" for this option. Works with the changes in the attached diff.
patch.diff.txt
.
I found some issues in the installation of the requirements using ubuntu 20.04.
The requirements.txt is not update with the new version or the modules
Hello,
I was wondering if the instructions below were not meant for Windows.
I Forked the repo. and made some modifications that allowed me to complete the setup process and ran the example python programs. I summarized the steps on a new version of the README file and created a new requirements-win.txt file (both are attached on the win-sol.zip).
Would this be useful to add to the main branch?
Am I missing something?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.