{"id":21131276,"url":"https://github.com/elgentos/parser","last_synced_at":"2025-07-09T01:33:42.132Z","repository":{"id":47047953,"uuid":"141400553","full_name":"elgentos/parser","owner":"elgentos","description":"Use this library to turn your day-to-day configurations into usable arrays/objects.","archived":false,"fork":false,"pushed_at":"2021-09-15T19:13:40.000Z","size":346,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-06-21T12:17:09.054Z","etag":null,"topics":["json","library","packagist","parser-combinators","parsers","php","yaml"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/elgentos.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":"2018-07-18T07:51:25.000Z","updated_at":"2022-07-06T21:44:33.000Z","dependencies_parsed_at":"2022-08-21T11:20:47.271Z","dependency_job_id":null,"html_url":"https://github.com/elgentos/parser","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/elgentos/parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgentos%2Fparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgentos%2Fparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgentos%2Fparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgentos%2Fparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elgentos","download_url":"https://codeload.github.com/elgentos/parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgentos%2Fparser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264375602,"owners_count":23598414,"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":["json","library","packagist","parser-combinators","parsers","php","yaml"],"created_at":"2024-11-20T05:52:38.398Z","updated_at":"2025-07-09T01:33:41.516Z","avatar_url":"https://github.com/elgentos.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Elgentos Content parser [![Build Status](https://travis-ci.org/elgentos/parser.svg?branch=master)](https://travis-ci.org/elgentos/parser)\nParse content from json/yaml/csv/text to a usable array\n\n## Description\nUse this library to turn your day-to-day configurations into\nusable arrays/objects.\n\nSupports json, yaml, csv, xml and plain text.\n\n```php\n\u003c?php\n/**\n * Read a file, import recursive and return a merged array\n */\n$data = Elgentos\\Parser::readFile('file.json');\n```\n\n```php\n\u003c?php\n/**\n * Read a file, no recursion\n */\n$data = Elgentos\\Parser::readSimple('file.json');\n```\n\n## Instalation\nTo use in your project require\n\n`composer require elgentos/parser`\n\nTo support YAML also require:\n\n`composer require symfony/yaml`\n\n## Directives\nYou can use directives inside your file.\n\n### @import\nLoad content of other files directly in your current file.\n\n*YAML*\n```yaml\nothercontent:\n  \"@import\": path/to/other/file.yaml\n```\n*JSON*\n```json\n{\n  \"othercontent\": {\"@import\": \"path/to/otherfile.yaml\"  }\n} \n```\n*CSV*\n```csv\n\"@import\"\n\"path/to/file.json\"\n\"path/to/otherfile.yaml\"\n\"path/to/file2.yaml\"\n```\n\n### @import-dir\nRead a directory recursively.\n\n```yaml\nbase:\n  \"@import-dir\": \"path/to/directory\"\n```\n```json\n{\n  \"base\": {\"@import-dir\": \"path/to/directory\"}\n}\n```\n\n## Customization\nDue Service Contracts you can easily add your own functionality:\n- Rules `\\Elgenttos\\Parser\\Interfaces\\RuleInterface`\n- Matcher `\\Elgenttos\\Parser\\Interfaces\\MatcherInterface`\n- Parser `\\Elgenttos\\Parser\\Interfaces\\RuleInterface`\n- Stories `\\Elgenttos\\Parser\\Interfaces\\StoriesInterface`\n\n## Automated creation of objects\n\n\n\n## Technical description\nFor our technical docs [docs/technical.md](docs/technical.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felgentos%2Fparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felgentos%2Fparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felgentos%2Fparser/lists"}