Skip to content

write_package function is way to opinionated #275

@ipimpat

Description

@ipimpat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions