summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Berman <Julian+git@GrayVines.com>2012-01-16 15:10:50 -0500
committerJulian Berman <Julian+git@GrayVines.com>2012-01-16 15:10:50 -0500
commit54e5ae2af7ed40cc52cc6e319bd46015bbca6d73 (patch)
tree3ee72983ce6fa41cfdfc98955305f51c5c4de5be
parenta1db2118b25fd450e1ca34a8174005a5a194fa65 (diff)
downloadjsonschema-54e5ae2af7ed40cc52cc6e319bd46015bbca6d73.tar.gz
Adding a basic readme, some classifiers, and bumped the version.
-rw-r--r--MANIFEST.in1
-rw-r--r--README.rst27
-rw-r--r--jsonschema.py2
-rw-r--r--setup.py23
4 files changed, 52 insertions, 1 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index e32c4c3..0de9757 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,2 +1,3 @@
+include *.rst
include COPYING
include tests.py
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..10bb574
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,27 @@
+==========
+jsonschema
+==========
+
+``jsonschema`` is an implementation of JSON Schema (currently in `Draft 3
+<http://tools.ietf.org/html/draft-zyp-json-schema-03>`_) for Python.
+
+.. code:: python
+
+ >>> from jsonschema import validate
+
+ >>> # A sample schema, like what we'd get from json.load()
+ >>> schema = {
+ ... "type" : "object",
+ ... "properties" : {
+ ... "price" : {"type" : "number"},
+ ... "name" : {"type" : "string"},
+ ... },
+ ... }
+
+ >>> # If no exception is raised by validate(), the instance is valid.
+ >>> validate({"name" : "Eggs", "price" : 34.99}, schema)
+
+ >>> validate({"name" : "Eggs", "price" : "Invalid"}, schema)
+ Traceback (most recent call last):
+ ...
+ ValidationError: 'Invalid' is not of type 'number'
diff --git a/jsonschema.py b/jsonschema.py
index 126b206..4dd9e53 100644
--- a/jsonschema.py
+++ b/jsonschema.py
@@ -26,7 +26,7 @@ import types
import warnings
-__version__ = "0.1a"
+__version__ = "0.2"
try: # pragma: no cover, 2.5 support
next
diff --git a/setup.py b/setup.py
index 7fbcec5..82ffff9 100644
--- a/setup.py
+++ b/setup.py
@@ -1,15 +1,38 @@
+from __future__ import with_statement
from distutils.core import setup
from jsonschema import __version__
+with open("README.rst") as readme:
+ long_description = readme.read()
+
+
+classifiers = [
+ "Development Status :: 3 - Alpha",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 2 :: Only",
+ "Programming Language :: Python :: 2.5",
+ "Programming Language :: Python :: 2.6",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: Implementation :: CPython",
+ "Programming Language :: Python :: Implementation :: PyPy",
+]
+
+
setup(
name="jsonschema",
version=__version__,
py_modules=["jsonschema"],
author="Julian Berman",
author_email="Julian@GrayVines.com",
+ classifiers=classifiers,
description="An implementation of JSON-Schema validation for Python",
license="MIT/X",
+ long_description=long_description,
url="http://github.com/Julian/jsonschema",
)