Skip to content

imbugsocks/json_to_model

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON to model

Build Status PyPI version

Convert JSON api to Objective-C and Swift model source files.

Got tired of writing models and JSON parsers? Then generate them automatically!

Please consider contributing code. Please send me bug reports and issues.

usage

Suppose you have a json file input/comment.json:

{
    "__class__": "User",
    "username": "Alice",
    "age": 17,
    "email": "[email protected]",
    "registered": true
}

Run:

pip install json_to_model
json_to_model -i input/ -o output/ -l objc

You'll get:

~/models/User.h
~/models/User.m

All properties and init methods and helper methods for JSON convertion are also generated. null is handled. Other classes on the properties, arrays will also be converted recursively.

See examples for how it works.

About

iOS ORM via Code Generation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 34.4%
  • Objective-C 33.7%
  • Swift 31.6%
  • Shell 0.3%