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):