[Updated 2008-02-27, while (drinking late at night) at code4lib 2008, after realizing that these links don't work because unAPI v1 [1] included a change from "uri" as the parameter name to "id". So I'm changing the links to make them work!]
Attached is OPA-0.2. The big new feature is an implicit "wrap" format for all providers, which sucks down all available object formats at once and wraps them all into a JSON structure that looks like the one I described a few days ago [2].
To make it easier to try out, I've installed OPA at http://opa.onebiglibrary.net/. Pass it a URI and formats to see it in action for yourself.
For Pubmed records:
For books:
For CiteSeer articles:
For flickr photos (notice that format=wrap will base64.encode() the data and leave the base64=True flag set; also there's a delay built into the flickr calls to ensure the API responds and doesn't get angry, so please be patient :):
If you want to see why the json-wrapping is useful, copy the text output of any of those format=wrap calls into a string in your favorite language and eval it into proper data using a json parser. It's a little nesty, but under the item and then under the item's resources ('res') you'll see all the data, right there, iterable and renderable. The whole blob could be easily up-cast into a MPEG21 DIDL or METS bundle, or you could serve images or other binary data right out of it by base64.decode()ing the data value.
| Attachment | Size |
|---|---|
| opa-0.2.tar.gz [22] | 31.03 KB |
Links:
[1] http://unapi.info/specs/
[2] http://onebiglibrary.net/project/mpeg21-didl-in-json-sorta
[3] http://opa.onebiglibrary.net/?id=info:pmid/12345678
[4] http://opa.onebiglibrary.net/?id=info:pmid/12345678&format=pubmed
[5] http://opa.onebiglibrary.net/?id=info:pmid/12345678&format=text
[6] http://opa.onebiglibrary.net/?id=info:pmid/12345678&format=asn1
[7] http://opa.onebiglibrary.net/?id=info:pmid/12345678&format=wrap
[8] http://opa.onebiglibrary.net/?id=urn:isbn:0596002815
[9] http://opa.onebiglibrary.net/?id=urn:isbn:0596002815&format=dc
[10] http://opa.onebiglibrary.net/?id=urn:isbn:0596002815&format=mods
[11] http://opa.onebiglibrary.net/?id=urn:isbn:0596002815&format=amazon
[12] http://opa.onebiglibrary.net/?id=urn:isbn:0596002815&format=wrap
[13] http://opa.onebiglibrary.net/?id=oai:CiteSeerPSU:1234
[14] http://opa.onebiglibrary.net/?id=oai:CiteSeerPSU:1234&format=oai_dc
[15] http://opa.onebiglibrary.net/?id=oai:CiteSeerPSU:1234&format=oai_citeseer
[16] http://opa.onebiglibrary.net/?id=oai:CiteSeerPSU:1234&format=wrap
[17] http://opa.onebiglibrary.net/?id=http://flickr.com/photos/dchud/100544935/
[18] http://opa.onebiglibrary.net/?id=http://flickr.com/photos/dchud/100544935/&format=dc
[19] http://opa.onebiglibrary.net/?id=http://flickr.com/photos/dchud/100544935/&format=mods
[20] http://opa.onebiglibrary.net/?id=http://flickr.com/photos/dchud/100544935/&format=jpeg_Original
[21] http://opa.onebiglibrary.net/?id=http://flickr.com/photos/dchud/100544935/&format=wrap
[22] http://onebiglibrary.net/files/opa-0.2.tar.gz