{"id":19027640,"url":"https://github.com/danielefongo/attributes","last_synced_at":"2026-05-01T18:30:20.364Z","repository":{"id":57479061,"uuid":"372494623","full_name":"danielefongo/attributes","owner":"danielefongo","description":"Set and get complex attributes on modules","archived":false,"fork":false,"pushed_at":"2021-06-11T11:46:15.000Z","size":50,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-03T13:45:49.338Z","etag":null,"topics":["attributes","complex","elixir","macro"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielefongo.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2021-05-31T12:13:12.000Z","updated_at":"2021-06-11T11:43:31.000Z","dependencies_parsed_at":"2022-09-17T04:42:15.658Z","dependency_job_id":null,"html_url":"https://github.com/danielefongo/attributes","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielefongo%2Fattributes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielefongo%2Fattributes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielefongo%2Fattributes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielefongo%2Fattributes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielefongo","download_url":"https://codeload.github.com/danielefongo/attributes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240079607,"owners_count":19744720,"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":["attributes","complex","elixir","macro"],"created_at":"2024-11-08T21:08:46.824Z","updated_at":"2026-05-01T18:30:20.284Z","avatar_url":"https://github.com/danielefongo.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Attributes\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/danielefongo/attributes/ci)\n![Coveralls](https://img.shields.io/coveralls/github/danielefongo/attributes/main)\n[![Hex pm](http://img.shields.io/hexpm/v/attributes.svg?style=flat)](https://hex.pm/packages/attributes)\n![Hex.pm](https://img.shields.io/hexpm/l/attributes)\n\nManipulate complex attributes on modules.\n\n## Installation\n\nThe package can be installed by adding `attributes` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:attributes, \"~\u003e 0.4.0\"}\n  ]\nend\n```\n\n## Documentation\n\nFull documentation can be found at [https://hexdocs.pm/attributes](https://hexdocs.pm/attributes).\n\n## Usage\n\nAttributes offers utility functions to manipulate complex attributes on modules.\n\nA typical usage could be inside macros that need to enrich modules before their compilation.\nYou can set, get, update or delete attributes' tree.\n\n```elixir\ndefmodule MyModule do\n  Attributes.set(__MODULE__, [:path, :to, :attr], :value)\nend\n```\n\nAttributes supports nested maps and keyword.\nThe previous assignment could be rewritten as follow:\n\n```elixir\nAttributes.set(__MODULE__, [:path], [to: [attr: :value]])\n```\n\n```elixir\nAttributes.set(__MODULE__, [:path], %{to: %{attr: :value}})\n```\n\nAfter defining an attribute, you can obtain its value using `Attributes.get/2`, `Attributes.get/3` or `Attributes.get!/2` methods.\n\n```elixir\niex\u003e Attributes.get(MyModule, [:path, :to, :attr])\niex\u003e :value\n```\n\n```elixir\niex\u003e Attributes.get(MyModule, [:path, :to])\niex\u003e [attr: :value]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielefongo%2Fattributes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielefongo%2Fattributes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielefongo%2Fattributes/lists"}