Skip to main content

Sample package to demonstrate using Onshape API keys

Project description

Description: # Python 3 API Key Sample [![Build Status](https://travis-ci.org/AguaClara/onshape.svg?branch=master)](https://travis-ci.org/AguaClara/onshape)
[![codecov](https://codecov.io/gh/AguaClara/onshape/branch/master/graph/badge.svg)](https://codecov.io/gh/AguaClara/onshape)

Simple demonstration of getting a key and structuring API calls.

---

### Local Setup

Install the dependencies:

* Python 3 (3.5 +)

Then, from this folder, install the pip package from the local source (this will install the dependencies automatically):

```sh
pip install .
```
**Note:** if you are on mac or getting permission errors, try including the `--user` key.

### Running the App

Create a `creds.json` file in this directory, with the following format:

```json
{
"https://cad.onshape.com": {
"access_key": "ACCESS KEY",
"secret_key": "SECRET KEY"
}
}
```

Just replace "ACCESS KEY" and "SECRET KEY" with the values you got from the
developer portal. To test on other stacks, you'll create another object in the file,
with credentials for that specific stack.

To run the basic application:

```sh
$ python app.py
```

To print an STL representation of a given part studio to the console:

```sh
$ python exportstl.py
```

If you want to specify a different stack to test on, simply go into the file you're running and
change the `stack` parameter on this line:

```py
c = Client(stack='NEW STACK HERE')
```

### Working with API Keys

For general information on our API keys and how they work, read this
[document](https://github.com/onshape/apikey/blob/master/README.md). For general
API support, please reach out to us at
[api-support@onshape.com](mailto:api-support@onshape.com).
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for onshapepy, version 0.0.0
Filename, size File type Python version Upload date Hashes
Filename, size onshapepy-0.0.0.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page