Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maartenvanvliet/nl_api
https://github.com/maartenvanvliet/nl_api
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maartenvanvliet/nl_api
- Owner: maartenvanvliet
- License: mit
- Created: 2017-09-09T16:01:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-09T16:02:15.000Z (over 7 years ago)
- Last Synced: 2024-11-13T23:12:08.597Z (about 1 month ago)
- Language: Ruby
- Size: 33.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# NlApi
CBS data on Dutch municipalities packaged as simple gem
Sources:
* [Historic municipality data](http://publicaties.rvig.nl/Landelijke_tabellen/Landelijke_tabellen_32_t_m_60_excl_tabel_35/Landelijke_Tabellen_32_t_m_60_in_csv_formaat)
* [Current data](https://www.cbs.nl/nl-nl/onze-diensten/methoden/classificaties/overig/gemeentelijke-indelingen-per-jaar/indeling%20per%20jaar/gemeentelijke-indeling-op-1-januari-2017)## Installation
Add this line to your application's Gemfile:
```ruby
gem 'nl_api'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install nl_api
## Usage
Find municipalities by name:
```ruby
# Find municipality
municipality = NlApi::Municipality.find_by(name: 'Rotterdam')# Get province of municipality
province = municipality.province# Get municipalities in the province
province.municipalities
# [#, ...]# Get the municipalities this one is the result of
municipality.merged_municipalities
# Result: [#, ...]# Find history municipality
historic_municipality = NlApi::HistoricMunicipality.find_by(name: 'Overschie')
historic_municipality.municipality_after_merge
# Result: #```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Changelog
- v1.1 Add class to deal with no longer existing municipalities
- v1.0 first release## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/maartenvanvliet/nl_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).