• English Blog
  • 日本語ブログ

Ian Lewis' Blog

An Ounce of Perception, A Pound of Obscure
  • Home
  • About
  • Book List
  • Calendar
  • Projects
  • Photos

jsonschema

2008/08/04 @ 20:27

jsonschema is a validator for JSON Schema written in Python. It's based on the JSON Schema Proposal Second Draft. It supports a number of ways to extend JSONSchema by adding new properties and overriding default validation of existing properties.

Website: http://code.google.com/p/jsonschema
Download: jsonschema-0.1a.tar.gz
Source Code: http://hg.monologista.jp/json-schema
Documentation: jsonschema (version 0.1a) documentation

JSON Schema's purpose is to allow validation of JSON documents much like XML Schema, DTD. You can use it to define what kind of data should be present in the document as well as the structure of the data. You might have some JSON for a contact like so:

{
  "name": "Ian Lewis",
  "email": "IanLewis@xyz.com",
  "address": "123 Main St.",
  "phone": "080-1942-9494"
}

And you could describe this in JSON Schema with the following:

{
  "type":"object",
  "properties":{
    "name": {"type":"string"},
    "age": {"type":"int", "optional":True},
    "email": {
      "type":"string",
      "pattern":"^[A-Za-z0-9][A-Za-z0-9\.]*@([A-Za-z0-9]+\.)+[A-Za-z0-9]+$"
    },
    "address": {"type":"string"},
    "phone": {"type":"string"}
  }
}

This can be validated with something like the following Python code:

import jsonschema, simplejson

data = """{
  "name": "Ian Lewis",
  "email": "IanLewis@xyz.com",
  "address": "123 Main St.",
  "phone": "080-1942-9494"
}"""

schema = """{
  "type":"object",
  "properties":{
    "name": {"type":"string"},
    "age": {"type":"int", "optional":True},
    "email": {
      "type":"string",
      "pattern":"^[A-Za-z0-9][A-Za-z0-9\.]*@([A-Za-z0-9]+\.)+[A-Za-z0-9]+$"
    },
    "address": {"type":"string"},
    "phone": {"type":"string"}
  }
}"""

x = simplejson.loads(data)
s = simplesjson.loads(schema)
jsonschema.validate(x,s)

It can be easily extended to include support for new properties or to override the default validation for standard properties so I think it could be used for a wide range of applications.

Send feedback »
  Tags: Linux/Unix, Python, Web, Windows

TextTools Plugin

2007/06/16 @ 02:34

The TextTools plugin is a plugin for jEdit that provides a set of actions for manipulating text in a buffer. I have taken over maintenance of the plugin and will be fixing bugs and cleaning up the code moving forward.

Website:http://plugins.jedit.org/plugins/?TextTools
Download:TextTools-1.14-bin.zip
Code:http://jedit.svn.sourceforge.net/viewvc/jedit/plugins/TextTools/
Send feedback »
  Tags: Java, jedit, Plugins

Lightbox Plugin

2007/05/17 @ 15:42
The Lightbox plugin allows you to create posts with links to pictures and display them using Lightbox or Lightbox2. You can view an example of the lightbox plugin above. This release added support for Lightbox2 and some bugs regarding matching of urls in the [lightbox] render string. Matching of urls should be more forgiving especially with relative urls.
Website:http://manual.b2evolution.net/Plugins/lightbox_plugin
Download:lightbox_plugin-1.3.zip
Code:http://evocms-plugins.svn.sourceforge.net/viewvc/evocms-plugins/lightbox_plugin/
1 feedback »
  Tags: PHP, Plugins, Web

Gallery2 Plugin

2007/05/16 @ 23:20

The Gallery2 Plugin is a plugin for the b2evolution blogging platform that enables this site, and any other b2evolution/Gallery2 site to have single sign on between the gallery and b2evolution.

The plugin supports a number of features such as adding Gallery2 photos to b2evolution posts by selecting them with the Gallery2 Image Chooser, adding image block widgets to the blog sidebar (random image, most recent image, daily image and more), and good integration with other plugins such as the TinyMCE plugin and lightbox plugin.

Website: http://manual.b2evolution.net/Plugins/gallery2_plugin
Download: gallery2_plugin-1.4.zip
Code: http://evocms-plugins.svn.sourceforge.net/viewvc/evocms-plugins/gallery2_plugin/
Send feedback »
  Tags: b2evolution, PHP, Plugins, Web

jsXe

2003/05/16 @ 21:09

jsXe is the Java Simple XML Editor.

jsXe is a fast, intuitive, scalable, platform-independent XML editor. It is written in Java using the Swing toolkit, and Xerces-J and is released under the terms of the GNU General Public License. It aims to provide end users and developers with an intuitive way of creating XML documents that is simple enough to deal with any XML document but flexible to allow the addition of support for XML document formats through the use of plugins.

I started jsXe as a project in college and maintained it after college for a number of years. Though after coming to Japan I haven't had much time to maintain it.

Website:http://jsxe.sourceforge.net/
Download:Windows
 Linux/Unix/Mac
Send feedback »
  Tags: inactive, Java, Linux/Unix, Mac, Windows, XML

prefix

2003/05/14 @ 21:57

prefix is a command line calculator that evaluates expressions in prefix notation (polish notation) written in Python. It supports basic arithmetic operations, exponents, and logarithms.

prefix was a hobby project to learn and play around with the Python programming language. It's currently not being maintained.

Website:http://prefix.sourceforge.net/
Download:Windows
 Linux/Unix/Mac
Send feedback »
  Tags: inactive, Linux/Unix, Mac, Python, Windows
1 2 >>
  • Tag cloud

    ajax anki b2evolution c c++ database finance gnome/gtk+ inactive java javascript jedit linux/unix mac php plugins pylons python scheme snipplr web windows xml

  • Search




  • XML Feeds

    • RSS 2.0: Posts, Comments
    • Atom: Posts, Comments
    What is RSS?
  • last.fm Flickr Live Journal del.icio.us Yahoo Amazon Facebook Sourceforge Notebook Twitter LinkedIn! Meetup!

powered by b2evolution free blog software


Contact | Powered by b2evolution
Credits: Foppe Hemminga | evoCore | vps hosting | François