All Projects → socrata → Soda Ruby

socrata / Soda Ruby

Licence: mit
A RubyGem for the Socrata Open Data API

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Soda Ruby

Constant Vigilance
Learn this if you want to be a software engineer. Constant vigilance means being continually aware of areas that need improvement. For me, I am constantly searching for valuable resources to ensure I am able to solve any problem that comes my way.
Stars: ✭ 30 (-74.79%)
Mutual labels:  engineering
Orthopy
Orthogonal polynomials in all shapes and sizes.
Stars: ✭ 75 (-36.97%)
Mutual labels:  engineering
Engineering Blog
📝 We write about our technologies and the problems we handle at scale.
Stars: ✭ 99 (-16.81%)
Mutual labels:  engineering
Soda Android Sdk
Stars: ✭ 31 (-73.95%)
Mutual labels:  engineering
Accupy
Accurate sums and dot products for Python.
Stars: ✭ 65 (-45.38%)
Mutual labels:  engineering
Pyocct
Python bindings for OpenCASCADE via pybind11.
Stars: ✭ 87 (-26.89%)
Mutual labels:  engineering
Pyflo
PyFlo is an open-source library written in Python for performing hydraulic and hydrology stormwater analysis. Features include network hydraulic grade analysis and time/iteration based storage and flood routing simulations.
Stars: ✭ 19 (-84.03%)
Mutual labels:  engineering
Index
Metarhia educational program index 📖
Stars: ✭ 2,045 (+1618.49%)
Mutual labels:  engineering
The Engineering Managers Booklist
Books for people who are or aspire to manage/lead team(s) of software engineers
Stars: ✭ 1,180 (+891.6%)
Mutual labels:  engineering
Reverse Engineering
Reverse-Engineered Tools Count-106
Stars: ✭ 94 (-21.01%)
Mutual labels:  engineering
Datasync
Desktop / Console application for updating Socrata datasets automatically.
Stars: ✭ 60 (-49.58%)
Mutual labels:  engineering
Fhir.js
Node.JS library for serializing/deserializing FHIR resources between JS/JSON and XML using various node.js XML libraries
Stars: ✭ 61 (-48.74%)
Mutual labels:  engineering
Nokia Book
NOKIA Book covers selected aspects of the telecommunication industry programmer's work
Stars: ✭ 87 (-26.89%)
Mutual labels:  engineering
Documents
Documentation for Phase 4 Ground
Stars: ✭ 31 (-73.95%)
Mutual labels:  engineering
Letters
Письма к студентам курса
Stars: ✭ 107 (-10.08%)
Mutual labels:  engineering
Design Patterns For Humans
An ultra-simplified explanation to design patterns
Stars: ✭ 32,376 (+27106.72%)
Mutual labels:  engineering
Psychrolib
📚 Library of psychrometric functions to calculate 🌡️ thermodynamic properties of air for Python, C, C#, Fortran, R, JavaScript and VBA/Excel
Stars: ✭ 83 (-30.25%)
Mutual labels:  engineering
Site Reliability Engineer Guide
Stars: ✭ 112 (-5.88%)
Mutual labels:  engineering
Egret
🐦Some of the egret tutorial -《白鹭引擎笔记》
Stars: ✭ 108 (-9.24%)
Mutual labels:  engineering
Freecad
This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler. Issues are managed on our own bug tracker at https://www.freecadweb.org/tracker
Stars: ✭ 10,366 (+8610.92%)
Mutual labels:  engineering

Build status Build Status

For more details and for documentation, check out http://socrata.github.io/soda-ruby or our developer portal.

Installation

SODA is distributed as a gem, which is how it should be used in your app.

Include the gem and hashie in your Gemfile:

gem 'soda-ruby', :require => 'soda'

Important Note!

In order to access the SODA API via HTTPS, clients must now support the Server Name Indication (SNI) extension to the TLS protocol. What does this mean? It means that if you're using soda-ruby, you must use Ruby 2.0.0 or above, as that is when net/http introduced support for SNI. 2.0.0 was released in 2011, so most up-to-date platforms will be on version 2.0 or greater.

Quick Start

Create a new client. Register for an application token at http://dev.socrata.com/register.

client = SODA::Client.new({:domain => "explore.data.gov", :app_token => "CGxadgoQlgQSev4zyUh5aR5J3"})

