{"id":16914960,"url":"https://github.com/bombsimon/elixir-personnummer","last_synced_at":"2025-03-20T19:54:41.955Z","repository":{"id":38006827,"uuid":"257063206","full_name":"bombsimon/elixir-personnummer","owner":"bombsimon","description":"🔢 Validate Swedish personal identity numbers","archived":false,"fork":false,"pushed_at":"2023-03-15T20:20:17.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T01:45:15.691Z","etag":null,"topics":["elixir","personnummer"],"latest_commit_sha":null,"homepage":"https://bombsimon.github.io/elixir-personnummer/","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/bombsimon.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}},"created_at":"2020-04-19T17:39:09.000Z","updated_at":"2022-06-12T14:45:14.000Z","dependencies_parsed_at":"2022-09-09T16:22:05.641Z","dependency_job_id":null,"html_url":"https://github.com/bombsimon/elixir-personnummer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bombsimon%2Felixir-personnummer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bombsimon%2Felixir-personnummer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bombsimon%2Felixir-personnummer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bombsimon%2Felixir-personnummer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bombsimon","download_url":"https://codeload.github.com/bombsimon/elixir-personnummer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244679160,"owners_count":20492354,"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","personnummer"],"created_at":"2024-10-13T19:15:39.575Z","updated_at":"2025-03-20T19:54:41.917Z","avatar_url":"https://github.com/bombsimon.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Personnummer\n\nValidate Swedish [personal identity\nnumbers](https://en.wikipedia.org/wiki/Personal_identity_number_(Sweden)) with\n[Elixir](https://elixir-lang.org/).\n\n## Usage\n\n### Just validation\n\n```elixir\niex(1)\u003e Personnummer.valid?(\"19900101-0017\")\ntrue\n```\n\n### Validation and additional information\n\n```elixir\niex(1)\u003e {:ok, pnr} = Personnummer.new(\"19900101-0017\")\n{:ok,\n %Personnummer{\n   control: 7,\n   coordination: false,\n   date: ~D[1990-01-01],\n   separator: \"-\",\n   serial: 1\n }}\niex(2)\u003e Personnummer.valid?(pnr)\ntrue\niex(3)\u003e gender = if Personnummer.is_female?(pnr) do \"female\" else \"male\" end\n\"male\"\niex(4)\u003e IO.puts \"The person with personal identity number #{Personnummer.format(pnr)} is a #{gender} of age #{Personnummer.get_age(pnr)}\"\nThe person with personal identity number 900101-0017 is a male of age 30\n:ok\n```\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `personnummer` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:personnummer, \"~\u003e 3.0.0\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/personnummer](https://hexdocs.pm/personnummer).\n\n## Testing\n\nUse `mix test` to run doctests and unit tests.\n\n## Documentation\n\nDocumentation can be found at\n[bombsimon.github.io/elixir-personnummer](https://bombsimon.github.io/elixir-personnummer/).\nTo generate new documentation, run\n\n```sh\nmix docs -f html -o docs\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbombsimon%2Felixir-personnummer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbombsimon%2Felixir-personnummer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbombsimon%2Felixir-personnummer/lists"}