This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Import a json file as a fully functional module with classes, inheritance, attributes, properties and constraints

Project Description

It is sometimes useful to be able to use json data to initialise classes and other data structures, giving your application a portable and human readable configuration capability. To do this you will probably write some level of functionality around the json standard library, and use the resulting data loaded from the json file, to populate classes and instances implemented in your application. This separates your data and functionality, which can often present challenges later down the line as you need to keep the data and functionality in step. It would be better in many cases to be able to combine the data and functionality in a single place, and with the importjson library you can do that.

The library allows you to import a json file direct into your python application, and automatically build a real python module, complete with classes, class attributes, and instance data attributes (implemented with set and get descriptors).

Your code can use these classes, attributes and methods just as if you have written the code yourself.

The importjson library also allows you to set constraints on your instance attributes, checking for the data type and simple range checks on the values your attempt to set when you create instances of the classes. You can also determine whether attributes are read only, or whether they will be allowed to be set to None (or not).

See the full documentation for examples of how to use the library and how to format the json file.

Bugs
Every care is taken to try to ensure that this code comes to you bug free. If you do find an error - please report the problem on : GitHub or by email to : Tony Flury
Release History

Release History

This version
History Node

0.1.0

History Node

0.0.1a8

History Node

0.0.1a7

History Node

0.0.1a6

History Node

0.0.1a5

History Node

0.0.1a4

History Node

0.0.1a3

History Node

0.0.1a2

History Node

0.0.1a1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
importjson-0.1.0-py2.py3-none-any.whl (12.2 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Aug 24, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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