{"id":13622348,"url":"https://github.com/queer/utt","last_synced_at":"2025-04-08T14:08:03.418Z","repository":{"id":38298075,"uuid":"464308119","full_name":"queer/utt","owner":"queer","description":"utt is the universal text transformer","archived":false,"fork":false,"pushed_at":"2024-10-07T12:35:56.000Z","size":214,"stargazers_count":451,"open_issues_count":15,"forks_count":7,"subscribers_count":5,"default_branch":"mistress","last_synced_at":"2025-04-01T12:07:49.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/queer.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}},"created_at":"2022-02-28T02:08:06.000Z","updated_at":"2025-01-24T17:01:01.000Z","dependencies_parsed_at":"2023-02-12T18:16:06.555Z","dependency_job_id":"2e90fd07-4bef-41eb-9e1e-495075a32f1b","html_url":"https://github.com/queer/utt","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queer%2Futt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queer%2Futt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queer%2Futt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queer%2Futt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/queer","download_url":"https://codeload.github.com/queer/utt/tar.gz/refs/heads/mistress","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247856541,"owners_count":21007620,"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":[],"created_at":"2024-08-01T21:01:17.947Z","updated_at":"2025-04-08T14:08:03.384Z","avatar_url":"https://github.com/queer.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# utt\n\nutt is the **u**niversal **t**ext **t**ransformer. utt is intended for\nconverting between textual data representations. For example, utt can be used\nto convert from JSON to YAML:\n\n```bash\n$ echo \"[1, 2, 3]\" | utt -i json -o yaml\n---\n- 1\n- 2\n- 3\n\n$ \n```\n\nFormats may be supported for input-only or output-only. You can see all\nsupported formats by running `utt` with no arguments.\n\nAt the time of writing, supported formats are:\n- JSON\n- XML\n- CSV\n- YAML\n- Java Properties\n- TOML\n- Base 64\n- Plain Text\n- ROT13\n- PyON (Python Object Notation)\n\n![](https://cdn.mewna.xyz/2022/03/13/Je8X2G1iZq1D4.png)\n\nNote: \"universal\" is a *big* claim, and I understand that utt isn't truly\nuniversal. However, it is an active goal to work on supporting more and more\nformats and transformations to make utt as close to truly universal as\npossible.\n\n## Getting it\n\nA UNIX-compatible binary is automatically released here: https://github.com/queer/utt/releases.\nThis binary is just:\n```bash\n$ echo \"#!/usr/bin/env -S java -jar\" \u003e utt \u0026\u0026 cat utt-*.jar \u003e\u003e utt \u0026\u0026 chmod +x utt\n```\n\nOn Windows, run `mvn clean package` to create a JAR file in `target/`.\n\n### Why is it so big???\n\nUnfortunately, supporting everything under the sun requires dragging in a\npretty ridiculous set of libraries. For example, to support Python dict\nnotation, utt drags in an entire Python implementation via `jython-standalone`.\n\n## What and why\n\nutt (case-sensitive) is a tool for converting between textual data formats. utt\nwas originally written for a project that involved a lot of annoying\nconversions, to the point where one-off scripts wouldn't be enough. \n\nutt makes some tradeoffs in the name of functionality. For example, utt does\n*not* process data in a streaming manner, but rather loads the entire dataset\ninto memory before processing. In exchange, utt is more flexible in what it\naccepts as input and output formats. For example, utt can only output to CSV by\n[iterating over the input data to determine the output schema](https://github.com/queer/utt/blob/ffb886a64ecc24cf1320cf8adf5ec02cd9ad8221/src/main/java/gg/amy/utt/transform/impl/CsvTransformer.java#L34-L89).\nSimilarly, utt's mapping functionality relies on the GraalVM Polyglot API,\nwhich has a high (~500ms) startup time.\n\nWhile [pandoc](https://pandoc.org/) focuses more on converting between human\nformats like markdown and HTML, utt is more focused on converting between data\nformats understood by computers.\n\n## Examples\n\n### Convert from JSON to YAML\n\n```bash\n$ echo '{\"key\": [1, 2, 3]}' | utt -i json -o yaml\n---\nkey:\n- 1\n- 2\n- 3\n\n$\n```\n\n### Extract keys from a JSON object\n\n```bash\n$ echo '[{\"key\": 1}, {\"key\": 2}, {\"key\": 3}]' | utt -i json -o json -M '_.key'\n[1.0,2.0,3.0]\n$\n```\n\n### Flatten a list\n\n```bash\n$ echo '[[1], [2], [3]]' | utt -i json -o json -F\n[1.0,2.0,3.0]\n$\n```\n\n### Encode text with base64\n\n```bash\n$ echo \"this is a test\" | utt -i plain -o base64\ndGhpcyBpcyBhIHRlc3Q=\n$\n```\n\n### Extract inner values and flatten\n\n```bash\n$ echo '{\"key\": [1, [2], [[3]]]}' | utt -i json -o json -M '_.key' -F\n[1.0,2.0,3.0]\n$ \n```\n\n### Extract a JSON array from an XML object\n\n```bash\n$ echo \"\u003ca\u003e\u003cb\u003ec\u003c/b\u003e\u003cb\u003ec\u003c/b\u003e\u003cb\u003ec\u003c/b\u003e\u003cb\u003ec\u003c/b\u003e\u003c/a\u003e\" | utt -i xml -o json -M '$.b'\n[\"c\",\"c\",\"c\",\"c\"]\n$\n```\n\n### Apply a map function to the values of a list\n\n```bash\n$ echo \"[1,2,3]\" | utt -i json -o yaml -M \"_ * 2\"\n---\n- 2.0\n- 4.0\n- 6.0\n\n$\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueer%2Futt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqueer%2Futt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueer%2Futt/lists"}