{"id":13491395,"url":"https://github.com/dashbitco/nimble_options","last_synced_at":"2025-05-14T20:01:59.241Z","repository":{"id":40423182,"uuid":"241641230","full_name":"dashbitco/nimble_options","owner":"dashbitco","description":"A tiny library for validating and documenting high-level options","archived":false,"fork":false,"pushed_at":"2025-04-30T07:06:32.000Z","size":195,"stargazers_count":528,"open_issues_count":1,"forks_count":42,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-07T19:47:27.367Z","etag":null,"topics":["elixir","elixir-lang","option-parser"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dashbitco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2020-02-19T14:23:52.000Z","updated_at":"2025-05-06T11:49:29.000Z","dependencies_parsed_at":"2023-01-31T20:00:40.751Z","dependency_job_id":"713a70d3-97e0-402a-aaba-7f15fdc404e9","html_url":"https://github.com/dashbitco/nimble_options","commit_stats":{"total_commits":149,"total_committers":32,"mean_commits":4.65625,"dds":0.4429530201342282,"last_synced_commit":"aee468686a6ac9d14ec0af0818008517212f53e8"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashbitco%2Fnimble_options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashbitco%2Fnimble_options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashbitco%2Fnimble_options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashbitco%2Fnimble_options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dashbitco","download_url":"https://codeload.github.com/dashbitco/nimble_options/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254037258,"owners_count":22003784,"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":["elixir","elixir-lang","option-parser"],"created_at":"2024-07-31T19:00:56.675Z","updated_at":"2025-05-14T20:01:59.111Z","avatar_url":"https://github.com/dashbitco.png","language":"Elixir","readme":"# NimbleOptions\n\n[![hex.pm badge](https://img.shields.io/badge/Package%20on%20hex.pm-informational)](https://hex.pm/packages/nimble_options)\n[![Documentation badge](https://img.shields.io/badge/Documentation-ff69b4)][docs]\n[![CI](https://github.com/dashbitco/nimble_options/actions/workflows/main.yml/badge.svg)](https://github.com/dashbitco/nimble_options/actions/workflows/main.yml)\n[![Coverage Status](https://coveralls.io/repos/github/dashbitco/nimble_options/badge.svg?branch=master)](https://coveralls.io/github/dashbitco/nimble_options?branch=master)\n\n[Online Documentation][docs].\n\nA tiny library for validating and documenting high-level options.\n\nThis library allows you to validate options based on a definition.\nA definition is a keyword list specifying how the options you want\nto validate should look like:\n\n```elixir\ndefinition = [\n  connections: [\n    type: :non_neg_integer,\n    default: 5\n  ],\n  url: [\n    type: :string,\n    required: true\n  ]\n]\n```\n\nNow you can validate options through `NimbleOptions.validate/2`:\n\n```elixir\noptions = [url: \"https://example.com\"]\n\nNimbleOptions.validate(options, definition)\n#=\u003e {:ok, [url: \"https://example.com\", connections: 5]}\n```\n\nIf the options don't match the definition, an error is returned:\n\n```elixir\nNimbleOptions.validate([connections: 3], definition)\n{:error,\n %NimbleOptions.ValidationError{\n   keys_path: [],\n   message: \"required option :url not found, received options: [:connections]\"\n }}\n```\n\n`NimbleOptions` is also capable of automatically generating\ndocumentation for a definition by calling `NimbleOptions.docs/1`\nwith your definition.\n\n## Installation\n\nYou can install `nimble_options` by adding it to your list of\ndependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:nimble_options, \"~\u003e 1.0\"}\n  ]\nend\n```\n\n## Nimble*\n\nAll nimble libraries by Dashbit:\n\n  * [NimbleCSV](https://github.com/dashbitco/nimble_csv) - simple and fast CSV parsing\n  * [NimbleOptions](https://github.com/dashbitco/nimble_options) - tiny library for validating and documenting high-level options\n  * [NimbleParsec](https://github.com/dashbitco/nimble_parsec) - simple and fast parser combinators\n  * [NimblePool](https://github.com/dashbitco/nimble_pool) - tiny resource-pool implementation\n  * [NimblePublisher](https://github.com/dashbitco/nimble_publisher) - a minimal filesystem-based publishing engine with Markdown support and code highlighting\n  * [NimbleTOTP](https://github.com/dashbitco/nimble_totp) - tiny library for generating time-based one time passwords (TOTP)\n\n## License\n\nCopyright 2020 Dashbit\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n  \u003e https://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n\n[docs]: https://hexdocs.pm/nimble_options\n","funding_links":[],"categories":["Elixir"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashbitco%2Fnimble_options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdashbitco%2Fnimble_options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashbitco%2Fnimble_options/lists"}