Issue a filter query. 644b-gaut is the identifier for the dataset we want to access.

As of version 1.0.0+

The return object is the complete response object with a pre parsed body. The response.body object is an array of [Hashie::Mash].

If you are upgrading from a version < 1.0.0 The previous object returned is now the response.body object.

Prior to version 1 (<1.0.0)

The return object is an array of [Hashie::Mash] that represents the body of the response.

(https://github.com/intridea/hashie) objects:

response = client.get("644b-gaut", {"$limit" => 1, :namelast => "WINFREY", :namefirst => "OPRAH"})

 #=> [#<Hashie::Mash appt_end_date="12/3/09 23:59" appt_made_date="12/2/09 18:05" appt_start_date="12/3/09 9:30" caller_name_first="SALLY" caller_name_last="ARMBRUSTER" last_updatedby="J7" lastentrydate="12/2/09 18:05" meeting_loc="WH" meeting_room="DIP ROOM" namefirst="OPRAH" namelast="WINFREY" post="WIN" release_date=1269586800 terminal_suffix="J7" total_people="10" type_of_access="VA" uin="U60816" visitee_namefirst="SEMONTI" visitee_namelast="STEPHENS">]

You can use other simple query SoQL methods found here: http://dev.socrata.com/docs/queries.html

client = SODA::Client.new({:domain => "soda.demo.socrata.com"})
magnitude_response = client.get("4tka-6guv", {"$where" => "magnitude > '3.0'"})

#=> [#<Hashie::Mash datetime="2012-09-14T09:28:55" depth="20" earthquake_id="12258012" location=#<Hashie::Mash latitude="19.7859" longitude="-64.0849" needs_recoding=false> magnitude="3.1" number_of_stations="6" region="north of the Virgin Islands" source="pr" version="0">, #<Hashie::Mash datetime="2012-09-14T07:58:39" depth="74" earthquake_id="12258011" location=#<Hashie::Mash latitude="19.5907" longitude="-64.1723" needs_recoding=false> magnitude="3.3" number_of_stations="4" region="Virgin Islands region" source="pr" version="0">, ... ]

datetime_response = client.get("4tka-6guv", {"$where" => "datetime > '2012-09-14T09:28:55' AND datetime < '2012-12-25T09:00:00'"})

#=> [#<Hashie::Mash datetime="2012-09-14T10:10:19" depth="8.2" earthquake_id="00388609" location=#<Hashie::Mash latitude="36.9447" longitude="-117.6778" needs_recoding=false> magnitude="1.7" number_of_stations="29" region="Northern California" source="nn" version="9">, #<Hashie::Mash datetime="2012-09-14T10:06:11" depth="6.4" earthquake_id="00388607" location=#<Hashie::Mash latitude="36.9417" longitude="-117.6903" needs_recoding=false> magnitude="1.7" number_of_stations="29" region="Central California" source="nn" version="9">, ... ]

You can also provide a full URI to an API endpoint instead of specifying the ID. Just copy and paste the dataset URI from the API documentation!

client = SODA::Client.new({:domain => "soda.demo.socrata.com"})
magnitude_response = client.get("https://soda.demo.socrata.com/resource/4tka-6guv.json", {"$where" => "magnitude > '3.0'"})

All the field names have built in getter methods since the objects are Hashie::Mashes.

magnitude_response.first.number_of_stations   #=> "6"

Note that the return value is a string object.

Contribution

How to Publish

Raw ruby-gems publishing information can be found at https://guides.rubygems.org/publishing/.

  1. First you must publish with a soda-ruby maintainer account. Please use the tylsvc-rubygems rubygems.org account located in lasspass. If you do not see it in lasspass, please reach out to a lasspass admin in order to get access.

  2. After finding the account, proceed to your local soda-ruby project directory. Update the version of the file project inside the soda.gemspec file, under s.version = '1.0.1'. This project uses semantic versioning, learn more here https://semver.org/.

  3. Now build the gem by running gem build soda.gemspec. It should output a file with the name soda-ruby-VERSION_NUMBER.gem.

  4. Then to publish the gem run gem publish soda-ruby-VERSION_NUMBER.gem. Please insert the correct VERSION_NUMBER. This is where gems prompt for the tylsvc-rubygems user name and password.

Congrats! The gem should now be published.

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].