Skip to content

kf8a/socrata-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socrata

An application to sync weather and crop yield data with Socrata.

Approach

  • fetch the latest record from Socrata
  • check for newer records in the DB
  • send the new records to socrata
  • if the new record sampled_at date is earlier than the latest record in socrata, update the record in socrata
    • find the old record with the row id
    • use the row id to update the record in socrata

TODO:

  • check the updated_at date to determine if the record has been updated

Setup

export SOCRATA_APP_TOKEN=your_socrata_app_token
export SOCRATA_API_KEY=your_socrata_api_key
export SOCRATA_DOMAIN=your_socrata_domain
export SOCRATA_WEATHER_DATASET_ID=your_weather_dataset_id
export SOCRATA_YIELD_DATASET_ID=your_crop_yield_dataset_id
export DB_URL=your_ecto_db_url_for the weather data

mix ecto.migrate -r ObanRepo

Usage

mix run --no-halt

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/socrata.

About

A way to sync data from a local DB to socrata

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages