{"id":13579009,"url":"https://github.com/Chemaclass/edifact-parser","last_synced_at":"2025-04-05T20:32:52.741Z","repository":{"id":62324684,"uuid":"220533245","full_name":"Chemaclass/edifact-parser","owner":"Chemaclass","description":"A parser for a UN/EDIFACT file in PHP","archived":false,"fork":false,"pushed_at":"2024-11-06T20:36:44.000Z","size":911,"stargazers_count":16,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T07:33:26.284Z","etag":null,"topics":["edi","edifact","parser","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/chemaclass/edifact-parser","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chemaclass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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},"funding":{"custom":["https://www.paypal.me/chemaclass"]}},"created_at":"2019-11-08T19:20:33.000Z","updated_at":"2025-03-29T22:07:09.000Z","dependencies_parsed_at":"2024-05-18T16:49:48.016Z","dependency_job_id":null,"html_url":"https://github.com/Chemaclass/edifact-parser","commit_stats":{"total_commits":155,"total_committers":4,"mean_commits":38.75,"dds":0.2774193548387097,"last_synced_commit":"09df1e313060cbb33362bfb911e22975f588a25f"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fedifact-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fedifact-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fedifact-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fedifact-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chemaclass","download_url":"https://codeload.github.com/Chemaclass/edifact-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305905,"owners_count":20917201,"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":["edi","edifact","parser","php"],"created_at":"2024-08-01T15:01:35.768Z","updated_at":"2025-04-05T20:32:51.651Z","avatar_url":"https://github.com/Chemaclass.png","language":"PHP","readme":"# EDIFACT Parser\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Chemaclass/EdifactParser/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Chemaclass/EdifactParser/?branch=master)\n[![Type Coverage](https://shepherd.dev/github/Chemaclass/EdifactParser/coverage.svg)](https://shepherd.dev/github/chemaclass/EdifactParser)\n[![CI](https://github.com/Chemaclass/EdifactParser/workflows/CI/badge.svg?branch=master)](https://github.com/Chemaclass/EdifactParser/actions)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg?style=flat-square)](https://php.net/)\n\nEDIFACT stands for `Electronic Data Interchange For Administration, Commerce, and Transport`. \n\nThis repository contains a parser for any EDIFACT file to extract the values from any segment\ndefined in an EDIFACT formatted file. \n\nOk, but... [What is EDIFACT?](/docu/README.md)\n\n## Format of an EDIFACT file\n\n* Each line of the file consists of a set of data that belongs to a specific segment of a message.\n\n* A segment is defined by a tag. Following the rest of the data that belongs to that segment. More about segments [here](/docu/segments/README.md).\n\n* A message is a list of segments. Usually, all segments between the UNH and UNT segments compound a message.\n\n* A transaction is the list of messages that belongs to a file. \n\n### Installation\n\n```bash\ncomposer require chemaclass/edifact-parser\n```\n\n### Contribute\n\nYou are more than welcome to contribute reporting\n[issues](https://github.com/gacela-project/gacela/issues),\nsharing [ideas](https://github.com/gacela-project/gacela/discussions),\nor [contributing](.github/CONTRIBUTING.md) with your Pull Requests.\n\n### Basic examples\n\nYou can see a full example of [printing segments](example/printing-segments.php).\n\nYou can see a full example of [extracting data](example/extracting-data.php).\n\n```php\n\u003c?php declare(strict_types=1);\n\nuse EdifactParser\\EdifactParser;\nuse EdifactParser\\Segments\\NADNameAddress;\n\nrequire dirname(__DIR__) . '/vendor/autoload.php';\n\n$fileContent = \u003c\u003c\u003cEDI\nUNA:+.? '\nUNB+UNOC:3+9457386:30+73130012:30+19101:118+8+MPM 2.19+1424'\n\nUNH+1+IFTMIN:S:93A:UN:PN001'\nTDT+20'\nNAD+CZ+0410106314:160:Z12++Company Centre+c/o Carrier AB+City1++12345+DE'\nNAD+CN+++Person Name+Street Nr 2+City2++12345+DE'\nUNT+18+1'\n\nUNZ+2+8'\nEDI;\n\n$parserResult = EdifactParser::createWithDefaultSegments()-\u003eparse($fileContent);\n$firstMessage = $parserResult-\u003etransactionMessages()[0];\n\n$cnNadSegment = $firstMessage-\u003esegmentByTagAndSubId('NAD', 'CN');\n$personName = $cnNadSegment-\u003erawValues()[4];\n\nvar_dump($personName); // 'Person Name'\n```\n\n","funding_links":["https://www.paypal.me/chemaclass"],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChemaclass%2Fedifact-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChemaclass%2Fedifact-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChemaclass%2Fedifact-parser/lists"}