Git Product home page Git Product logo

xtoproto's Introduction

xtoproto (csvtoproto, xmltoproto, etc.)

xtoproto is a library for automatically (1) inferring a protocol buffer definition (a .proto file) from XML and CSV files, and (2) generating runtime code that translates XML and CSV files to proto using the mappings from (1).

Quickstart

The best way to get started is to try out xtoproto using the interactive, web-based playground hosted on Github.

screenshot of xtoproto playground

More details about how to use xtoproto will be added soon.

Building

The project is buildable with Bazel and go build. Bazel is recommended because the files needed for go build are only present in the release branches of the repository (v0.0.6, v0.0.5, etc.).

bazel build //...

Playground

Try out xtoproto using the interactive, web-based playground hosted on Github. The playground uses a WebAssembly version of xtoproto and does not transmit the input example data to a remote server. Alternatively, you may start the playground on your workstation with this command, then navigate to http://localhost:8888/

bazel run //cmd/xtoproto_web -- --addr ":8888"

Development

gopls does not yet work with bazel. In the meantime, it is convenient to generate the .pb.go files used within this project so that gopls can pick them up and make autocomplete work. To do this, issue the following command from the root of the checked out xtoproto repository:

 bazel run //releasing/generate_pb_go_files -- -output_dir $PWD/proto --alsologtostderr

Releasing

There is a script for generating the release. Run it from the a cloned repository with the following command.

git remote add google  [email protected]:google/xtoproto.git
bazel run //releasing/make_release -- --workspace $PWD --branch_suffix v006c --tag v0.0.6

Disclaimer

This is not an official Google product.

This repository was created on June 29, 2020. We are incrementally migrating the code onto Github, and the project will not be functional until that migration is finished. This README will be updated with instructions about how to use the project once the migration is complete. In the mean time, feel free to browse the code.

xtoproto's People

Contributors

altmas5 avatar dpaukov avatar gonzojive avatar opporancisis avatar reddaly avatar shimopus avatar sushantk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xtoproto's Issues

Mistakes with IRI regular expressions

The code regarding the regular expressions used for rdf/iri contain mistakes:

  • iqueryRE uses ipath instead of iquery, which is thus unused; When replacing it, further mistakes within iquery come to light:
    • iprivate contains an invalid regexp sequence: \x{F0000]-\x{FFFFD} should be \x{F0000}-\x{FFFFD}.
    • iquery is wrongly using "/?" as a sequence; This should be a choice, as in [\/\?].
  • iuserinfo is missing the colon character as per RFC. As such, IRI "https://user:[email protected]" cannot be parsed.
  • h16 regular expression should allow for 1-4 hex digits as per RFC, not require exactly 4 hex digits

As a side-note, the example "http://résumé.example.org", used for testing normalization, is not a properIRI string. The &#xE9 sequence is according to RFC chapter 1.4 the way how non US-ASCII characters are represented within a US-ASCII-only RFC text.
The first # makes the remainder be considered a fragment, which would be invalid because of the second #.

I found these things as I was extracting the package as a separate library, handling all the TODOs (ending up in a large rework), and feeding in many samples from the RFC - especially those about resolving relative IRIs. See https://github.com/contomap/iri .
My rework makes it incompatible with your use in here (different type & behaviour), which is why I collect the mistakes I found only as an issue.

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.