{"id":16009694,"url":"https://github.com/librecat/catmandu","last_synced_at":"2025-05-16T04:03:47.149Z","repository":{"id":961983,"uuid":"750908","full_name":"LibreCat/Catmandu","owner":"LibreCat","description":"Catmandu - a data processing toolkit ","archived":false,"fork":false,"pushed_at":"2025-02-21T13:19:35.000Z","size":55810,"stargazers_count":187,"open_issues_count":32,"forks_count":35,"subscribers_count":22,"default_branch":"dev","last_synced_at":"2025-05-16T04:03:46.582Z","etag":null,"topics":["cli","code4lib","csv","data-processing","data-wrangling","datamining","ead","json","lido","mab","marc21","mods","oai-pmh","parser","perl","rdf","xml","xsd","yaml","z39-50"],"latest_commit_sha":null,"homepage":"https://librecat.org","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LibreCat.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"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":"2010-07-01T08:27:16.000Z","updated_at":"2025-03-10T14:56:18.000Z","dependencies_parsed_at":"2023-07-07T11:01:55.926Z","dependency_job_id":"e4070263-c762-4ac9-9459-2c3a9d942742","html_url":"https://github.com/LibreCat/Catmandu","commit_stats":{"total_commits":2104,"total_committers":23,"mean_commits":91.47826086956522,"dds":0.4092205323193916,"last_synced_commit":"32dad74991eb5dd9c2607f6f89e62c88cb73fff4"},"previous_names":[],"tags_count":148,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LibreCat%2FCatmandu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LibreCat%2FCatmandu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LibreCat%2FCatmandu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LibreCat%2FCatmandu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LibreCat","download_url":"https://codeload.github.com/LibreCat/Catmandu/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464891,"owners_count":22075570,"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","code4lib","csv","data-processing","data-wrangling","datamining","ead","json","lido","mab","marc21","mods","oai-pmh","parser","perl","rdf","xml","xsd","yaml","z39-50"],"created_at":"2024-10-08T13:03:37.580Z","updated_at":"2025-05-16T04:03:47.124Z","avatar_url":"https://github.com/LibreCat.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME \n\nCatmandu::Introduction - A 5 minute introduction to Catmandu\n\n# HELLO WORLD\n\n    $ catmandu convert Null --fix 'add_field(hello,world)'\n    [{\"hello\":\"world\"}]    \n\nThe example above generates the JSON output `[{\"hello\":\"world\"}]`\non the standard output. We asked the Catmandu processor to convert\nan empty input (`Null`) and add one property `hello` with value\n`world`.\n\nWe can ask Catmandu not to generate the default JSON output but\nconvert to a YAML output:\n\n    $ catmandu convert Null --fix 'add_field(hello,world)' to YAML\n    ---\n    hello: world\n    ...  \n\n# FORMAT to FORMAT\n\nCatmandu can be used to convert an input format to an output format.\nUse the keyword `to` on the command line:\n\n    $ cat file.yaml\n    ---\n    hello: world\n    ... \n    $ catmandu convert YAML to JSON \u003c file.yaml\n    [{\"hello\":\"world\"}]  \n\nThe left part of the `to` keyword is called the `Importer`, the \nright part of the `to` keyword is called the `Exporter`. Catmandu\nprovides Importers and Exports for many formats.\n\n# OPTIONS\n\nEach Importer and Exporter can have options that change the behavior\nof conversion. The options can be read using the `perldoc` command \non each Importer and Exports:\n\n    perldoc Catmandu::Importer::YAML\n    perldoc Catmandu::Exporter::JSON\n\nNote, many formats are available as Importer and Exporter.\n\nAs an example, we can use a JSON Exporter option `pretty` to provide\na pretty printed version of the JSON:\n\n    $ catmandu convert YAML to JSON --pretty 1 \u003c file.yaml\n    [{ \n        \"hello\" : \"world\"\n    }]\n\n# FIX LANGUAGE\n\nMany data conversions need a mapping from one field to another field plus\noptional conversions of the data inside these fields. Catmandu provides\nthe `Fix` language to assist in these mappings. A full list Fix \nfuncton is available at [https://librecat.org/assets/catmandu\\_cheat\\_sheet.pdf](https://librecat.org/assets/catmandu_cheat_sheet.pdf).\n\nFixes can be provided inline as text argument of the command line `--fix` \nargument, or as a pointer to a `Fix Script`. A Fix Scripts groups one or\nmore fixes in a file.\n\n    $ cat example.fix\n    add_field('address.street','Walker Street')\n    add_field('address.number','15')\n    copy_field('colors.2','best_color')\n\n    $ cat data.yaml\n    ---\n    colors:\n    - Red\n    - Green\n    - Blue\n    ...\n\n    $ catmandu convert YAML --fix example.fix to YAML \u003c data.yaml\n    ---\n    address:\n        number: '15'\n        street: Walker Street\n    best_color: Blue\n    colors:\n        - Red\n        - Green\n        - Blue\n    ...\n\nIn the example we created the Fix Script `example.fix` that contains\na combination of mappings and data conversion on (nested) data. We \nrun a YAML to YAML conversion using the `example.fix` Fix Script.\n\n# SPECIALIZATIONS\n\nCatmandu was mainly created for data conversions of specialized metadata\nlanguages in the field of libraries, archives and museums. One of the\nspecialized Importers (and Export) is the [Catmandu::MARC](https://metacpan.org/pod/Catmandu%3A%3AMARC) package. This\npackage can read, write and convert MARC files.\n\nFor instance, to extract all the titles from an ISO MARC file one could \nwrite:\n\n    $ cat titles.fix\n    marc_map('245',title)\n    retain(title)\n\n    $ catmandu convert MARC --type ISO --fix titles.fix to CSV \u003c data.mrc\n\nThe `marc_map` is a specialized Fix function for MARC data. In the example\nabove the `245` field of each MARC record is mapped to the `title` field.\nThe `retain` Fix function keeps only the `title` field in the output.\n\n# TUTORIAL\n\nA 18 day tutorial on Catmandu and the Fix language is available at\n[https://librecatproject.wordpress.com/tutorial/](https://librecatproject.wordpress.com/tutorial/). \n\nMore information is also available in our wiki [https://github.com/LibreCat/Catmandu/wiki](https://github.com/LibreCat/Catmandu/wiki)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrecat%2Fcatmandu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibrecat%2Fcatmandu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrecat%2Fcatmandu/lists"}