This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Turns a JSON document into a struct for rust-lang

Installation

From the project root directory:

$ python setup.py install

Or:

$ pip install json2rust

Usage

Simply run it with the name of the root struct and the path to your JSON:

$ json2rust MyStruct data.json

Use –help/-h to view info on the arguments:

$ json2rust --help

Example

Take your JSON doc:

$ cat testdata/example.json
{
        "name": "Me",
        "age": 33,
        "children": [
                {
                        "name": "joe",
                        "age": 0.5,
                        "exists": false
                }
        ],
        "job": {
                "employer": "foo",
                "salary": 5000000,
                "coworker": null
        }
}

Run json2rust:

$ json2rust ExampleStruct testdata/example.json
pub struct ExampleStruct {
        pub job: Job,
        pub age: i32,
        pub name: String,
        pub children: Vec<Children>,
}
pub struct Job {
        pub salary: i32,
        pub coworker: Option<UNKNOWN_NULL>,
        pub employer: String,
}
pub struct Children {
        pub age: f32,
        pub name: String,
        pub exists: bool,
}

Release Notes

0.1.0:Project works
0.0.1:Project created
Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
json2rust-0.1.1.tar.gz (5.0 kB) Copy SHA256 Checksum SHA256 Source Mar 29, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting