{"id":25824375,"url":"https://github.com/ghokun/convert","last_synced_at":"2025-08-01T19:07:20.587Z","repository":{"id":65704307,"uuid":"579492386","full_name":"ghokun/convert","owner":"ghokun","description":"Convert your data files","archived":false,"fork":false,"pushed_at":"2025-07-27T22:43:53.000Z","size":673,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T00:24:11.814Z","etag":null,"topics":["csv","graalvm","gradle","java24","jreleaser","json","properties","toml","yaml"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghokun.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-17T21:46:51.000Z","updated_at":"2025-07-27T22:43:57.000Z","dependencies_parsed_at":"2023-10-19T00:00:34.946Z","dependency_job_id":"7acfee9e-b5ee-47a9-945d-8a1c76927e4f","html_url":"https://github.com/ghokun/convert","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ghokun/convert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghokun%2Fconvert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghokun%2Fconvert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghokun%2Fconvert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghokun%2Fconvert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghokun","download_url":"https://codeload.github.com/ghokun/convert/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghokun%2Fconvert/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268281825,"owners_count":24225159,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["csv","graalvm","gradle","java24","jreleaser","json","properties","toml","yaml"],"created_at":"2025-02-28T12:50:13.887Z","updated_at":"2025-08-01T19:07:20.528Z","avatar_url":"https://github.com/ghokun.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convert [![Build](https://github.com/ghokun/convert/actions/workflows/build.yaml/badge.svg)](https://github.com/ghokun/convert/actions/workflows/build.yaml)\n\nThis is a data file converter that supports following files:\n\n- [CSV](https://www.rfc-editor.org/rfc/rfc4180)\n- [TSV](https://www.iana.org/assignments/media-types/text/tab-separated-values)\n- [JSON](https://www.rfc-editor.org/rfc/rfc8259)\n- [YAML](https://yaml.org/spec/history/2001-05-26.html)\n- [TOML](https://toml.io/en/)\n- [properties](https://en.wikipedia.org/wiki/.properties)\n\n## Install\n\n```shell\nbrew install ghokun/tap/convert\n\n# or\nbrew tap ghokun/tap\nbrew install convert\n```\n\n## Usage\n\n```bash\n# Simple conversions\nconvert --input abc.csv --output abc.json\nconvert --input abc.yaml --output abc.properties\nconvert --input abc.toml --output abc.csv\n\n# Prettify json\nconvert --input abc.json --output pretty-abc.json --pretty\n\n# Minify json\nconvert --input pretty-abc.json --output abc.json\n\n# Indent yaml\n#\n# abc:       abc:\n# - item1 -\u003e   - item1\n# - item2      - item2\n#\nconvert --input abc.yaml --output indented-abc.yaml --indent-yaml\n\n# Minimize yaml quotes\n#\n# abc: \"Hello world!\" -\u003e abc: Hello world!\nconvert --input abc.yaml --output abc-without-quotes.yaml --minimize-yaml-quotes\n\n# Deduplicate keys\n# This:\n# [\n#   {\n#     \"key1\": \"value1\",\n#     \"key2\": \"value2\"\n#   },\n#   {\n#     \"key1\": \"value3\",\n#     \"key2\": \"value4\"\n#   }\n# ]\n#\n# Becomes this:\n# {\n#   \"keys\" : [ \"key1\", \"key2\" ],\n#   \"values\" : [ [ \"value1\", \"value2\" ], [ \"value3\", \"value4\" ] ]\n# }\nconvert --input abc.json --output dedup-abc.json --deduplicate-keys\n```\n\n## Purpose of another converter\n\nI am aware that there are many file converters, even online ones, available for free. Consider this as a playground since I wanted to practice/learn the\nfollowing technologies:\n\n- [Gradle](https://gradle.org)\n- Native compilation with [GraalVM](https://www.graalvm.org)\n- [JReleaser](https://jreleaser.org)\n- [Releasing a homebrew formula](https://docs.brew.sh/Adding-Software-to-Homebrew)\n- Visualizing native image size\n  with [GraalVM Dashboard](https://www.graalvm.org/dashboard/?ojr=help%3Btopic%3Dgetting-started.md)\n- Even smaller binaries with [UPX](https://upx.github.io)\n\n## Development\n\n```bash\n# Switch java version (If you are using SDKMAN!)\nsdk env\n\n# Format code\n./gradlew spotlessApply\n\n# Do static analysis, compile and test\n./gradlew check\n\n# Compile the project and build a native executable\n./gradlew nativeRun\n\n# Run the native executable\n./build/native/nativeCompile/convert\n\n# Run the application with the agent on JVM\n./gradlew -Pagent run\n\n# Copy metadata into /META-INF/native-image directory\n./gradlew metadataCopy --task run --dir src/main/resources/META-INF/native-image\n\n# Build a native executable using metadata\n./gradlew nativeCompile\n\n# Run the native executable\n./build/native/nativeCompile/convert\n\n# Run JUnit tests\n./gradlew nativeTest\n\n# Run tests on JVM with the agent\n./gradlew -Pagent test\n\n# Test building a native executable using metadata\n./gradlew -Pagent nativeTest\n\n# Generate a distributable package with VERSION\n./gradlew -Pversion=${VERSION} nativeCompile generatePackage\n\n# End to end test\n./gradlew e2e\n```\n\n## TODO list\n\n- [x] Basic setup (project structure, formatting, static analysis, testing)\n- [x] Implement all possible file conversions\n  - [x] CSV needs special implementation, others are trivial\n- [ ] GraalVM setup\n  - [x] Native compilation\n  - [x] Generate/Analyze/Validate reflection configs\n  - [ ] Visualize image size with GraalVM Dashboard\n- [x] Set up JReleaser to release on:\n  - [x] GitHub\n  - [x] Homebrew\n- [x] Build for OS / Arch combinations:\n  - [x] Darwin - x86_64\n  - [x] Darwin - aarch64 (self hosted runner)\n  - [x] Linux - x86_64\n  - [x] Linux - aarch64 (self hosted docker runner)\n- [ ] Streaming support\n  - [ ] Read data from `STDIN`\n  - [ ] Handle huge files\n  - [ ] Handle partial inputs (streaming json logs ?)\n- [x] Minify binary with UPX on supported platforms\n- [x] Have fun\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghokun%2Fconvert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghokun%2Fconvert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghokun%2Fconvert/lists"}