From 519e70f6c162675247933c66d134bd1ec9007ed3 Mon Sep 17 00:00:00 2001 From: Robert Kuykendall Date: Thu, 14 Apr 2016 09:09:00 -0400 Subject: [PATCH] Cleanup and add series name. --- marvelous/__init__.py | 1 - marvelous/comic.py | 17 ++++++++++++++--- marvelous/series.py | 4 +--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/marvelous/__init__.py b/marvelous/__init__.py index 755ee2d..84f4857 100644 --- a/marvelous/__init__.py +++ b/marvelous/__init__.py @@ -32,5 +32,4 @@ def api(public_key=None, private_key=None, cache=False): "not yet on pypi. To install the newest requests-cache, run " "`pip install requests-cache`.") - return Session(public_key, private_key, cached_requests=cache) diff --git a/marvelous/comic.py b/marvelous/comic.py index 91a0199..00b30cd 100644 --- a/marvelous/comic.py +++ b/marvelous/comic.py @@ -24,13 +24,24 @@ class ComicSchema(Schema): issn = fields.Str() format = fields.Str() pageCount = fields.Int(attribute='page_count') - dates = fields.Nested(DatesSchema) + # textObjects + # resourceURI + # urls series = fields.Nested(SeriesSchema) + # variants + # collections + # collectedIssues + dates = fields.Nested(DatesSchema) + # prices + # thumbnail + # images + # creators + # characters + # stories + # events @pre_load def process_input(self, data): - # print data.keys() - # raise hell return data @post_load diff --git a/marvelous/series.py b/marvelous/series.py index 33f840b..5dd79a8 100644 --- a/marvelous/series.py +++ b/marvelous/series.py @@ -20,11 +20,10 @@ class SeriesSchema(Schema): response = fields.Raw() id = fields.Int() resourceURI = fields.Str(attribute='resource_uri') + name = fields.Str() @pre_load def process_input(self, data): - # print data.keys() - if 'status' in data: data['data']['results'][0]['response'] = data data = data['data']['results'][0] @@ -34,5 +33,4 @@ def process_input(self, data): @post_load def make(self, data): - # print data.keys() return Series(**data)