{"id":15371403,"url":"https://github.com/achedeuzot/ecto_commons","last_synced_at":"2025-04-13T00:42:56.276Z","repository":{"id":37822780,"uuid":"293290089","full_name":"achedeuzot/ecto_commons","owner":"achedeuzot","description":"Ecto common validators for Date, Time, URLs, Emails, PostalCodes, Phone Numbers, Luhn checks, etc.","archived":false,"fork":false,"pushed_at":"2025-03-17T10:02:13.000Z","size":157,"stargazers_count":52,"open_issues_count":7,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T00:42:52.265Z","etag":null,"topics":["changeset","ecto","elixir","hacktoberfest","hex"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/achedeuzot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2020-09-06T14:10:12.000Z","updated_at":"2025-03-16T00:17:31.000Z","dependencies_parsed_at":"2024-02-03T11:28:30.734Z","dependency_job_id":"e5d3b7cb-30cd-4195-bddb-39d3ad91dcfa","html_url":"https://github.com/achedeuzot/ecto_commons","commit_stats":{"total_commits":47,"total_committers":6,"mean_commits":7.833333333333333,"dds":0.5957446808510638,"last_synced_commit":"d0f9bb2761e62738a42c5482f946430270eb90d0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achedeuzot%2Fecto_commons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achedeuzot%2Fecto_commons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achedeuzot%2Fecto_commons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achedeuzot%2Fecto_commons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/achedeuzot","download_url":"https://codeload.github.com/achedeuzot/ecto_commons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650417,"owners_count":21139672,"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":["changeset","ecto","elixir","hacktoberfest","hex"],"created_at":"2024-10-01T13:46:48.996Z","updated_at":"2025-04-13T00:42:56.246Z","avatar_url":"https://github.com/achedeuzot.png","language":"Elixir","readme":"# EctoCommons\n\n[![Build Status](https://github.com/achedeuzot/ecto_commons/workflows/tests/badge.svg)](https://github.com/achedeuzot/ecto_commons/actions?query=workflow%3Atests+branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/achedeuzot/ecto_commons/badge.svg?branch=master)](https://coveralls.io/github/achedeuzot/ecto_commons?branch=master) [![Hex Version](https://img.shields.io/hexpm/v/ecto_commons.svg)](https://hex.pm/packages/ecto_commons) [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n\nEcto common helpers such as validators and formatters.\n\n## Installation\n\nThe package is available on [hex](https://hex.pm/), so it can be installed\nby adding `ecto_commons` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ecto_commons, \"~\u003e 0.3.4\"}\n  ]\nend\n```\n\n## Incompatibility Warning\n\nIn order to check whether URLs are parseable,\nthis library requires either a recent (\u003e= 1.13.0) of Elixir,\nor an older (\u003c 26) version of OTP.\n\n## Documentation\n\nDocumentation is published on [HexDocs](https://hexdocs.pm) and can\nbe found at [https://hexdocs.pm/ecto_commons](https://hexdocs.pm/ecto_commons).\n\n## Summary\n\nThe package contains common ecto helpers:\n\n### Changeset validators\n  - `EctoCommons.DateValidator`:\n    - `validate_date(changeset, field, opts)`: validates an equality (with\n       approximation), before or after a given date.\n  - `EctoCommons.DateTimeValidator`\n    - `validate_datetime(changeset, field, opts)`: validates an equality (with\n       approximation), before or after a given date time.\n  - `EctoCommons.TimeValidator`\n    - `validate_time(changeset, field, opts)`: validates an equality (with\n       approximation), before or after a given time.\n  - `EctoCommons.EmailValidator`\n    - `validate_email(changeset, field, opts)`: validates emails. As there is no\n      perfect validation possible, multiple options are available depending\n      on your requirements. Can also reject temporary/burner emails.\n  - `EctoCommons.URLValidator`\n    - `validate_url(changeset, field, opts)`: validates if an URL is correct. Here\n      too, there is no perfection possible. Multiple options are available\n      depending on the precision required.\n  - `EctoCommons.StringValidator`\n    - `validate_has_prefix(changeset, field, opts)`: validates if a string starts\n      with a given prefix. The prefix itself can depend on another field or\n      on a dynamic value.\n  - `EctoCommons.PostalCodeValidator`\n    - `validate_postal_code(changeset, field, opts)`: validates postal code formatting\n      using regular expressions depending on the country. This only ensures the postal\n      code \"looks ok\" but doesn't check it really exists (that will need a complete\n      database of all postal codes worldwide).\n  - `EctoCommons.SocialSecurityValidator`\n    - `validate_social_security(changeset, field, opts)`: validates social security\n      numbers (SSN) depending on the country. This only validates french SSNs for now.\n  - `EctoCommons.LuhnValidator`\n    - `validate_luhn(changeset, field, opts)`: validates a string with Luhn's\n      algorithm such as credit card numbers and other administrative codes.\n  - `EctoCommons.PhoneNumberValidator`\n    - `validate_phone_number(changeset, field, opts)`: validates a phone number\n      using libphonenumber.\n\n## Changeset helpers\n - `EctoCommons.Helpers`\n   - `validate_many(changeset, field, opts)`: validates multiple fields with the same\n     validation function as well as the same options.\n\n## Changelog\n\n`ecto_commons` follows semantic versioning. See [`CHANGELOG.md`](https://github.com/achedeuzot/ecto_commons/blob/master/CHANGELOG.md) for more information.\n\n## Development\n\nUse [Earthly](https://earthly.dev/) to run tests against various versions of Elixir and Erlang.\n\n```sh\nearthly +all\n```\n\n## License\n\nMIT. Please see [LICENSE](https://github.com/achedeuzot/ecto_commons/blob/master/LICENSE) for licensing details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachedeuzot%2Fecto_commons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fachedeuzot%2Fecto_commons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachedeuzot%2Fecto_commons/lists"}