Skip to content

Data Package and Data Resource Workflow #1060

Closed Answered by gabrielbdornas
jikaczmarski asked this question in Q&A
Discussion options

You must be logged in to vote

Maybe, as @nichtich, I don't fully understand your use case as well, but the transformation from the full datapackage.json to individual resources could also be done with frictionless python library. I'm using the frictionless 5.18.0 version in the example below:

from frictionless import Package

package = Package('datapackage.json')

for resource_name in package.resource_names:
    resource = package.get_resource(resource_name)
    resource.to_json(f'{resource.name}.json')

It will create a .json file for each resource.

I also created this reprex with the full code.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jikaczmarski
Comment options

Answer selected by jikaczmarski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants