All Projects → Chicago → Rsocrata

Chicago / Rsocrata

Licence: other
Provides easier interaction with Socrata open data portals http://dev.socrata.com. Users can provide a 'Socrata' data set resource URL, or a 'Socrata' Open Data API (SoDA) web query, or a 'Socrata' "human-friendly" URL, returns an R data frame. Converts dates to 'POSIX' format. Manages throttling by 'Socrata'.

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Rsocrata

Forms
Tracking our progress moving all city paper and pdf forms online.
Stars: ✭ 14 (-92.31%)
Mutual labels:  government, open-data
Osd Bike Routes
Open source release of bike routes in Chicago.
Stars: ✭ 140 (-23.08%)
Mutual labels:  open-data, government
CityScoreToolkit
Open-source version of Boston's CityScore performance dashboard
Stars: ✭ 42 (-76.92%)
Mutual labels:  government, open-data
311
New web portal for BOS:311
Stars: ✭ 15 (-91.76%)
Mutual labels:  government, open-data
Openpolice Platform
An open source web publishing platform for police forces.
Stars: ✭ 15 (-91.76%)
Mutual labels:  open-data, government
Osd Street Center Line
Open source release of street center lines in Chicago.
Stars: ✭ 108 (-40.66%)
Mutual labels:  open-data, government
osd-building-footprints
Open source release of building footprints in Chicago.
Stars: ✭ 61 (-66.48%)
Mutual labels:  government, open-data
Decidim
The participatory democracy framework. A generator and multiple gems made with Ruby on Rails
Stars: ✭ 894 (+391.21%)
Mutual labels:  open-data, government
Atd Data And Performance
Open data and performance hub for the City of Austin Transportation Department
Stars: ✭ 17 (-90.66%)
Mutual labels:  open-data, government
Open Data Etl Utility Kit
Use Pentaho's open source data integration tool (Kettle) to create Extract-Transform-Load (ETL) processes to update a Socrata open data portal. Documentation is available at http://open-data-etl-utility-kit.readthedocs.io/en/stable
Stars: ✭ 93 (-48.9%)
Mutual labels:  open-data, government
Data.gov
Data.gov source code and issue tracker
Stars: ✭ 1,856 (+919.78%)
Mutual labels:  open-data, government
Welcome
Information on joining the government community — a collaborative community for sharing best practices in furtherance of open source, open data, and open government efforts.
Stars: ✭ 143 (-21.43%)
Mutual labels:  government
Grpc Nebula
微服务治理框架简介
Stars: ✭ 132 (-27.47%)
Mutual labels:  government
Olhoneles
Tool to monitor Brazilian legislators expenses while in the exercise of their mandates
Stars: ✭ 131 (-28.02%)
Mutual labels:  open-data
Caseflow
Caseflow is a web application that enables the tracking and processing of appealed claims at the Board of Veterans' Appeals.
Stars: ✭ 119 (-34.62%)
Mutual labels:  government
Developers.italia.it
The developer community designing and developing public digital services in Italy
Stars: ✭ 158 (-13.19%)
Mutual labels:  government
Electrophysiologydata
A list of openly available datasets in (mostly human) electrophysiology.
Stars: ✭ 143 (-21.43%)
Mutual labels:  open-data
Adresse.data.gouv.fr
Le site officiel de l'Adresse
Stars: ✭ 117 (-35.71%)
Mutual labels:  open-data
Datasets For Good
List of datasets to apply stats/machine learning/technology to the world of social good.
Stars: ✭ 174 (-4.4%)
Mutual labels:  government
Images
Public domain photos of Members of the United States Congress
Stars: ✭ 154 (-15.38%)
Mutual labels:  open-data

RSocrata

Gitter downloads cran version

Master

Stable beta branch. Test about-to-be-released features in a stable pre-release build before it is submitted to CRAN.

Linux build - MasterWindows build - MasterCoverage - Master

Dev

"Nightly" alpha branch. Test the latest features and bug fixes -- enjoy at your own risk.

Linux build - DevWindows build - DevCoverage - Dev

A tool for downloading and uploading Socrata datasets

Provided with a URL to a dataset resource published on a Socrata webserver, or a Socrata SoDA (Socrata Open Data Application Program Interface) web API query, or a Socrata "human-friendly" URL, read.socrata() returns an R data frame. Converts dates to POSIX format. Supports CSV and JSON download file formats from Socrata. Manages the throttling of data returned from Socrata and allows users to provide an application token. Supports SoDA query parameters in the URL string for further filtering, sorting, and queries. Upload data to Socrata data portals using "upsert" and "replace" methods.

Use ls.socrata() to list all datasets available on a Socrata webserver.

testthat test coverage.

Installation

To get the current released version from CRAN:

install.packages("RSocrata")

The most recent beta with soon-to-be-released changes can be installed from GitHub:

# install.packages("devtools")
devtools::install_github("Chicago/RSocrata")

The "nightly" version with the most recent bug fixes and features is also available. This version is always an alpha and may contain significant bugs. You can install it from the dev branch from GitHub:

# install.packages("devtools")
devtools::install_github("Chicago/RSocrata", ref="dev")

Examples

Reading SoDA valid URLs

earthquakesDataFrame <- read.socrata("http://soda.demo.socrata.com/resource/4334-bgaj.csv")
nrow(earthquakesDataFrame) # 1007 (two "pages")
class(earthquakesDataFrame$Datetime[1]) # POSIXlt

Reading "human-readable" URLs

earthquakesDataFrame <- read.socrata("https://soda.demo.socrata.com/dataset/USGS-Earthquakes-for-2012-11-01-API-School-Demo/4334-bgaj")
nrow(earthquakesDataFrame) # 1007 (two "pages")
class(earthquakesDataFrame$Datetime[1]) # POSIXlt

Using API key to read datasets

token <- "ew2rEMuESuzWPqMkyPfOSGJgE"
earthquakesDataFrame <- read.socrata("http://soda.demo.socrata.com/resource/4334-bgaj.csv", app_token = token)
nrow(earthquakesDataFrame)

Download private datasets from portal

# Store user email and password
socrataEmail <- Sys.getenv("SOCRATA_EMAIL", "[email protected]")
socrataPassword <- Sys.getenv("SOCRATA_PASSWORD", "7vFDsGFDUG")

privateResourceToReadCsvUrl <- "https://soda.demo.socrata.com/resource/a9g2-feh2.csv" # dataset

read.socrata(url = privateResourceToReadCsvUrl, email = socrataEmail, password = socrataPassword)

List all datasets on portal

allSitesDataFrame <- ls.socrata("https://soda.demo.socrata.com")
nrow(allSitesDataFrame) # Number of datasets
allSitesDataFrame$title # Names of each dataset

Upload data to portal

# Store user email and password
socrataEmail <- Sys.getenv("SOCRATA_EMAIL", "[email protected]")
socrataPassword <- Sys.getenv("SOCRATA_PASSWORD", "7vFDsGFDUG")

datasetToAddToUrl <- "https://soda.demo.socrata.com/resource/xh6g-yugi.json" # dataset
 
# Generate some data
x <- sample(-1000:1000, 1)
y <- sample(-1000:1000, 1)
df_in <- data.frame(x,y)
 
# Upload to Socrata
write.socrata(df_in,datasetToAddToUrl,"UPSERT",socrataEmail,socrataPassword)

Issues

Please report issues, request enhancements or fork us at the City of Chicago github.

Contributing

If you would like to contribute to this project, please see the contributing documentation and the product roadmap.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].