JSON2Mantle
========================
Generate [Mantle](https://github.com/Mantle/Mantle) models using JSON files.
##Quick start
### Install
```
$ sudo pip install JSON2Mantle
```
### Usage
```
$ json2mantle [-h] [--prefix PREFIX] [--author AUTHOR]
json_file output_dir
```
### Example
```
$ json2mantle api_model.json class --prefix XYZ --author "John Smith"
```
will generate Mantle models according to your `api_model.json` structure. The output files will be created under `output_dir` directory, the author name will be `John Smith`, and the Objective-C classes have the prefix `XYZ`.
## Features
* Supports nested JSON data, which means JSON2Mantle can generate the correct number of classes that the JSON file contains.
* Convert field name like `var_name` to `varName` automatically.
* Author name is grabbed from Address Book by default (Python 2 on OS X only).
* Python 2/3 compatible.
* Generated Objective-C files are documented.
## Note
* When reserved words in Objective-C appear, it will replace the original name with a prefix `model`. For instance, if you have a field with the name `id`, the generated one would be `modelId`.
* Only supports generating Objective-C files.
* If the input JSON file is an array, it will ask you to give a name for the array items.
## TODO
- [ ] reserved words
- [ ] URL type
- [ ] Unit test
## License
The MIT License (MIT)
========================
Generate [Mantle](https://github.com/Mantle/Mantle) models using JSON files.
##Quick start
### Install
```
$ sudo pip install JSON2Mantle
```
### Usage
```
$ json2mantle [-h] [--prefix PREFIX] [--author AUTHOR]
json_file output_dir
```
### Example
```
$ json2mantle api_model.json class --prefix XYZ --author "John Smith"
```
will generate Mantle models according to your `api_model.json` structure. The output files will be created under `output_dir` directory, the author name will be `John Smith`, and the Objective-C classes have the prefix `XYZ`.
## Features
* Supports nested JSON data, which means JSON2Mantle can generate the correct number of classes that the JSON file contains.
* Convert field name like `var_name` to `varName` automatically.
* Author name is grabbed from Address Book by default (Python 2 on OS X only).
* Python 2/3 compatible.
* Generated Objective-C files are documented.
## Note
* When reserved words in Objective-C appear, it will replace the original name with a prefix `model`. For instance, if you have a field with the name `id`, the generated one would be `modelId`.
* Only supports generating Objective-C files.
* If the input JSON file is an array, it will ask you to give a name for the array items.
## TODO
- [ ] reserved words
- [ ] URL type
- [ ] Unit test
## License
The MIT License (MIT)
Metadata
Release files for JSON2Mantle 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| JSON2Mantle-0.0.9.tar.gz | 7.3 kB | Details |
Release files / JSON2Mantle-0.0.9.tar.gz
| Download URL | JSON2Mantle-0.0.9.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d46f37ed2b64a57b8cf01129591be0a9f7270d1ce19668d66cabf6b5c368351f
|
|
BLAKE2b-256 checksum How to use checksums |
531997dcb1bf6cd29a1ae630b48390a308c40d110e35f1a8ee5663cf752b9754
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |