usda_fdc 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +14 -11
- data/lib/usda_fdc/client.rb +1 -0
- data/lib/usda_fdc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4796ad6e9de7996f19018c9e89c90386b74313d6ea5661877060aa1a71d4db8b
|
|
4
|
+
data.tar.gz: cbebe212275b3834bf07731efca382a5e9a67b21e7878905f1ff787d125d3aa1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d14e949edd29832fc9a02d5ed4884b0b9c11e3b8ede97a9eb8ea1f27fe3b0f141cfb1e5a504f1256a828c472415f9cd9dbaa773ba302e6237897d45493d76d12
|
|
7
|
+
data.tar.gz: 5993a9ef8cdb28c88ec35390970880c08416e897ec93ae955d019381f1aa02ffc679690754c2ae28ca5d05938cc4d98aaacda51b864a0d4e2391b6296ee8d677
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -4,23 +4,30 @@ A Ruby interface to the USDA [FoodData Central](https://fdc.nal.usda.gov) API.
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
To install the latest release:
|
|
8
|
+
|
|
9
|
+
$ gem install usda_fdc
|
|
10
|
+
|
|
11
|
+
To include in a Rails project, add it to the Gemfile:
|
|
8
12
|
|
|
9
13
|
```ruby
|
|
10
14
|
gem 'usda_fdc'
|
|
11
15
|
```
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
## Usage
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
An API key is required to access the service. You can find details on how to obtain a key [here](https://fdc.nal.usda.gov/api-guide.html#bkmk-3).
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
Once you have an API key, you're able to make API calls via the client object:
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
```ruby
|
|
24
|
+
client = UsdaFdc::Client.new('your_api_key')
|
|
25
|
+
client.food(534358)
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
#=> { "dataType" => "Branded", "description" => "NUT 'N BERRY MIX", "fdcId" => 534358, ... }
|
|
28
|
+
```
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
For more information on interacting with the API, including accepted parameters and response formats, check out the official USDA FDC [API guide](https://fdc.nal.usda.gov/api-guide.html).
|
|
24
31
|
|
|
25
32
|
## Development
|
|
26
33
|
|
|
@@ -28,10 +35,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
|
28
35
|
|
|
29
36
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
30
37
|
|
|
31
|
-
## Contributing
|
|
32
|
-
|
|
33
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/usda_fdc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/usda_fdc/blob/master/CODE_OF_CONDUCT.md).
|
|
34
|
-
|
|
35
38
|
## License
|
|
36
39
|
|
|
37
40
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/usda_fdc/client.rb
CHANGED
data/lib/usda_fdc/version.rb
CHANGED