simonw / airtable-export

Export Airtable data to YAML, JSON or SQLite files on disk
https://datasette.io/tools/airtable-export
Apache License 2.0
112 stars 15 forks source link

Ability to export all tables in a base #24

Closed simonw closed 11 months ago

simonw commented 11 months ago

This was blocked for ages on the need for a schema API, but they appear to have one now:

Docs: https://airtable.com/developers/web/api/get-base-schema

curl "https://api.airtable.com/v0/meta/bases/{baseId}/tables"
{
  "tables": [
    {
      "description": "Apartments to track.",
      "fields": [
        {
          "description": "Name of the apartment",
          "id": "fld1VnoyuotSTyxW1",
          "name": "Name",
          "type": "singleLineText"
        },
        {
          "id": "fldoaIqdn5szURHpw",
          "name": "Pictures",
          "type": "multipleAttachments"
        },
        {
          "id": "fldumZe00w09RYTW6",
          "name": "District",
          "options": {
            "inverseLinkFieldId": "fldWnCJlo2z6ttT8Y",
            "isReversed": false,
            "linkedTableId": "tblK6MZHez0ZvBChZ",
            "prefersSingleRecordLink": true
          },
          "type": "multipleRecordLinks"
        }
      ],
simonw commented 11 months ago

I was going to do this with an --all option but actually I'll just have this happen if you specify no tables.

juniegrat commented 11 months ago

I can't use the --all or --schema flag as they are not recognized. Also when i export the base i get nothing in the export folder, i have to manually add id of every tables. I'm using last version 0.7.1.