Skip to content

ODS API querying helpers#116

Merged
murd0 merged 6 commits into
codonlibrary:masterfrom
mirober:ODS
Jan 29, 2020
Merged

ODS API querying helpers#116
murd0 merged 6 commits into
codonlibrary:masterfrom
mirober:ODS

Conversation

@mirober

@mirober mirober commented Jan 27, 2020

Copy link
Copy Markdown
Contributor
  • Please check if the Pull Request fulfills these requirements
  • The commit message is clear and concise
  • Test for the changes have been added and reviewed
  • Documentation has been added to all new features and edited code has had documentation reviewed
  • What kind of change does this Pull request introduce? (Bug fix, feature, docs update, ...)

Adds a couple of new functions for querying the ODS API. The main one, ODS_lookup.get_addresses, can be used to retrieve name and address information for a list of ODS codes as a pandas data frame. e.g.

>>> get_addresses(pd.Series(["X26"]))
              Org_AddrLn1 Org_Code Org_Country     Org_Name Org_PostCode Org_Town
    0  1 TREVELYAN SQUARE      X26     ENGLAND  NHS Digital      LS1 6AE    LEEDS

The api only lets you query for a single code at a time. I don't think making serial requests is going to cause a major performance issue but it might for very large requests. Could investigate async requests if necessary.

@mirober mirober changed the title Ods ODS API querying helpers Jan 27, 2020
@codecov

codecov Bot commented Jan 27, 2020

Copy link
Copy Markdown

Codecov Report

Merging #116 into master will increase coverage by 1.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #116      +/-   ##
==========================================
+ Coverage    87.7%   88.74%   +1.03%     
==========================================
  Files          26       28       +2     
  Lines         553      604      +51     
==========================================
+ Hits          485      536      +51     
  Misses         68       68
Impacted Files Coverage Δ
codonPython/tests/ODS_test.py 100% <100%> (ø)
codonPython/ODS_lookup.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8211d6d...8aa0f7e. Read the comment docs.

@murd0 murd0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice stuff Mike, really relevant for codon too. Thanks for adding your module to the docs too... It's a bit annoying that that has to be done for every addition. The overhead should be less when we have enough material to make real modules that can be autodoc'd though.

Comment thread codonPython/ODS_lookup.py
Comment thread codonPython/ODS_lookup.py
Comment thread codonPython/ODS_lookup.py

@murd0 murd0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for prompt resolution of the changes.

@murd0 murd0 merged commit 446180c into codonlibrary:master Jan 29, 2020
@mirober mirober deleted the ODS branch January 29, 2020 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants