-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Milestone
Description
User stories:
- As a publisher I want to simply and quickly build a data package for my dataset
- so I don't need to know about data packages. [completely new to Data Packages]
- so I don't need to build it by myself [Data Package experts]
- As a publisher I want to add a resource to an existing data package so that it is included
Stuff to look at: https://github.com/frictionlessdata/datapackage-read-js/blob/master/datapackage-read.js#L15
Proposal
We can have a $ data init command that builds a datapackage.json file
Acceptance criteria
- I can run
$ data initand get a Data Package initialized-
datapackage.jsoncreated with minimal properties + selected resources
-
Tasks
- analyse algorithm and split into separate functions [1h]
-
promptFunction+ tests [1h] -
scanDirfunction + tests [1h] -
addResourcefunction + tests [2h] -
initfunction + tests [2h] - binary function + help [30m]
Analysis
$ data init -h prints out nice descriptions about the command + about dp properties we are going to generate.
Algorithm:
Publisher runs data init:
- check if datapackage.json exists in cwd
- YES - ask if we should overwrite (not overwrite but extend)
- NO - create new one
- prompt for dp name, title
- provided
- valid -> proceed
- invalid -> warn publisher and prompt again
- not provided
- already exists -> proceed with old one
- does not exist -> warn publisher and prompt again
- provided
- starting from current directory for each file or directory ask: (for file) shall we add? For directory: shall we search?
- Then recurse
- generate/update a datapackage.json file
- print a success message
shall we add following file "filename.ext"?
shall we scan following directory "foldername"?
shall we add ...?
...
ident = parseIdentifier(...)
// check it exists ...
dp = DataPackage.load(identifier.dataPackageJsonUrl || {})
inquirer work using the existing data for prompts
- Error out if exists and create from nothing
- Allow for existing and update appropriately
- Allow for explicit adding of resources
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels