getodk/pyodk

Design and provide convenience wrapper for getting all submission data

Opened this issue · 1 comments

Currently client.submissions.get_table has an interface that closely matches the backend API and it returns a dictionary that matches the structure of the raw JSON.

Some high-level things to consider for the parameters:

  • make it easier to specify a date range to filter submissions by
  • make it easier to specify a list of review states to include
  • unify json and csv downloads -- they're not very different from a user perspective
  • pull media if a path to store it is specified
  • add the Submissions. prefix for repeats (see repeats example)

Ideally the result could use type information in some way. Some ideas we've discussed:

  • provide a companion endpoint to get types and document how to get that into pandas
  • return json['value']: that would be the naturally-expected json structure
  • return a normalized and typed pandas dataframe (downside: lib depends on pandas)
  • deserialize into dynamically generated classes (downside: complex, and is it really what people want?)

@lindsay-stevens: Maybe there's a library that already works with OData.