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

Spec compliance #3

Closed
simleo opened this issue Mar 30, 2017 · 3 comments
Closed

Spec compliance #3

simleo opened this issue Mar 30, 2017 · 3 comments
Assignees
Milestone

Comments

@simleo
Copy link
Member

simleo commented Mar 30, 2017

In our data package examples we should ensure compliance with the specs at https://specs.frictionlessdata.io/data-package. For instance, "name": "objectsTable" is not valid because "name" cannot contain uppercase characters, so the value might be changed to "objects_table". Validity can be checked with:

import datapackage
datapackage.DataPackage("datapackage.json").validate()

And here's the error for the above case:

ValidationError: u'objectsTable' does not match u'^([a-z0-9._-])+$'

Failed validating u'pattern' in schema[u'properties'][u'resources'][u'items'][u'properties'][u'name']:
    {u'description': u"An identifier for this package. Lower case characters with '.', '_' and '-' are allowed.",
     u'pattern': u'^([a-z0-9._-])+$',
     u'title': u'Name',
     u'type': u'string'}

On instance[u'resources'][0][u'name']:
    u'objectsTable'

Ensuring that generated data packages will be compliant is trickier, because we'd need to perform the same checks that datapackage does on configuration files etc. Rather, it should be the user's responsibility to check that any setting that will end up in a restricted data package field is compliant with the corresponding specs.

@danfowler
Copy link

@simleo there's an open discussion on this: frictionlessdata/datapackage#463

@simleo
Copy link
Member Author

simleo commented Jun 29, 2017

@danfowler thanks! Another thing I'm wondering about is whether there is a way to know which version of the specs a given version of the Python API is implementing (and if older specs are still available).

@danfowler
Copy link

@simleo thanks for raising the issue: frictionlessdata/datapackage-py#149

@roll is the best one to answer this

@simleo simleo mentioned this issue Jul 7, 2017
@sbesson sbesson closed this as completed Jul 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants