{"id":19687874,"url":"https://github.com/engali94/xmljson","last_synced_at":"2025-04-29T08:34:19.696Z","repository":{"id":149623210,"uuid":"259739323","full_name":"engali94/XMLJson","owner":"engali94","description":"Swift CLI tool for converting any XML to JSON format","archived":false,"fork":false,"pushed_at":"2021-10-10T08:56:18.000Z","size":5037,"stargazers_count":49,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T14:03:25.297Z","etag":null,"topics":["cli","json","json-parser","swift","xml","xml-parsing","xmlserializer"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/engali94.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-04-28T20:03:26.000Z","updated_at":"2025-03-11T11:22:36.000Z","dependencies_parsed_at":"2023-06-11T08:32:40.976Z","dependency_job_id":null,"html_url":"https://github.com/engali94/XMLJson","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engali94%2FXMLJson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engali94%2FXMLJson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engali94%2FXMLJson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/engali94%2FXMLJson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/engali94","download_url":"https://codeload.github.com/engali94/XMLJson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251465150,"owners_count":21593836,"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","json","json-parser","swift","xml","xml-parsing","xmlserializer"],"created_at":"2024-11-11T18:36:22.741Z","updated_at":"2025-04-29T08:34:19.050Z","avatar_url":"https://github.com/engali94.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# XMLJSON\nA Swift command-line tool to easily convert XML format to JSON.\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/apple/swift-package-manager\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg\" alt=\"SPM\"\u003e\n\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/language-swift5.2-f48041.svg?style=flat\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg?style=flat\"/\u003e\n  \u003ca href=\"https://twitter.com/alihilal94\"\u003e\n  \t\u003cimg src=\"https://img.shields.io/badge/contact-@alihilal94-blue.svg?style=flat\" alt=\"Twitter: @alihilal94\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n![demo](https://github.com/engali94/XMLJson/blob/master/assets/xmljsonDemo.gif)\n\n### Requirements\n- Good Mood\n\n### Usage\n\n```\n$ xmljson -h\nOVERVIEW: Convert XML Format to JSON Format.\nUSAGE: xmljson --dir \u003cdir\u003e [--files \u003cfiles\u003e ...] [--output \u003coutput\u003e] [--verbose] [--all]\n\nOPTIONS:\n  -d, --dir \u003cdir\u003e         Absolute path to a directory containing the xml files.\n  -f, --files \u003cfiles\u003e     XML files to be parsed.\n  -o, --output \u003coutput\u003e   [Optinal] JSON file(s) output directory.\n  -v, --verbose           Show extra logging for debugging purposes.\n  -a, --all               Convert all XML files present in the specifed directory.\n  -h, --help              Show help information.\n```\n\n\n\n\nFirst specify where the xml files are located through `--dir` argument **(Manadatory)**\nThen you can specify the files to be converted in through `--files` argument you can pass as much as you want \n\n```bash\n$ xmljson -d ~/xml/files/dir - file1.xml filen.xml --verbose\n```\n\nIf you want to convert all the XML files present in the directory, pass the `--dir` argument and `--all` flag only.\n\n```bash\n$ xmljson -d ~/xml/files/dir  --all \n```\n\nif you would like to change the output directory pass it to `--output` .\n\n```bash\n$ xmljson -d ~/xml/files/dir  -o ~/path/to/output/dir --all \n```\n\n### Sample\nXML Input\n```xml\n?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cbookstore\u003e\n  \u003cbook category=\"cooking\"\u003e\n    \u003ctitle lang=\"en\"\u003eEveryday 1\u003c/title\u003e\n    \u003cauthor\u003eGiada De Laurentiis\u003c/author\u003e\n    \u003cyear\u003e2005\u003c/year\u003e\n    \u003cprice\u003e30.00\u003c/price\u003e\n  \u003c/book\u003e\n  \u003cbook category=\"web\"\u003e\n    \u003ctitle lang=\"en\"\u003eLearning XML\u003c/title\u003e\n    \u003cauthor\u003eErik T. Ray\u003c/author\u003e\n    \u003cyear\u003e2003\u003c/year\u003e\n    \u003cprice\u003e39.95\u003c/price\u003e\n  \u003c/book\u003e\n\u003c/bookstore\u003e\n```\n\nJSON Output\n```json\n[\n  {\n    \"author\" : \"Giada De Laurentiis\",\n    \"title\" : {\n      \"lang\" : \"en\",\n      \"text\" : \"Everyday 1\"\n    },\n    \"year\" : \"2005\",\n    \"category\" : \"cooking\",\n    \"price\" : \"30.00\"\n  },\n  {\n    \"author\" : \"Erik T. Ray\",\n    \"title\" : {\n      \"lang\" : \"en\",\n      \"text\" : \"Learning XML\"\n    },\n    \"year\" : \"2003\",\n    \"category\" : \"web\",\n    \"price\" : \"39.95\"\n  }\n]\n```\n### Installation using [HomeBrew](https://brew.sh)\nYou can install xmljson using homebrew as follows:\n\n```bash\n$ brew tap engali94/formulae\n$ brew install xmljson\n```\n### Installation using [Make](https://en.wikipedia.org/wiki/Make_%28software%29)\nYou can install xmljson using make as follows:\n\n```bash\n$ git clone https://github.com/engali94/XMLJson.git\n$ cd XMLJson\n$ make install\n```\n\n### Development\n- `cd` into the repository\n- run `swift package generate-xcodeproj` \n- Run the following command to try it out:\n\n\t```bash\n\tswift run XMLJson --help\n\t```\n\n### License\n\nXMLJson is released under the MIT license. See [LICENSE](https://github.com/engali94/XMLJson/blob/master/LICENSE) for more information.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengali94%2Fxmljson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengali94%2Fxmljson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengali94%2Fxmljson/lists"}