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

Resource API feedback #19

Closed
roll opened this issue Jul 6, 2017 · 2 comments
Closed

Resource API feedback #19

roll opened this issue Jul 6, 2017 · 2 comments

Comments

@roll
Copy link
Member

roll commented Jul 6, 2017

Overview

Based on this readme listing I'm adding feedback based on existent implementations and expected lib user competencies (as we target many almost non-tech users - publisher, data wranglers etc).

use frictionlessdata\datapackage;

// add a resource - will raise exception in case of validation error for the new descriptor
$resource = Factory::resource((object)[
    "name" => "new-resource", "data" => ["tests/fixtures/foo.txt", "tests/fixtures/baz.txt"]
])
$datapackage->addResource($resource);

General

See - #18

Resource properties

Implementations reference provides some useful properties (https://github.com/frictionlessdata/implementations):

  • resource.tabular -> true if resource is tabular
  • resource.table -> to access tableschema.Table for tabular resource
  • source/source_type (this two are still under consideration)
@OriHoch
Copy link
Collaborator

OriHoch commented Jul 30, 2017

getting the underlying table object is possible, for each data stream (each data stream object corresponds to a path or data element)

// get the tableschema table object for the first path
$table = $resource->dataStreams()[0]->table

I'll add a comment to #22 to add this detail to the README

@OriHoch
Copy link
Collaborator

OriHoch commented Jul 30, 2017

fixed the general comments in v0.1.4
see the README for the updated usage examples

opened an issue to add the additional properties / methods to Resource object: #23

@OriHoch OriHoch closed this as completed Jul 30, 2017
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

2 participants