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

write_package function is way to opinionated #275

Open
ipimpat opened this issue Jan 25, 2025 · 0 comments
Open

write_package function is way to opinionated #275

ipimpat opened this issue Jan 25, 2025 · 0 comments

Comments

@ipimpat
Copy link

ipimpat commented Jan 25, 2025

The current implementation of the write_package function in frictionless-r is too restrictive, as it couples the writing of the descriptor file and the resources. This design limits flexibility and adds unnecessary friction to workflows requiring customized output.

Limitations:

  1. Hardcoded Descriptor File Name:
    write_package always writes the descriptor file as datapackage.json, without allowing file name customization.

  2. No YAML Support:
    Descriptors can only be written in JSON format, personally I prefer YAML over JSON for descriptor files.

  3. Resource Path Restrictions:
    Resources are always written to the base directory, with no way to specify custom paths for individual resources.

Proposed Solution:

Refactor the functionality by splitting it into two distinct functions:

  1. write_package() - A function responsible only for writing the descriptor file in either JSON or YAML.
  2. write_resource() - Export a new function dedicated to writing individual resources.
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