pyparsley/README

33 lines
1009 B
Plaintext
Raw Normal View History

2009-03-05 02:16:41 +00:00
ABOUT
2009-03-06 23:31:07 +00:00
Python 2.x bindings for Parsley. Tested with Python 2.5 and 2.6.
2009-03-05 02:16:41 +00:00
INSTALLATION
= Get Parsley and Dependancies =
Download Parsley from http://github.com/fizx/parsley/tree/master following the installation directions located at http://github.com/fizx/parsley/blob/master/INSTALL
2009-03-06 23:31:07 +00:00
For Python 2.5, the simplejson library is required. For Python 2.6 and later, the stdlib json library is used.
2009-03-05 02:16:41 +00:00
= Install pyparsely =
sudo python setup.py install
= Example Code =
from pyparsley import PyParsley
parselet = PyParsley({
"title": "title",
"links(a)": [
{
"name": ".",
"href": "@href"
}
]
})
json_string = parselet.parse(file = some_file, output = "json")
# Using Parsley's builtin URI fetching.
json_string = parselet.parse(file = "http://www.example.com/", output = "json")