{"id":14949149,"url":"https://github.com/stevetoro/tallgrass","last_synced_at":"2026-01-20T23:31:32.025Z","repository":{"id":254749144,"uuid":"847432853","full_name":"stevetoro/tallgrass","owner":"stevetoro","description":"A PokeAPI wrapper library, written in Gleam.","archived":false,"fork":false,"pushed_at":"2024-10-04T01:52:17.000Z","size":417,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T13:38:27.029Z","etag":null,"topics":["gleam","pokeapi","pokemon"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/tallgrass","language":"Gleam","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/stevetoro.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-25T20:01:57.000Z","updated_at":"2024-10-13T17:04:57.000Z","dependencies_parsed_at":"2024-11-06T01:59:35.146Z","dependency_job_id":null,"html_url":"https://github.com/stevetoro/tallgrass","commit_stats":null,"previous_names":["stevetoro/pokegleam","stevetoro/tallgrass"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/stevetoro/tallgrass","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevetoro%2Ftallgrass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevetoro%2Ftallgrass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevetoro%2Ftallgrass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevetoro%2Ftallgrass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevetoro","download_url":"https://codeload.github.com/stevetoro/tallgrass/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevetoro%2Ftallgrass/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28618802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T22:24:05.405Z","status":"ssl_error","status_checked_at":"2026-01-20T22:20:31.342Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gleam","pokeapi","pokemon"],"created_at":"2024-09-24T05:00:35.468Z","updated_at":"2026-01-20T23:31:31.999Z","avatar_url":"https://github.com/stevetoro.png","language":"Gleam","funding_links":[],"categories":["Packages"],"sub_categories":["API Clients"],"readme":"# tallgrass\n\n[![Package Version](https://img.shields.io/hexpm/v/tallgrass)](https://hex.pm/packages/tallgrass)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/tallgrass/)\n\nThe `tallgrass` package is a Gleam wrapper for the [PokeAPI](https://pokeapi.co) and is installable via hex.\n\n```sh\ngleam add tallgrass\n```\n\nGet started with the examples below. Further documentation can be found at \u003chttps://hexdocs.pm/tallgrass\u003e.\n\n## Examples\n\n### Fetching resources by name or ID\n\nThe majority of PokeAPI resources can be fetched directly by either name or ID. Only a few\n(`characteristic`, `contest-effect`, `evolution-chain`, `machine`, and `super-contest-effect`)\nneed to be fetched by ID.\n\n```gleam\nimport tallgrass/client\nimport tallgrass/machine\nimport tallgrass/pokemon\n\nfn example() {\n  let client = client.new()\n\n  // Pokemon can be fetched by name or ID.\n  let assert Ok(ditto) = pokemon.fetch_by_name(client, \"ditto\")\n  let assert Ok(ditto) = pokemon.fetch_by_id(client, 132)\n\n  // Machines can only be fetched by ID.\n  let assert Ok(tm_01) = machine.fetch_by_id(client, 2)\n}\n```\n\n### Paginated resources\n\nYou can also fetch (and traverse) paginated resources. The returned resources will only contain\nthe name of the resource (if available) and its corresponding PokeAPI URL.\n\nPagination options (limit and offset) need to be specified for these requests. Specify one\nor both of these options using `client.PaginationOptions`.\n\n```gleam\nimport gleam/list\nimport tallgrass/client.{Limit, Offset, Paginate, with_pagination}\nimport tallgrass/pokemon\n\nfn example() {\n  let client = client.new()\n\n  // default to a limit of 20\n  let assert Ok(page) = client |\u003e pokemon.fetch()\n\n  // or specify a different limit or offset, or both\n  let assert Ok(page) = client |\u003e with_pagination(Limit(100)) |\u003e pokemon.fetch()\n  let assert Ok(page) = client |\u003e with_pagination(Offset(20)) |\u003e pokemon.fetch()\n  let assert Ok(page) = client |\u003e with_pagination(Paginate(limit: 100, offset: 20)) |\u003e pokemon.fetch()\n\n  // the returned resources can then be fetched directly\n  let assert Ok(resource) = page.results |\u003e list.first\n  let assert Ok(pokemon) = pokemon.fetch_resource(client, resource)\n\n  // or you can move on to the next or previous page\n  let assert Ok(next_page) = client.next(client, page)\n  let assert Ok(previous_page) = client.previous(client, next_page)\n}\n```\n\n### Caching\n\nEvery request response can be cached so that subsequent requests for the same resource\ncan be served without sending an additional HTTP request.\n\n```gleam\nimport tallgrass/client.{with_cache}\nimport tallgrass/client/cache.{Hours}\nimport tallgrass/pokemon\n\nfn example() {\n  // Initialize a new cache with a unique name and the expiration interval.\n  let assert Ok(cache) = cache.new(\"unique-cache-name\", Hours(4))\n  let client = client.new() |\u003e with_cache(cache)\n\n  let assert Ok(ditto) = pokemon.fetch_by_name(client, \"ditto\")\n\n  // Subsequent requests will be served from cache/memory instead of the API.\n  let assert Ok(ditto) = pokemon.fetch_by_name(client, \"ditto\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevetoro%2Ftallgrass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevetoro%2Ftallgrass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevetoro%2Ftallgrass/lists"}