IDigBio API v1 Examples: Difference between revisions

add simplejson →‎simplejson
(show link to CPAN →‎json_pp)
(add simplejson →‎simplejson)
Line 68: Line 68:
</pre>
</pre>


==== simplejson ====
==== simplejson (Python) ====


Some older systems may not include json_pp or python's json.tool. The python simplejson package may solve this problem. Older versions of python also may require a more complicated syntax to invoke the module from the command line.
If a Python installation is misssing the json standard library, the separate simplejson package may solve the problem.
 
Install the Python simplejson module on Debian / Ubuntu Linux with:
 
<pre>
$ sudo apt-get install python-simplejson
</pre>
 
Install the Python simplejson on Red Hat / CentOS Linux with:
 
<pre>
$ # log in as root or use sudo
$ yum install python-simplejson
</pre>
 
The simplejson.tool module can be invoked in the same way as json.tool:
 
<pre>
$ curl -s http://api.idigbio.org/ | python -m simplejson.tool
{
    "check": "http://api.idigbio.org/check",
    "v0": "http://api.idigbio.org/v0/",
    "v1": "http://api.idigbio.org/v1/"
}
</pre>
 
Older versions of python also may require a more complicated syntax to invoke the module from the command line.


<pre>
<pre>
1,554

edits