Skip to content

Commit

Permalink
Merge pull request #67 from Coleridge-Initiative/1_2_0
Browse files Browse the repository at this point in the history
prep 1.2.0 release
  • Loading branch information
ceteri authored Apr 1, 2020
2 parents 316e47d + f2f892c commit aae0d18
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ title = "Deal or no deal? The prevalence and nutritional quality of price promot
# run it...
if source.has_credentials():
meta, timing, message = source.title_search(title)
response = source.title_search(title)
# report results
if message:
if response.message:
# error case
print(message)
print(response.message)
else:
print(meta)
source.report_perf(timing)
print(response.meta)
source.report_perf(response.timing)
```


Expand Down
6 changes: 4 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

## 1.2.0

2020-0?-??
2020-04-01

- wrapped most API results in response objects
- *THIS RELEASE WILL BREAK MANY THINGS*

- wrapped API results in response objects (except not RePEc)

- `title_search()` for REPEC, Crossref, Pubmed fails more gracefully

Expand Down
18 changes: 9 additions & 9 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@

# run it...
if source.has_credentials():
#meta, timing, message = source.title_search(title)
meta, timing, message = source.full_text_search(search_term, limit=13, exact_match=False)
responses = source.full_text_search(search_term, limit=13, exact_match=True)

# report results
if message:
# error case
print(message)
else:
print(json.dumps(meta, indent=4, ensure_ascii=False))
# report results
if responses[0].message:
# error case
print(responses[0].message)
else:
for r in responses:
print(json.dumps(r.meta, indent=4, ensure_ascii=False))

# report performance
source.report_perf(timing)
source.report_perf(responses[0].timing)

if enable_profiling:
schol.stop_profiling(pr)

0 comments on commit aae0d18

Please sign in to comment.