{"id":13508625,"url":"https://github.com/parroty/exprintf","last_synced_at":"2026-02-22T14:43:57.154Z","repository":{"id":10235042,"uuid":"12337316","full_name":"parroty/exprintf","owner":"parroty","description":"A printf / sprintf library for Elixir. It works as a wrapper for :io.format.","archived":false,"fork":false,"pushed_at":"2024-08-05T09:09:16.000Z","size":27,"stargazers_count":33,"open_issues_count":0,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T22:20:49.816Z","etag":null,"topics":[],"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/parroty.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-24T03:13:36.000Z","updated_at":"2024-11-15T17:43:25.000Z","dependencies_parsed_at":"2024-11-01T08:41:16.084Z","dependency_job_id":null,"html_url":"https://github.com/parroty/exprintf","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexprintf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexprintf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexprintf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexprintf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parroty","download_url":"https://codeload.github.com/parroty/exprintf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314011,"owners_count":20757450,"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":[],"created_at":"2024-08-01T02:00:55.800Z","updated_at":"2025-10-21T19:02:11.974Z","avatar_url":"https://github.com/parroty.png","language":"Elixir","funding_links":[],"categories":["Miscellaneous"],"sub_categories":[],"readme":"ExPrintf [![Build Status](https://secure.travis-ci.org/parroty/exprintf.png?branch=master \"Build Status\")](http://travis-ci.org/parroty/exprintf)\n============\nA printf / sprintf library for Elixir. It works as a wrapper for :io.format.\n\nWhen learning Elixir / Erlang, remembering :io.format style is a little tough. This one can be used as syntax sugar, or an util to convert printf format to Elixir (Erlang) one.\n\n# Examples\n\n## Basic Usage\n\n```elixir\ndefmodule Sample do\n  import ExPrintf\n\n  def test do\n    printf(\"number = %d\\n\", [10])\n    # -\u003e number = 10\n    IO.puts sprintf(\"string = %s\", [\"abc\"])\n    # -\u003e string = abc\n\n    format = parse_printf(\"format = %d %.2f\\n\")\n    IO.inspect format\n    # -\u003e \"format = ~w ~.2f\\n\"\n    :io.format(format, [10, 10.153])\n    # -\u003e format = 10 10.15\n\n    IO.puts :io_lib.format(format, [10, 10.153])\n    # -\u003e format = 10 10.15\n  end\nend\n\nSample.test\n```\n\n## Sample Execution\n\n```\n$ mix run sample.ex\nnumber = 10\nstring = abc\n\"format = ~w ~.2f\\n\"\nformat = 10 10.15\n```\n\n## iex\n\n```\n$ git clone git@github.com:parroty/exprintf.git\n$ cd exprintf\n$ ./run_iex.sh\n$ iex(1) -\u003e parse_printf(\"%d\")\n\"~w\"\n```\n\n## Dynamo\nThe following hosts a sample dynamo application for the printf format conversion.\n\n\u003ca href=\"http://dynamo-exprintf.herokuapp.com/\" target=\"_blank\"\u003ehttp://dynamo-exprintf.herokuapp.com/\u003c/a\u003e\n\n## TODO\n- Improve error checking\n- Improve format support coverage\n  - sprintf(\"%05d\", [-10]) results in \"00-10\", instead of \"-00010\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparroty%2Fexprintf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparroty%2Fexprintf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparroty%2Fexprintf/lists"}