gtalarico / pyairtable

Python Api Client for Airtable
https://pyairtable.readthedocs.io
MIT License
765 stars 138 forks source link

Typed support for reading and writing schema metadata #311

Closed mesozoic closed 10 months ago

mesozoic commented 11 months ago

This branch builds upon the AirtableModel base class (see #282) to add support for base, table, and field metadata. It supports reading many common metadata endpoints (though not all yet).

This branch has limited support for making schema changes: it exposes APIs which accept raw dict data structures, but does not validate the input or offer a clean way to construct complex schema changes in-memory. Such support could be added in future, but it seemed unnecessary for now because the API will reject invalid values and their construction is straightforward.

New API endpoints and classes introduced:

There are quite a few new classes introduced in pyairtable.models.schema that I won't enumerate here. The API documentation generated for the pull request lists them all in detail.

Other changes:

Breakdown of commits:

Resolves #208, resolves #235, resolves #237.

codecov[bot] commented 11 months ago

Codecov Report

Merging #311 (1bbaad6) into main (308c269) will increase coverage by 3.49%. Report is 2 commits behind head on main. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
+ Coverage   96.11%   99.60%   +3.49%     
==========================================
  Files          21       24       +3     
  Lines        1157     1791     +634     
==========================================
+ Hits         1112     1784     +672     
+ Misses         45        7      -38     
Files Coverage Δ
pyairtable/__init__.py 100.00% <100.00%> (ø)
pyairtable/_compat.py 100.00% <ø> (+37.50%) :arrow_up:
pyairtable/api/api.py 100.00% <100.00%> (+2.43%) :arrow_up:
pyairtable/api/base.py 100.00% <100.00%> (+12.19%) :arrow_up:
pyairtable/api/enterprise.py 100.00% <100.00%> (ø)
pyairtable/api/params.py 100.00% <ø> (ø)
pyairtable/api/retrying.py 100.00% <ø> (ø)
pyairtable/api/table.py 100.00% <100.00%> (+1.83%) :arrow_up:
pyairtable/api/types.py 100.00% <ø> (ø)
pyairtable/api/workspace.py 100.00% <100.00%> (ø)
... and 10 more