Oct 24, 2021 08:42 AM
I have built out an endpoint for exporting base to CSV. Documentation can be found here
Here is the api.
With the correct parameters it will give the latest version of your base as CSV and will be useful in python scripts etc. Any issues getting it working please check out the docs or reach out.
Additionally, any questions or concerns about how keys or data is handled that are not addressed in the docs - i’ll be happy to answer :slightly_smiling_face:
Oct 27, 2021 09:59 AM
@GavinA, this is very impressive! Would you care to elaborate how you were technically able to achieve this? Better yet, could you open source the code on GitHub so I can take a look at it?
Oct 28, 2021 02:01 AM
Thanks for your kind words. Of course. The app is written in Python and utilises Flask and Pandas. The script (when triggered) communicates with the Airtable API. Using the api key, base id, table name and view name passed by the user, it queries the referenced table and handles any pagination. Everything is piped into a pandas dataframe and pandas’
to_csv() method is used to convert the dataframe to csv. The csv is passed back to the caller through the route so nothing is stored.
The api is hosted using google app engine.
Good idea about sharing the code on Github. When I have some time, I’ll clean it up and share it through the docs!
Nov 01, 2021 01:22 AM
UPDATE: The api was giving the “something went wrong” error for some bases that feature the “Multiple select” field. This has been fixed as of 31/10/21
Nov 01, 2021 09:06 AM
Thanks so much for your reply! This is why I’d love to see the Python in GitHub. We could verify the level of privacy and repurpose the script to increase its security.
No rush, but I would love to see it once it’s ready. :blush:
Nov 01, 2021 04:11 PM
@jonathanlaniado. The code is now open source and available on Github. You’ll find it here and it is also now available on the docs :slightly_smiling_face:
Jan 12, 2022 12:48 AM
Hi all. This version of CSV Getter is now deprecated. You can easily make a more secure link for exporting CSVs here instead.
Sorry for any inconveniance and I hope you like the new website :slightly_smiling_face: