colo_biz 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cbfa0ab6baca5fc145022ff61274779b3854d5b
4
- data.tar.gz: 5edd38ac757fde0b0d677f267270063704681ef1
3
+ metadata.gz: 6d8d0627cb02a72292a2c44ee91904384402270b
4
+ data.tar.gz: febf8974663a399980feccf96a2de5e5f0fd0bc7
5
5
  SHA512:
6
- metadata.gz: 67d91be2ec9c3ba64cdff0ebb1c7aa6abbda13464307f573dff9a1c6a970374c744b823737ce64f016de2ab13fcc7770646b9720132dd4044c1c9be55f97e4b4
7
- data.tar.gz: 57aa0377853ba5b517b6ea277b2e70e28694047a628537f38f6a03b9905f7287daafcc7768379de90d22291cfb1e5afd57693dd2142b5f7e4a47abe52b5c4d71
6
+ metadata.gz: 414c1076b291dfe5a3a5e58e115e75dd075a17aa92437020255908bf20d9a64bf03f3e44266c384c601b118b10259ecb5e1efe356bb343979148e36970fc1e80
7
+ data.tar.gz: 95dc7354677ebd363352701eda4d49d276861f09dabbeea5994bfe914a9e285f9c7548d542b0056cbc43bdeab042fe7e2bc825a6517dae6209487052e13941c7
data/LICENSE.txt CHANGED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2015 Finnegan Hewitt and Casey Kelly
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -8,6 +8,13 @@ A Ruby interface to the Colorado Business Entities API.
8
8
  gem install colo_biz
9
9
 
10
10
  ## Documentation
11
+ Any queries made with the ColoBiz::DataFetcher module will return an array of BizEntity objects with all the information returned in the JSON hashes turned into attributes of the BizEntity objects. The attributes on each object can be called by their [field name](https://data.colorado.gov/developers/docs/colorado-business-entities) in snake case. For example the field name principalcity can be called on any BizEntity object as @bizentity.principal_city.
12
+ For the time being the search_by_entity_name does a soft search but all other search terms must match exactly except for case.
13
+ Our gem covers most of the queries with a method taking a single argument right out of the box. However you can modify any query method by entering what you want to use as a search term then adding "&" and a clause or field search after it.
14
+ [Socrata](http://dev.socrata.com/docs/queries.html) gives some examples of useful clauses to add. Here is an example of how to use a couple. If you wanted to find all the businesses in Evergreen, CO you would first use the ColoBiz::DataFetcher.new.search_by_principle_city(city_name) method and pass in "evergreen" as the argument. The default limit if you do not set it is 1000 which is too low for almost any search. You can increase the limit returned to the max of 50000 by including "&$limit=50000" at the end of the string you pass in as the argument for the method. Your final method would look like .search_by_principle_city("evergreen&$limit=50000"). This would return all Business entities in evergreen; about 9000. You could also add [Fields](https://data.colorado.gov/developers/docs/colorado-business-entities) to filter by. An example of this is to modify the above search to only return LLC's by adding &entitytype=DLLC to the end of the arguement we're passing the query method: ColoBiz::DataFetcher.new.search_by_principle_city("evergreen&$limit=50000&entitytype=FLLC") Notice that you must use either DLLC for "Domestic Limited Liability Company" or FLLC for "Foreign Limited Liability Company".
15
+ If you feel comfortable with the clauses and fields described above you may be more comfortable stringing them together for your own query to use in the .custom_query(query) method. We did not write a pagination method to return more than 50000 results because it would be stored in memory. The entire dataset is about 1.3 million entities which we feel would be unwieldy in active memory as a single array of objects. If you are comfortable using [pagination](http://dev.socrata.com/docs/paging.html), you want more than 500000 results, and your writing to a data base then you can iterate over our custom query method and write to a database.
16
+
17
+
11
18
  [http://rdoc.info/gems/?????][documentation]
12
19
 
13
20
  [documentation]: http://rdoc.info/gems/?????
data/colo_biz.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'colo_biz'
3
- s.version = '0.0.1' #semver.org
3
+ s.version = '0.0.2' #semver.org
4
4
  s.date = '2015-04-25'
5
5
  s.summary = "Colorado Business Entities Gem"
6
6
  s.description = "A gem that turns the CO Business Entity API into ruby methods."
@@ -3,10 +3,18 @@
3
3
  module ColoBiz
4
4
  module QueryMethod
5
5
 
6
- #The query does not search 'fuzzy' and needs the entire entity name
6
+ def custom_query(query)
7
+ response = @conn.get do |req|
8
+ req.url "/resource/colorado-business-entities.json?#{query}"
9
+ end
10
+ parsed = JSON.parse(response.body)
11
+ make_biz_entities(parsed)
12
+ end
13
+
14
+ #This query searches all names that contain the string entered. e.g. the argument 'mill' will return all the entities with mill in their name.
7
15
  def search_by_entity_name(entity_name)
8
16
  response = @conn.get do |req|
9
- req.url "/resource/colorado-business-entities.json?entityname=#{entity_name}"
17
+ req.url "/resource/colorado-business-entities.json?$select=entityname&$q=#{entity_name}"
10
18
  end
11
19
  parsed = JSON.parse(response.body)
12
20
  make_biz_entities(parsed)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colo_biz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Finnegan Hewitt