Skip to content

Add function to recursively export all Socrata data to local directory #126

Description

@tomschenkjr

The ls.socrata() function supports the listing of all data on a data portal while read.socrata(). Thus, the two can be combined under export.socrata() to download all of the files a neatly compress and place them in a single directory.

This sort of functionality can be used by people wishing to archive data portals or help in the migration of one platform to another one. The function should be focused on saving the data to a local or cloud-based storage (e.g., S3) and should avoid loading all of the data into memory.

Solving #124 will allow an easier integration between ls.socrata() and read.socrata(), so RSocrata v1.7.2-7 or above will be required.

  • Output compress CSVs into a directory named after the domain itself (e.g., data.cityofchicago.org/)
  • Timestamp each individual file (files should be individually timestamped since an entire portal export may take awhile)
  • Ensure that GeoJSON files are exported, compressed (I don't think Add support for geojson downloads #43 needs to be completed first)
  • Ensure Shapefiles, KML/KMZ, and other "attach"-based files are also exported, compressed
  • Allow users to supply a token in export.socrata() to avoid throttling
  • Allow users to choose between CSV or JSON outputs. (CSVs are data.frame friendly, but JSON downloads faster from Socrata)
  • Allow users to choose between compression or uncompressed output
  • Support output to cloud services such as S3
  • Write unit test

An initial alpha is on this gist. This is now on the issue126 branch. Feedback is encouraged as I've done limited testing at this point.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions