Giter Site home page Giter Site logo

paulmelnikow / bodylabs-api-client-py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bodylabs/bodylabs-api-client-py

0.0 1.0 0.0 61 KB

Base client for Bodylabs API services

License: BSD 2-Clause "Simplified" License

Ruby 6.49% Python 93.51%

bodylabs-api-client-py's Introduction

bodylabs-api-client-py

This package provides high-level File and Artifact objects (models) for conveniently working with the Body Labs Red API or Body Labs Mocap API.

For Red, see the [Red API documentation][api-docs] to gain a better understanding of the API itself as well as the different services available.

Installation or upgrading

pip install --upgrade git+ssh://[email protected]/bodylabs/bodylabs-api-client-py.git@master#egg=bodylabs_api

Examples

To use the Red API:

from bodylabs_api.client import Client
from bodylabs_api.models import File, Artifact

client = Client(base_uri, access_key, secret)

scan_file = File.from_local_path('./foot_scan.ply', client)

alignment_payload = {
    'serviceType': 'FootAlignment',
    'serviceVersion': 'v1',
    'artifactType': 'alignment',
    'parameters': {
        'side': 'right',
        'up': [0.0, 1.0, 0.0],
        'look': [0.0, 0.0, 1.0],
        'scanUnits': 'cm',
    },
    'dependencies': {
        'scan': {'fileId': scan_file.file_id}
    }
}

alignment = Artifact(alignment_payload, client).create().download('./alignment.obj')
# Note: by default, download() blocks on the compute backend to finish the
# alignment, which may take many minutes

To use Mocap API, simply import MultiComponentArtifact instead of Artifact, omit artifactType from the payload (and adjust the remaining four fields as appropriate for the service), and call method download_component(component_name, save_path) instead of download(path).

Development

pip install -r requirements_dev.txt
rake unittest
rake lint

Contribute

  • Issue Tracker: github.com/bodylabs/bodylabs-api-client-py/issues
  • Source Code: github.com/bodylabs/bodylabs-api-client-py

Pull requests welcome!

Support

If you are having issues, please let us know.

License

The project is licensed under the two-clause BSD license.

bodylabs-api-client-py's People

Contributors

algrs avatar dlsmith avatar paulmelnikow avatar qmaurmann avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.