pcorpet / airtable.py Goto Github PK
View Code? Open in Web Editor NEWPython interface to the Airtable's REST API
License: MIT License
Python interface to the Airtable's REST API
License: MIT License
I am not able to understand, in what format should the data be stored, please mention it in the README.rst file clearly.
Hi, I was wondering if you could submit this package to PyPI so that I could add it to my requirements.txt
with the rest of my dependencies? Thanks for this library!
hi,
I have installed your module by doing
"pip install airtable"
that worked fine.
however no module call Airtable is to be found:
from airtable import Airtable
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'Airtable'
what's the issue?
thx
As per API documentation typecast
option to be set as true to add new multiple select array of strings. Can this option be added in the client create
method ?
FieldName: Tags
Type: Multiple select
array of strings
Array of selected option names.
When creating or updating records, if a choice string does not exactly match an existing option, the request will fail with an INVALID_MULTIPLE_CHOICE_OPTIONS error unless the typecast parameter is enabled. If typecast is enabled, a new choice will be created if one does not exactly match.
Code:
at_client = airtable.Airtable("Beta testing", AIRTABLE_TOKEN)
at_client.get("People")
Error:
Traceback (most recent call last): File "/Users/andrasnagy/Desktop/sensae/code_base/projects/slack-app/main.py", line 22, in <module> at_client.get("People") File "/Users/andrasnagy/Desktop/sensae/code_base/projects/slack-app/.venv/lib/python3.11/site-packages/airtable/airtable.py", line 133, in get return self.__request('GET', url, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/andrasnagy/Desktop/sensae/code_base/projects/slack-app/.venv/lib/python3.11/site-packages/airtable/airtable.py", line 107, in __request error_type=error_json.get('type', str(r.status_code)), ^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'get'
I did check the type of "at_client", and as expected, it is of type "<class 'airtable.airtable.Airtable'>". Anyone has seen this issue already?
Hi! Fred here again, from the Airtable API team. Another update is that as part of recent infrastructure improvements to airtable.com, we needed to accelerate enforcement of rejecting any requests whose request URLs exceed 16k characters. The changes described below are in effect today.
/v0/{baseId}/{tableIdOrName}
(https://airtable.com/developers/web/api/list-records)filterbyFormula
is long enough to make the overall URL length to exceed that character limit/v0/{baseId}/{tableIdOrName}/listRecords
, and encode the query params as the body of that POST request. We currently still require two parameters to remain as query params, timeZone
and userLocale
; you can see the full details and examples here: https://support.airtable.com/docs/enforcement-of-url-length-limit-for-web-api-requestsWhen I try to fetch only one field:
airtable().get('People', fields=['Name'])
it will not work:
airtable.airtable.AirtableError: Invalid request: parameter validation failed. Check your request data.
It is because requests converts one item list to a string.
Workaround:
airtable().get('People', fields=['Name', 'Name'])
Hi,
Thanks so much for this repository! Really nice 👍
I'm trying to update images (attachments in AirTable), but there's an error when doing this. Here's the code:
data = { "Image" : {"url": "https://url.image.com/asset.3246874.jpg"}}
at.update('test', "9876dlafjkl", data)
as you see the image requires nested information about the image. The only requirement is the URL. Others are optional.
Here's the error i'm getting. Unfortunately the error after this tells nothing.
HTTPError Traceback (most recent call last)
C:\Continuum\Anaconda\envs\company-image-retreiver\lib\site-packages\airtable-0.3.1-py3.6.egg\airtable\airtable.py in __request(self, method, url, params, payload)
58 message = None
---> 59 r.raise_for_status()
60 except requests.exceptions.HTTPError as e:
C:\Continuum\Anaconda\envs\company-image-retreiver\lib\site-packages\requests\models.py in raise_for_status(self)
927 if http_error_msg:
--> 928 raise HTTPError(http_error_msg, response=self)
929
HTTPError: 422 Client Error: Unprocessable Entity for url: https://api.airtable.com/v0/xxxxxxxxxxxxxxxxxx`
HTTPError 422 according to AirTable:
Invalid Request The request data is invalid. This includes most of the base-specific validations. You will receive a detailed error message and code pointing to the exact issue.
Unfortunately there is no detailed error message pointing to the exact issue.
Hope you can help! What's going wrong with updating the images?
If you obtain a record with say attachments which are returned in an ordered dictionary, you have to convert them into a dictionary for them to be updated via at.update() for example. Why not just put the objects in a dictionary in the first place so they are update compatible? When you query airtable for records, there is no ordering mechanism and records are jumbled anyway so I'm not sure for the need of Collections.OrderedDict. It basically just means you have to do some preprocessing as found here to convert the nested ordered dict to a normal dict. Thanks!
I am cloning this module but how to import this module? I am not finding any airtable.py file .
The iterate method breaks as it tries to convert the offset to bytes whereas it needs to stay a string.
This is more of a heads up that we pushed out new API capabilities. Airtable/airtable.js@08e6e76
We now accept a formula to filter records and an array of field/direction pairs to sort by.
The limit is deprecated in favor of pageSize and maxRecords.
iteration fails as offset from get is unicode type not string.
Hi! I’m Fred, an engineer on the Airtable API team. I’m writing here to share some plans we have to move away from user API keys, with a goal of communicating it early so you have time to triage and prioritize work needed.
First, some context. We recently published a new developer doc site, and announced two new authentication methods, as well as new endpoints and capabilities those methods support: https://airtable.com/developers/web/api/changelog#anchor-2022-11-15
Since these new authentication methods (personal access tokens and OAuth integration access tokens) are much more secure than the current user API key authentication method, we are limiting the new endpoints and capabilities to only be available to the new methods.
The medium term plan is to deprecate user API keys. We are still working on the exact details, but the deprecation period will last 1 year, and we expect it to begin at the start of next year (Jan 2023).
Based on this we recommend preparing to support the new API token format:
/^key[a-zA-Z0-9]{14}$/
), start supporting the new personal access token key format as well (/^pat[a-zA-Z0-9]{14}\.[0-9a-f]{64}$/
)
When running the curl
"https://api.airtable.com/v0/..." -H "Authorization: Bearer ...
,
there is an error:
dyld: lazy symbol binding failed: Symbol not found: _SSL_CTX_set_alpn_protos
Referenced from: /Users/.../anaconda/bin/../lib/libcurl.4.dylib
Expected in: /Users/.../anaconda/bin/../lib/libssl.1.0.0.dylib
dyld: Symbol not found: _SSL_CTX_set_alpn_protos
Referenced from: /Users/.../anaconda/bin/../lib/libcurl.4.dylib
Expected in: /Users/.../anaconda/bin/../lib/libssl.1.0.0.dylib
I'm working with a client using your api, And I'm having problems with it.
everything is working fine but it needs a little improvement, instead of getting an entire table with the at.get attribute try to code a generator that will provide a records to work on when looping throught an entire base
Hi, I am using Windows where pip install requests was completed successfully. On the first line of my code as below I get the error.
from airtable import airtable
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from airtable import airtable
ModuleNotFoundError: No module named 'airtable'
I would like to use airtable API python. I installed it on Linux Ubuntu and I use pycharm.
with "import airtable" or "from airtable.airtable import Airtable"
I have a code error : "from .params import AirtablePar" ImportError: cannot import name 'AirtablePar'
and pycharm exit, code error 1.
Could I have help ? Thanks a lot !
It will only fetch 99 items for me.
I have a 157 on my airtable.
Other than that, I think it works fine.
at = airtable.Airtable('appua4wbLWf65hiXG/', 'my_api_key')
clients = at.get('Clients')
print clients
I was using thus module but I can't sort the results as get(sort = "") doesn't work
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.