Giter Club home page Giter Club logo

cereal's People

Contributors

modul avatar

Watchers

 avatar

Forkers

destag

cereal's Issues

Python package

Make an installable Python tool out of this with defined requirements to all serialization modules (pyyaml so far).

explicit input and output file formats

It might be a good idea to explicitely set the input and/or output file format using a commandline option.

The output file name could then be derived from the input file name (replacing the file extension).

It should still be possible to supply an output file name and determine the file format from the file extensions of both, input and output, file names.

add support for Multi-Document YAML

Multiple documents can be defined in a single YAML file. These can be translated into a list of objects in any output format.

For a first iteration just load all documents (yaml.safe_load_all) and emit a single object if the input file only contains one document. Emit multiple documents as a list.

make output file optional

The output file name can be derived from the input file name and the selected output format (if #3 is implemented).

Either one must be present on the commandline: output file name or output file type.

add support for CSV

This might not work for nested objects or lists.

Commandline flags must be used to choose between rows-first and columns-first serialization.

When converting from CSV rows-first would serialize to a list of rows at the root level containing each column as an object. This probably only works with a valid column header. Without a header, a row can only be serialized as a list.

Columns-first would serialize to an object at the root level containing where each field corresponds to a column. Each column would be serialized as a list. This also requires a valid column header.

When converting to CSV the root level object keys would be used as a column header.
A list at the root level would be converted into rows. For this to work, all list items must have the same structure. This might not be practical at all.

New commandline options:

  • --rows-first or --by-row
  • --columns-first or --by-column
  • --delimiter if it cannot be detected automatically

When selecting input/output formats is possible (see #3), it might be a good idea to only allow CSV as an input format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.