From 165efa4ff0747bf4d1d6ee99148848789094f12b Mon Sep 17 00:00:00 2001 From: fitnr Date: Wed, 18 Feb 2015 15:53:09 -0500 Subject: [PATCH] expand readme --- README.md | 39 +++++++++++++++++++++++++++++- nyplcollections/nyplcollections.py | 1 + 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 593844b..26ea12d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,41 @@ nypl-digital-collections ======================== -Library to access the New York Public Library's Digital Collections API \ No newline at end of file +Library to access the New York Public Library's [Digital Collections API](http://api.repo.nypl.org). + +Basics: + +````python +from nyplcollections import NYPLsearch + +# Create search object +nypl = NYPLsearch(API_KEY) +```` + +Methods: +* NYPLsearch.captures +* NYPLsearch.mods +* NYPLsearch.search +* NYPLsearch.uuid + +Search: + +````python +cats = self.nypl.search('cats') + +cats.results +# [...] +```` + +MODS: + +````python +# Get a MODS record based on uuid +mods = nypl.mods('acfeeb2d-7c5e-4ce7-e040-e00a180644aa') + +mods.status_code +200 + +mods.results +# {...} +```` diff --git a/nyplcollections/nyplcollections.py b/nyplcollections/nyplcollections.py index 4041416..322a8eb 100644 --- a/nyplcollections/nyplcollections.py +++ b/nyplcollections/nyplcollections.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import requests + class NYPLsearch(object): def __init__(self, token, page=None, per_page=None):