williamgilpin / pypdb

A Python API for the RCSB Protein Data Bank (PDB)
MIT License
309 stars 77 forks source link

[API Refactor / Update] - Factored out HTTP Methods into separate file, added tests #20

Closed lacoperon closed 3 years ago

lacoperon commented 3 years ago

I factored the HTTP methods out of pypdb.py, so they can be reused in API implementations.

I also added tests to verify behaviour is as expected, using the unittest and mock python standard libraries.

Also, apologies for the insignificant whitespace changes; I formatted pypdb.py to conform to PEP8 by accident.

lacoperon commented 3 years ago

After this pull request, I should pretty quickly be able to write PyPDB clients against RCSB's various APIs.

For example, I reckon I'll probably be able to take a stab at implementing the new Search API, maybe by the end of the week.

(We can use this to restore BLAST / structure / text search functions. We might want to deprecate older functions eventually so the new PyPDB API mirrors the RCSB API, but not before the replacements are ready and warning has been given).

williamgilpin commented 3 years ago

@lacoperon thank you very much