Webodm: Python Bindings

Created on 14 Feb 2017  Â·  13Comments  Â·  Source: OpenDroneMap/WebODM

It would facilitate adoption if there were Python bindings to access the API.

help wanted improvements

All 13 comments

I'm thinking about creating a Python Client (for accessing and using the api) for WebODM. And even a Django Package after that, with Login and Host configuration in the settings.

Help would be appreciated, if anyone is interested :)

This would be awesome. I'd be happy to help (answering questions about the API, reviewing code, testing, providing feedback).

@pierotofy would you be willing to create the project inside OpenDroneMap organization in github, or should I start it under my own?

@smathermather would be the right person to answer this.

I created it in my own so I could start developing: https://github.com/rmallermartins/python-WebODM. @pierotofy I already have some questions about the API, should I ask them here?

Awesome. Yes you can ask here!

On Aug 20, 2017, at 11:08 AM, Rodrigo Maller Martins notifications@github.com wrote:

I created it in my own so I could start developing: https://github.com/rmallermartins/python-WebODM. @pierotofy I already have some questions about the API, should I ask them here?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Nice, will start with some then :)

1. Are there Endpoints to retrieve, for example, one Project like "GET /api/projects/{id}"? _I don't see any in docs, just listing with filters_
2. Do Create, Update, Delete, etc... have json content on responses? _Like Create returning the created Project fields, not well documented too_
3. What the API returns when my auth Token has expired?
4. Is there a pattern for returning errors? _Like both "required" and "Unable to login" returns with status_code 400. If it is the only code that return errors with, and if theses errors have some kind of pattern, or it depends on each API point?_

Ps: sorry if my English is rusty

Edit

I know some of these I could find out browsing WebODM code, but I'd be happy if someone else could answer them for me

  1. Yes you can get a single project by accessing /api/projects/{id}/ (don't forget the trailing slash)
  2. Create/Update return the JSON of the updated record. Delete will return status code 204 (no content) when successful. When failed you will either get 401 (unauthenticated), 403 (forbidden), 400 (malformed) or 404 (not found).
  3. You should check for a 403 status code ({'detail': 'Signature has expired.'}).
  4. It follows a pattern http://www.django-rest-framework.org/api-guide/status-codes/ but generally you probably don't need to check for all of them. It's easier to validate the response code with a success (200, 204, etc.) and have an else clause that catches everything else, with special case for 401 (unauthenticated).

Hope this helps!

@rmallermartins We've forked your repo to https://github.com/OpenDroneMap/python-WebODM. If you want to make the OpenDroneMap repo the official repo, simply destroy (via the settings panel) your repository. You should have received commit permissions to do changes directly to the OpenDroneMap repository.

@pierotofy Nice, already did that! Yes, I received permissions from @dakotabenjamin

Guys, 2 problems.

  1. Since the repo changed, Travis and Pyup stopped working and I don't have admin access to enable the process with my account.
  2. I think Issues are disabled in the repo, could someone enable it? So we can start using the project's issues for this kind of thing ;)
  1. I've enabled a travis build for that repo. I'm not too familiar with pyup, so I haven't done anything there yet. @dakotabenjamin would it be possible to grant @rmallermartins the permissions he needs to setup pyup?
  2. I've enabled issues, they should be OK now.

Thanks!

Closing due to lack of interest / PyODM seems the better way to go forward as far as Python support is concerned.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KommandorKeen picture KommandorKeen  Â·  5Comments

tobi-kellner picture tobi-kellner  Â·  6Comments

taue2512 picture taue2512  Â·  5Comments

pierotofy picture pierotofy  Â·  5Comments

keum picture keum  Â·  3Comments