Coder Social home page Coder Social logo

car-to-schema's Introduction

@rvagg/car-to-schema

Read a CAR file and describe its blocks using IPLD Schemas.

Usage

Install

$ npm install @rvagg/car-to-schema -g

Run

$ car-to-schema <path-to-CAR-file> --output=<output/dir>

Unqiue found schemas will be printed to stdout as well as written to files in the current working directory named schema_X.ipldsch (the human-readable text form), where X is the unique schema number. A schema_summary.csv will also be written with a mapping of the schema to the number of blocks found matching that schema.

Options:

  • --library=<schema/library/dir> - provide a path to a directory containing an existing library of schemas, see below.
  • --novel-out=<path/to/out.car> - write out a new car containin only blocks that don't match schemas in the library. This can be used when authoring the library of schemas and you are narrowing down to just the blocks that are not recognised.

Library

If you have existing Schemas to match against, supply a directory path with --library and the Schemas found in that directory will be included in the matching process. Schema files should end with .ipldsch (or the object form can be .json).

The name of each Schema file in the library directory should be the name of the root type in the Schema. e.g. A Schema Schema describing the DAG-PB structure might be named PBNode.ipldsch and include a type PBNode. This type will be matched against the root found in the block.

Limitations

Currently only supports the following codecs for blocks:

  • DAG-CBOR
  • DAG-JSON
  • DAG-PB
  • raw
  • json

See also the Limitations section of ipld-schema-describer for the limitations of Schema inference on objects.

License & Copyright

Copyright 2020 Rod Vagg

Licensed under Apache 2.0 (LICENSE-APACHE / http://www.apache.org/licenses/LICENSE-2.0)

car-to-schema's People

Contributors

rvagg avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

jonnycrunch

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.