Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a machine-readable data schema using data packages #10

Open
vitorbaptista opened this issue Oct 12, 2018 · 0 comments
Open

Provide a machine-readable data schema using data packages #10

vitorbaptista opened this issue Oct 12, 2018 · 0 comments

Comments

@vitorbaptista
Copy link

A data package is a lightweight standard to describe tabular data. In it's simplest form, it's a datapackage.json file like:

{
  "name": "big-mac-data",
  "description": "Lorem ipsum",
  "resources": [
    {
      "name": "big-mac-full-index",
      "path": "output-data/big-mac-full-index.csv",
      "schema": {
        "fields": [
          {
            "name": "date",
            "type": "date",
            "constraints": {
              "required": true
            }
          },
          // ...
        ]
      }
    }
  ]
}

You can see a full example of a data package at https://github.com/vitorbaptista/birmingham_schools.

There are multiple libraries that understand this format, for example https://github.com/frictionlessdata/goodtables-py allows the data to be validated by running goodtables datapackage.json (this can even be run automatically using https://goodtables.io/), https://github.com/frictionlessdata/datapackage-py allows loading the data in Python (automatically validating and casting the data to their specific types), and there are others for R, JavaScript, Ruby and others.

I'd be happy to talk more about it, and/or write a datapackage.json and send a PR.

(cc @serahrono @pwalsh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant