{"id":20279148,"url":"https://github.com/peterhellberg/mat","last_synced_at":"2025-03-04T01:49:52.804Z","repository":{"id":8416052,"uuid":"10001811","full_name":"peterhellberg/mat","owner":"peterhellberg","description":"A small API client for the Mat API","archived":false,"fork":false,"pushed_at":"2013-06-24T19:42:10.000Z","size":164,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T11:41:46.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/peterhellberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-11T16:12:56.000Z","updated_at":"2014-05-03T06:05:45.000Z","dependencies_parsed_at":"2022-07-29T23:49:31.000Z","dependency_job_id":null,"html_url":"https://github.com/peterhellberg/mat","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fmat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fmat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fmat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fmat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterhellberg","download_url":"https://codeload.github.com/peterhellberg/mat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241768278,"owners_count":20017129,"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":[],"created_at":"2024-11-14T13:28:32.847Z","updated_at":"2025-03-04T01:49:52.778Z","avatar_url":"https://github.com/peterhellberg.png","language":"Ruby","readme":"# Mat\n\nA small (unofficial) API client for the [Mat API](http://matapi.se/).\n\nThe documentation is in Swedish, but so is the [data](http://www.slv.se/sv/grupp1/mat-och-naring/vad-innehaller-maten/livsmedelsdatabasen-/).\n\n[![Build Status](https://travis-ci.org/peterhellberg/mat.png?branch=master)](https://travis-ci.org/peterhellberg/mat)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'mat'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install mat\n\n## Usage\n\nIt is probably a good idea to take a look in `specs`\n\n```ruby\n# Find the first food with ’köttfärs’ in the name\nfood = Mat.all('Köttfärs').first\n\n# You can also pass a search query to the find method\nfood = Mat.find('Köttfärs')\n\n# Get the `iron` value (method_missing is used to retrieve each nutrient)\nfood.iron #=\u003e 1.09\n\n# Find a specific food by its number\nfood = Mat.find(3)\nfood.name #=\u003e \"Ister gris\"\n\n# You can also list all nutrients\nMat.nutrients\n```\n\n### CLI\n\nThis gem comes with a simple command line interface.\n\n```ruby\n# Finding foodstuff by its number\n$ mat 55\n{\n  \"name\": \"Mimosasallad\",\n  \"number\": 55,\n  \"nutrientValues\": {\n    \"energyKj\": 651,\n    \"energyKcal\": 156,\n    \"protein\": 2.4,\n    \"fat\": 12,\n    \"carbohydrates\": 8.9,\n    \"fibres\": 1.8,\n    \"salt\": 0.1,\n    \"ash\": 0.6,\n    \"water\": 74.2,\n    \"alcohol\": 0,\n    \"monosaccharides\": 3.3,\n    \"disaccharides\": 4.5,\n    \"saccharose\": 4.2,\n    \"wholegrain\": 0,\n    \"saturatedFattyAcids\": 3.8,\n    \"fattyAcid40100\": 0.5,\n    \"fattyAcid120\": 0.1,\n    \"fattyAcid140\": 0.5,\n    \"fattyAcid160\": 1.9,\n    \"fattyAcid180\": 0.7,\n    \"fattyAcid200\": 0,\n    \"monounsaturatedFattyAcids\": 2.6,\n    \"fattyAcid161\": 0.1,\n    \"fattyAcid181\": 2.5,\n    \"sumPolyunsaturatedFattyAcids\": 4.4,\n    \"n6FattyAcids\": 0.1,\n    \"fattyAcid182\": 3.9,\n    \"fattyAcid204\": 0,\n    \"n3FattyAcids\": 0,\n    \"fattyAcid183\": 0.5,\n    \"longN3FattyAcids\": 0,\n    \"epa\": 0,\n    \"dpa\": 0,\n    \"dha\": 0,\n    \"transFattyAcids\": 0.1,\n    \"cholesterol\": 50.3,\n    \"retinolEquivalents\": 76,\n    \"retinol\": 68,\n    \"betacarotene\": 92,\n    \"vitaminD\": 0.15,\n    \"vitaminE\": 1.24,\n    \"vitaminK\": 3,\n    \"timamine\": 0.09,\n    \"riboflavin\": 0.1,\n    \"vitaminC\": 12,\n    \"niacin\": 0.5,\n    \"niacinEquivalents\": 1,\n    \"vitaminB6\": 0.1,\n    \"vitaminB12\": 0.23,\n    \"phosphorous\": 55,\n    \"folate\": 23,\n    \"iodine\": 4,\n    \"trash\": 17,\n    \"iron\": 0.54,\n    \"calcium\": 31,\n    \"potassium\": 199,\n    \"magnesium\": 13,\n    \"sodium\": 45,\n    \"selenium\": 2.3,\n    \"zink\": 0.4\n  }\n}\n\n# You can also search for foodstuff\n$ mat hasselnötter\n[\n  {\n    \"name\": \"Hasselnötter\",\n    \"number\": 1558\n  },\n  {\n    \"name\": \"Mjölkchoklad m hackade hasselnötter Schweizernöt\",\n    \"number\": 1848\n  }\n]\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterhellberg%2Fmat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterhellberg%2Fmat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterhellberg%2Fmat/lists"}