{"id":13648480,"url":"https://github.com/socrata/soda-ruby","last_synced_at":"2025-04-22T11:32:41.313Z","repository":{"id":5365573,"uuid":"6552156","full_name":"socrata/soda-ruby","owner":"socrata","description":"A RubyGem for the Socrata Open Data API","archived":false,"fork":false,"pushed_at":"2023-03-16T21:29:24.000Z","size":184,"stargazers_count":121,"open_issues_count":11,"forks_count":23,"subscribers_count":58,"default_branch":"main","last_synced_at":"2025-03-22T03:46:31.039Z","etag":null,"topics":["engineering"],"latest_commit_sha":null,"homepage":"http://socrata.github.io/soda-ruby","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/socrata.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-11-05T21:36:56.000Z","updated_at":"2025-02-26T20:01:03.000Z","dependencies_parsed_at":"2024-01-14T10:59:24.245Z","dependency_job_id":"3ac0557b-04ea-432d-ae01-9123a79af3f8","html_url":"https://github.com/socrata/soda-ruby","commit_stats":{"total_commits":111,"total_committers":18,"mean_commits":6.166666666666667,"dds":"0.46846846846846846","last_synced_commit":"8519214a55a55eaf49f83fc82beb44a335b2edfe"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socrata%2Fsoda-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socrata%2Fsoda-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socrata%2Fsoda-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socrata%2Fsoda-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socrata","download_url":"https://codeload.github.com/socrata/soda-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250232361,"owners_count":21396625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["engineering"],"created_at":"2024-08-02T01:04:17.358Z","updated_at":"2025-04-22T11:32:40.760Z","avatar_url":"https://github.com/socrata.png","language":"Ruby","readme":"\n[![Build status](https://ci.appveyor.com/api/projects/status/4uaa2irr26deoffv?svg=true)](https://ci.appveyor.com/project/chrismetcalf/soda-ruby)\n[![Build Status](https://travis-ci.org/socrata/soda-ruby.svg?branch=master)](https://travis-ci.org/socrata/soda-ruby)\n\nFor more details and for documentation, check out \u003chttp://socrata.github.io/soda-ruby\u003e or our [developer portal](http://dev.socrata.com).\n\n## Installation\n\nSODA is distributed as a gem, which is how it should be used in your app.\n\nInclude the gem and hashie in your Gemfile:\n\n```ruby\ngem 'soda-ruby', :require =\u003e 'soda'\n```\n\n### Important Note!\n\nIn order to access the SODA API via HTTPS, clients must now [support the Server Name Indication (SNI)](https://dev.socrata.com/changelog/2016/08/24/sni-now-required-for-https-connections.html) 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](https://en.wikipedia.org/wiki/Server_Name_Indication), 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.\n\n## Quick Start\n\nCreate a new client. Register for an application token at \u003chttp://dev.socrata.com/register\u003e.\n\n```ruby\nclient = SODA::Client.new({:domain =\u003e \"explore.data.gov\", :app_token =\u003e \"CGxadgoQlgQSev4zyUh5aR5J3\"})\n```\n\nIssue a filter query. `644b-gaut` is the identifier for the dataset we want to access.\n\n### As of version 1.0.0+\n\nThe return object is the complete response object with a pre parsed body. The response.body object is an array of [Hashie::Mash].\n\nIf you are upgrading from a version \u003c 1.0.0 The previous object returned is now the response.body object.\n\n### Prior to version 1 (\u003c1.0.0)\n\nThe return object is an array of [Hashie::Mash] that represents the body of the response.\n\n(https://github.com/intridea/hashie) objects:\n\n```ruby\nresponse = client.get(\"644b-gaut\", {\"$limit\" =\u003e 1, :namelast =\u003e \"WINFREY\", :namefirst =\u003e \"OPRAH\"})\n\n #=\u003e [#\u003cHashie::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\"\u003e]\n```\n\nYou can use other simple query SoQL methods found here: \u003chttp://dev.socrata.com/docs/queries.html\u003e\n\n```ruby\nclient = SODA::Client.new({:domain =\u003e \"soda.demo.socrata.com\"})\nmagnitude_response = client.get(\"4tka-6guv\", {\"$where\" =\u003e \"magnitude \u003e '3.0'\"})\n\n#=\u003e [#\u003cHashie::Mash datetime=\"2012-09-14T09:28:55\" depth=\"20\" earthquake_id=\"12258012\" location=#\u003cHashie::Mash latitude=\"19.7859\" longitude=\"-64.0849\" needs_recoding=false\u003e magnitude=\"3.1\" number_of_stations=\"6\" region=\"north of the Virgin Islands\" source=\"pr\" version=\"0\"\u003e, #\u003cHashie::Mash datetime=\"2012-09-14T07:58:39\" depth=\"74\" earthquake_id=\"12258011\" location=#\u003cHashie::Mash latitude=\"19.5907\" longitude=\"-64.1723\" needs_recoding=false\u003e magnitude=\"3.3\" number_of_stations=\"4\" region=\"Virgin Islands region\" source=\"pr\" version=\"0\"\u003e, ... ]\n\ndatetime_response = client.get(\"4tka-6guv\", {\"$where\" =\u003e \"datetime \u003e '2012-09-14T09:28:55' AND datetime \u003c '2012-12-25T09:00:00'\"})\n\n#=\u003e [#\u003cHashie::Mash datetime=\"2012-09-14T10:10:19\" depth=\"8.2\" earthquake_id=\"00388609\" location=#\u003cHashie::Mash latitude=\"36.9447\" longitude=\"-117.6778\" needs_recoding=false\u003e magnitude=\"1.7\" number_of_stations=\"29\" region=\"Northern California\" source=\"nn\" version=\"9\"\u003e, #\u003cHashie::Mash datetime=\"2012-09-14T10:06:11\" depth=\"6.4\" earthquake_id=\"00388607\" location=#\u003cHashie::Mash latitude=\"36.9417\" longitude=\"-117.6903\" needs_recoding=false\u003e magnitude=\"1.7\" number_of_stations=\"29\" region=\"Central California\" source=\"nn\" version=\"9\"\u003e, ... ]\n```\n\nYou 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!\n\n```ruby\nclient = SODA::Client.new({:domain =\u003e \"soda.demo.socrata.com\"})\nmagnitude_response = client.get(\"https://soda.demo.socrata.com/resource/4tka-6guv.json\", {\"$where\" =\u003e \"magnitude \u003e '3.0'\"})\n```\n\nAll the field names have built in getter methods since the objects are Hashie::Mashes.\n\n```ruby\nmagnitude_response.first.number_of_stations   #=\u003e \"6\"\n```\n*Note that the return value is a string object.*\n\n## Contribution\n\n### How to Publish\nRaw ruby-gems publishing information can be found at [https://guides.rubygems.org/publishing/](https://guides.rubygems.org/publishing/).\n\n1) 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.\n\n1) 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/](https://semver.org/).\n\n1) Now build the gem by running `gem build soda.gemspec`. It should output a file with the name `soda-ruby-VERSION_NUMBER.gem`.\n\n2) 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.\n\nCongrats! The gem should now be published.","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocrata%2Fsoda-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocrata%2Fsoda-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocrata%2Fsoda-ruby/lists"}