ciaranmccormick / python-bods-client

A python client for the Bus Open Data Service API
MIT License
21 stars 3 forks source link

Add Siri Pydantic models #17

Closed ciaranmccormick closed 2 years ago

ciaranmccormick commented 2 years ago

The client currently returns an XML byte string.

In a future update I would like to start returning python objects. This will require the XML byte string to be parsed. To do this I'm using a combination of pydantic and lxml.

I've included tests with various response types.

This change requires the addition of lxml as a dependency.

codecov-commenter commented 2 years ago

Codecov Report

Merging #17 (9aa40d9) into main (5d699bd) will increase coverage by 1.24%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
+ Coverage   95.71%   96.96%   +1.24%     
==========================================
  Files           8        9       +1     
  Lines         257      362     +105     
  Branches       46       61      +15     
==========================================
+ Hits          246      351     +105     
  Misses          9        9              
  Partials        2        2              
Impacted Files Coverage Δ
bods_client/models/__init__.py 100.00% <100.00%> (ø)
bods_client/models/siri.py 100.00% <100.00%> (ø)

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 5d699bd...9aa40d9. Read the comment docs.