{"id":22256862,"url":"https://github.com/mountolive/eltiempo","last_synced_at":"2025-03-25T12:48:13.121Z","repository":{"id":113831207,"uuid":"303001390","full_name":"mountolive/eltiempo","owner":"mountolive","description":"A small client library for retrieving weather data from http://api.tiempo.com/.","archived":false,"fork":false,"pushed_at":"2020-10-14T09:17:19.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T11:44:12.677Z","etag":null,"topics":["api","ruby","weather"],"latest_commit_sha":null,"homepage":"","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/mountolive.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-10-10T22:36:26.000Z","updated_at":"2020-10-24T17:10:10.000Z","dependencies_parsed_at":"2023-05-17T13:30:59.877Z","dependency_job_id":null,"html_url":"https://github.com/mountolive/eltiempo","commit_stats":{"total_commits":37,"total_committers":2,"mean_commits":18.5,"dds":"0.027027027027026973","last_synced_commit":"ac8dad9217aecbb95ad626af9fc1ae0884ead209"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountolive%2Feltiempo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountolive%2Feltiempo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountolive%2Feltiempo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountolive%2Feltiempo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mountolive","download_url":"https://codeload.github.com/mountolive/eltiempo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245467233,"owners_count":20620210,"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":["api","ruby","weather"],"created_at":"2024-12-03T08:08:51.538Z","updated_at":"2025-03-25T12:48:13.070Z","avatar_url":"https://github.com/mountolive.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eltiempo\n\nThe `eltiempo` wraps a client and a corresponding parser for retrieving weather data from [eltiempo](https://www.tiempo.com/api/)'s api\n\nAn example CLI is also provided. This can retrieve today's temperature, and current week's maximum and minimum average temperature of any\nregistered city in Barcelona, Spain.\n\n## Requirements\n\n`ruby 2.7.0`\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'eltiempo'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install eltiempo\n\nIt's necessary a proper `eltiempo`'s API key to be able to retrieve data.\nBoth the CLI and the `gem` expect a `TIEMPO_API_KEY` environment variable to be set.\n\nIf you're using [dotenv](https://github.com/bkeepers/dotenv) in your project,\nthe gem will be able to pick up the variable from there also.\n\n\n## Gem usage\n\n```ruby\nrequire 'eltiempo'\n\nclient = Eltiempo::Client.new Eltiempo::ResponseParser.new\n\n# Retrieving locations associated to division, from api\ndivision = client.get_locations_from_division_id(division_id, division_name)\n# Retrieving location by the passed name\nlocation = division.get_location(city_name)\nif !location\n  puts 'Location passed was not found' \n  return\nend\n# Retrieves weather information from api\nweek_weather = client.get_weather_from_location_id(location.id)\n# Prints today's temperature\nputs week_weather.todays_temperature\nputs week_weather.average_maximum_temperature\nputs week_weather.average_minimum_temperature\n```\n\n## CLI\n\n### CLI Installation\n\nTo install the cli in your system, after cloning this repository, run `bundle exec rake install`\n\n### CLI Help\n\nThe help function for the `eltiempo` CLI prompts the following:\n\n```\n$ eltiempo --help\n\n\n     The \"eltiempo\" cli retrieves the temperature of any city in Barcelona.\n     It can prompt today's temperature, average minimum and/or average maximum\n     weekly temperature, in Celsius degrees.\n\n     Any combination of the following flags can be passed to the command (at least one should be passed)\n \n     FLAGS\n     --today, -today, -t    Will prompt today's temperature for the passed city.\n     --av_max, -av_max, -u  Will prompt average maximum temperature of the week for that city.\n     --av-min, -av_min, -d  Will prompt average minimum temperature of the week for that city.\n     --help, -help, -h      Will prompt this help menu (Ignoring any other param)\n\n     PARAMETER\n        The Barcelona's city of which you want to retrieve its temperature\n\n```\n\n### CLI Usage\n\nThe `eltiempo` CLI is an example of the use of the `gem`. In any case, as mentioned, you need to have the `TIEMPO_API_KEY` env variable set in your system.\n\n```\n$ TIEMPO_API_KEY=yourkey eltiempo -today 'Gavà'\n\nBarcelona: Today's (2020-10-13) temperature in Gavà is:\n                15.5 celsius\n\n```\n\nYou could also pass multiple parameters:\n\n```\n$ TIEMPO_API_KEY=yourkey eltiempo -today -av_min -av_max gavà\n\nBarcelona: Today's (2020-10-13) temperature in Gavà is:\n                15.5 celsius\nBarcelona: Max temperature in Gavà for the week:\n                18.4 celsius\nBarcelona: Min temperature in Gavà for the week: \n                9.4 celsius\n\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests (this will create a coverage report in the `coverage` directory). \nYou can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo 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).\n\nOn local development, as already mentioned, you can use [dotenv](https://github.com/bkeepers/dotenv) to define the `TIEMPO_API_KEY` env variable, and it will be loaded on `require`. In that sense, the file `.env.template` serves as guideline: You can just rename it to `.env` and set the variable inside it to your API key and that's all.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/mountolive/eltiempo.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmountolive%2Feltiempo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmountolive%2Feltiempo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmountolive%2Feltiempo/lists"}