Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

configurable outputs formats - zip, sqlite, more... #17

Closed
9 of 11 tasks
zelima opened this issue Sep 7, 2017 · 1 comment
Closed
9 of 11 tasks

configurable outputs formats - zip, sqlite, more... #17

zelima opened this issue Sep 7, 2017 · 1 comment
Assignees
Milestone

Comments

@zelima
Copy link
Contributor

zelima commented Sep 7, 2017

We need to export data into a zip, sqlite, other rel db, etc... if requested

Extras:

Analysis

Current request from CLI is following

{
  meta: { owner: ..., ownerid: ..., dataset: ..., version: ... }
  inputs: [ {kind: datapackage, url: ..., parameters: { ... }} ]
}

The new request may include outputs parameters. By default, outputs always contain "csv" and "json" so the previous request did not need to include it (only for tabular).

Outputs is the list of formats ("kinds") to export data to. Eg new request may look like this:

{
  meta: { owner: ..., ownerid: ..., dataset: ..., version: ... }
  inputs: [ {kind: datapackage, url: ..., parameters: { ... }} ]
  outputs: [ {kind: zip, paramaters: {out-file: my-awsome.zip }}, {kind: sqlite}, etc..] 
}

available kinds, parameters and defaults

kinds: sqlite, zip, rdbms

dump.to_sql needs the following parameters:

parameters: {
'tables': {
  'tablename': {
    'resource-name': 'sample-resource',
    }
 }
}
}

parameters for sqlite: None for now

parameters for zip:

  • out-file: optional #defaults to <<dataset-name>>.zip

parameters for rdbms: ????

  • file-name: optional #defaults to <<dataset-name>>.db
  • resource-names: [resource-one, reource-two] # required
  • engine: 'DB URI'
  • credentials: {accecckey: ..., secret_key}
    • why would somebody ever want to provide credentials for us?
## Specifications

```yaml
meta:
  owner: <owner username>
  ownerid: <owner unique id>
  dataset: <dataset name>
  version: 1
  findability: <published/unlisted/private>
inputs:
  -  # only one input is supported atm
    kind: datapackage
    url: <datapackage-url>
    parameters:
      resource-mapping:
        <resource-name-or-path>: <resource-url>
outputs: // backend has some rule about what is auto-added for you e.g. csv and json is always there for tabular input
  -
    kind: csv 
  -
    kind: json
    resources: '2017-data'
  -
    kind: rdbms  (dump.to_sql)
    parameters:
      engine: <pointer to ...>
  -
    kind: sqlite (dump.to_sql)
  -
    kind: npm  (New processor (not yet implemented))
    parameters:
      credentials: <pointer to ...>
-
    kind: zip (dump.to_zip)
    parameters: 
        out-file: name of the file

@zelima
Copy link
Contributor Author

zelima commented Mar 8, 2018

FIXED. While there's only zip supported as output, closing as we decided to polish the existing product and hold on new features

@zelima zelima closed this as completed Mar 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants