{"id":24299136,"url":"https://github.com/0x8b/datamatrix","last_synced_at":"2025-09-26T00:31:29.078Z","repository":{"id":48099778,"uuid":"234517884","full_name":"0x8b/datamatrix","owner":"0x8b","description":"Library that enables programs to write Data Matrix barcodes of the modern ECC200 variety.","archived":false,"fork":false,"pushed_at":"2021-08-06T17:31:19.000Z","size":292,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-15T12:16:49.526Z","etag":null,"topics":["cli","code","data","data-matrix","datamatrix","ecc","ecc200","elixir","generator","matrix"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/datamatrix","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/0x8b.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-01-17T09:40:17.000Z","updated_at":"2024-02-20T16:19:29.000Z","dependencies_parsed_at":"2022-08-12T18:40:16.653Z","dependency_job_id":null,"html_url":"https://github.com/0x8b/datamatrix","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/0x8b%2Fdatamatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x8b%2Fdatamatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x8b%2Fdatamatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x8b%2Fdatamatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0x8b","download_url":"https://codeload.github.com/0x8b/datamatrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234167279,"owners_count":18790028,"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":["cli","code","data","data-matrix","datamatrix","ecc","ecc200","elixir","generator","matrix"],"created_at":"2025-01-16T21:18:51.774Z","updated_at":"2025-09-26T00:31:28.600Z","avatar_url":"https://github.com/0x8b.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Matrix · [![GitHub license](https://img.shields.io/hexpm/l/datamatrix?color=brightgreen\u0026style=flat-square)](https://github.com/0x8b/datamatrix/blob/master/LICENSE) ![Downloads](https://img.shields.io/hexpm/dt/datamatrix?color=brightgreen\u0026style=flat-square)\n\nThis is a software library that enables programs to **write** Data Matrix barcodes of the modern ECC200 variety.\n\n- Supports rectangular symbols (this is optional according to ISO/IEC 16022:2006(E))\n\nReferences:\n\n- ISO/IEC 16022:2006(E)\n\n## Table of Contents\n\n- [Installation](#installation)\n- [CLI](#cli)\n- [Examples](#examples)\n- [Encoding parameters](#encoding-parameters)\n- [Rendering parameters](#rendering-parameters)\n  - [PNG](#png-parameters)\n  - [SVG](#svg-parameters)\n  - [Text](#text-parameters)\n- [Maximum data capacity](#maximum-data-capacity)\n- [Notes](#notes)\n- [Contributing](#contributing)\n- [Contact](#contact)\n- [License](#license)\n\n## Installation\n\nThe package can be installed by adding `datamatrix` to your list of dependencies in mix.exs:\n\n```exs\ndef deps do\n  [\n    {:datamatrix, \"~\u003e 0.1.3\"}\n  ]\nend\n```\n\nTo find out the latest release available on Hex, you can run `mix hex.info datamatrix` in your shell, or by going to the [datamatrix page on Hex.pm](https://hex.pm/packages/datamatrix)\n\nThen, update your dependencies:\n\n\n```console\n$ mix do deps.get, deps.compile\n```\n\n## CLI\n\nYou can create Data Matrix symbols using the command line as follows:\n\n1) Install `datamatrix` as an escript:\n\n```console\n$ mix escript.install github 0x8b/datamatrix\n```\n\n2) Then you are ready to use it:\n\n```console\n$ datamatrix -i input.txt -p        # or\n\n$ datamatrix input_text -p          # or\n\n$ cat input.txt | datamatrix - -p   # read standard input\n```\n\n**Note**: Don't forget to update your PATH environment variable if you want to invoke escripts by name.\n\nFor more details about using the command line tool, review the usage guide:\n\n```console\n$ datamatrix -h\n```\n\n## Examples\n\n```ex\ndata = \"hello\"\n\n{:ok, symbol} =\n  data\n  |\u003e DataMatrix.encode(shape: :rectangle)\n\npng =\n  symbol\n  |\u003e DataMatrix.format(:png, module_size: 8)\n\nFile.write(\"symbol.png\", png)\n```\n\n\u003cimg src=\"./docs/figures/example_rectangle_hello.png\" alt=\"Example rectangular Data Matrix\"\u003e\n\n```ex\n{:ok, symbol} = DataMatrix.encode(\"123456\", quiet_zone: 4)\n\nsvg = DataMatrix.format(symbol, :svg, light: \"#ffff00\", width: 200)\n\nFile.write!(\"square.svg\", svg)\n```\n\n\u003cimg src=\"./docs/figures/example_square.svg\" alt=\"Example square Data Matrix\"\u003e\n\n## Encoding parameters\n\n`DataMatrix.encode` returns `{:ok, symbol}` or `{:error, reason}`\n\n| Parameter | Default value | Description |\n| :-- | :-- | :-- |\n| `quiet_zone` | `1` | All four sides of symbol are surrounded by quiet zone border. |\n| `version` | auto | See [Maximum data capacity](#maximum-data-capacity). Version is selected automatically if not specified. |\n| `shape` | `:square` | Shape of symbol. Available shapes are `:square` and `:rectangle`. |\n\n\n## Rendering parameters\n\nAvailable output formats:\n\n- [PNG](#png-parameters)\n- [SVG](#svg-parameters)\n- [Text](#text-parameters)\n\n### PNG parameters\n\n| Parameter name | Default value | Description |\n| :-- | :-- | :-- |\n| `module_size` | `10` | Size of module in pixels. |\n| `dark` | `\"#000000\"` | Color of dark module. Only **#RRGGBB** |\n| `light` | `\"#ffffff\"` | Color of light module. Only **#RRGGBB**|\n\n### SVG parameters\n\n| Parameter name | Default value | Description |\n| :-- | :-- | :-- |\n| `width` | auto | Width in pixels (quiet zone included). |\n| `height` | auto | Height in pixels (quiet zone included). |\n| `viewbox` | `false` | Width and height are not included in SVG if `viewbox` is set to `true`. |\n| `module_size` | `5` | Size of module in pixles. |\n| `dark` | `\"black\"` | Color of dark module. Color syntax for SVG [w3.org 🡕](https://www.w3.org/TR/SVGColor12/#Color_syntax) |\n| `light` | `\"white\"` | Color of light module. |\n\n### Text parameters\n\n| Parameter name | Default value | Description |\n| :-- | :-- | :-- |\n| `dark` | `\"1\"` | Representation of dark module. |\n| `light` | `\"0\"` | Representation of light module. |\n| `separator` | `\"\"` | String that is used to join modules in a row. |\n| `newline` | `\"\\n\"` | String that is used to join rows. |\n\n## Maximum data capacity\n\n[See docs/maximum_data_capacity.md](docs/maximum_data_capacity.md)\n\n## Notes\n\nAll additional features mentioned below will be provided in next major releases.\n\nECC 200 includes various **encodation schemes** which allow a defined set of characters to be converted  into codewords more efficiently than the default scheme.\n\n**Extended  Channel  Interpretations** mechanism  enables characters from other character sets (e.g. Arabic, Cyrillic, Greek, Hebrew) and other data interpretations or industry-specific requirements to be represented.\n\n**Structured append** allows files of data to be represented in up to 16 Data Matrix  symbols.  The  original  data  can  be  correctly  reconstructed  regardless  of  the  order  in  which  the  symbols are scanned.\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to:\n- update tests as appropriate\n- run `mix format`\n\n## Contact\n\nIf you want to contact me you can reach me at \u003cmkgumienny@gmail.com\u003e\n\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x8b%2Fdatamatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0x8b%2Fdatamatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x8b%2Fdatamatrix/lists"}