gtalarico / pyairtable

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

Importing formulas wont work #303

Closed NicoHood closed 1 year ago

NicoHood commented 1 year ago

Alright, this might be super simple, I must miss something obvios:

>>> import pyairtable
>>> pyairtable.formulas.match({"First Name": "John", "Age": 21})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'pyairtable' has no attribute 'formulas'

I am using latest pyairtable 2.1.0.post1

Any ideas?

marks commented 1 year ago

Two options to help you get past this:

a/ import pyairtable.formulas

>>> import pyairtable.formulas
>>> pyairtable.formulas.match
<function match at 0x104ade290>

b/ from pyairtable import formulas

>>> from pyairtable import formulas
>>> formulas.match
<function match at 0x104f7e440>

Edited to add: a meta idea is to look at (integration) tests for sample usage, for example: https://github.com/gtalarico/pyairtable/blob/d5902472671f6f8c17364fb05f7ccceab32ebe8d/tests/integration/test_integration_api.py#L7

NicoHood commented 1 year ago

Thx!