Giter Site home page Giter Site logo

airtable-github-export's Introduction

airtable-github-export

Export airtable tables to json/geojson in Github

We created this so that we could manage data for an online map in Airtable. It will export one or more tables in Airtable to an object of GeoJSON files on Github. It parses each table for either a text field named geometry, which should be a stringified valid GeoJSON geometry, or two number fields named lon and lat which should be valid longitude and latitude in WGS84. The exported file will be of the format:

{
  <table_name>: {...} // GeoJSON FeatureCollection
}

Usage

The script depends on several environment variables which you can set a .env file if you run this locally:

TABLES=Table 1, Table 2
GITHUB_TOKEN=xxxxxx
GITHUB_REPO=github_repo_name
GITHUB_OWNER=github_repo_owner_name
AIRTABLE_API_KEY=airtable_api_key
AIRTABLE_BASE_ID=airtable_base_id
GITHUB_BRANCH=github_branch_for_export
GITHUB_FILENAME=filename_for_github_export

Run the export with node airtable-export.js

We run this as a scheduled task on Heroku, and you can do the same by using the deploy button below:

Deploy

Once the app is deployed visit the 'Resources' page for your app on the Heroku dashboard, make sure the dynos are turned off, and configure the scheduler to run the export command node airtable-export.js at the schedule of your preference.

Contribute

PRs accepted.

License

MIT © Digital Democracy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.