{"id":17694460,"url":"https://github.com/diego-ivan/libvalentine","last_synced_at":"2026-01-08T12:37:34.576Z","repository":{"id":48598310,"uuid":"516960197","full_name":"Diego-Ivan/libvalentine","owner":"Diego-Ivan","description":"A multithreaded CSV serializer and deserializer for GLib.Objects","archived":false,"fork":false,"pushed_at":"2023-01-06T04:08:34.000Z","size":91,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T05:12:23.275Z","etag":null,"topics":["csv","vala","vala-libraries","vala-library"],"latest_commit_sha":null,"homepage":"","language":"Vala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Diego-Ivan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-23T04:48:13.000Z","updated_at":"2023-07-02T05:16:19.000Z","dependencies_parsed_at":"2023-02-05T07:01:16.512Z","dependency_job_id":null,"html_url":"https://github.com/Diego-Ivan/libvalentine","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Diego-Ivan%2Flibvalentine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Diego-Ivan%2Flibvalentine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Diego-Ivan%2Flibvalentine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Diego-Ivan%2Flibvalentine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Diego-Ivan","download_url":"https://codeload.github.com/Diego-Ivan/libvalentine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246394147,"owners_count":20770081,"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":["csv","vala","vala-libraries","vala-library"],"created_at":"2024-10-24T13:48:51.146Z","updated_at":"2026-01-08T12:37:34.518Z","avatar_url":"https://github.com/Diego-Ivan.png","language":"Vala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Libvalentine\n\nA library that can convert a CSV file to GLib.Objects and viceversa. For example:\n\n```vala\npublic class Example : Object {\n    public string name { get; set; default = \"hello\"; }\n    public int something { get; set; default = 1; }\n    \n    // This property is private read, therefore it won't appear in the CSV file\n    public bool boolean { private get; set; default = false; }\n}\n\nvar serializer = new Valentine.ObjectSerializer\u003cExample\u003e ();\nexample.add_object (new Example ());\nexample.add_object (new Example () { name = \"Hola\" });\nexample.add_object (new Example () { something = 2 });\n```\n\nWill have the following output:\n\n```csv\nname,something\n\"hello\",\"1\"\n\"hola\",\"1\"\n\"hello\",\"2\"\n```\n\nParsing a CSV text is done in the following way:\n\n```vala\nstring csv = \"\"\"name,something\n\"Object 1,\"45\"\n\"Object 7\",\"19\"\n\"Object 9\",\"13\"\n\"\"\"\n\nvar deserializer = new Valentine.ObjectDeserializer\u003cExample\u003e ();\nList\u003cExample\u003e object_list = deserializer.deserialize_from_string (csv);\n\nforeach (var object in Example) {\n    print (\"name: %s; something: \"%i\", object.name, object.something);\n}\n\n/*\n * Output:\n * name: Object 1; something: 45\n * name: Object 7; something: 19\n * name: Object 9; something: 13\n*/\n```\n\n## Usage\n\nValentine provides a simple API that converts GLib.Objects into a CSV file.\n\n```vala\nvar serializer = new Valentine.ObjectSerializer\u003cAdw.Flap\u003e ();\nserializer.add_object (new Adw.Flap ());\nserializer.add_object (new Adw.Flap ());\n\nstdout.printf (serializer.to_string ());\n```\n\nIt also provides an option to save the document directly to a file:\n```vala\nserializer.save_to_file (\"/var/home/user/Documents/my_file.csv\");\n```\n\nIt also provides an API that converts CSV files to Object Lists\n\n```vala\nvar deserializer = new Valentine.ObjectDeserializer\u003cAdw.Flap\u003e ();\nList\u003cAdw.Flap\u003e list = deserializer.deserializer_from_file (\"/path/to/csv/file.csv\");\n```\n\n## Features\n\nSupport for property types:\n\n- [x] Integers\n- [x] Booleans\n- [x] Strings\n- [x] Chars\n- [x] UChars\n- [x] Longs\n- [X] DateTimes\n- [x] Files\n- [x] Uint\n- [x] Floats\n- [x] Doubles\n- [X] Variants\n- [x] Flags\n- [x] Enums\n- [x] Possibility to add user defined functions to parse other types (such as custom classes)\n\nOther features:\n\n- [x] Save directly to a file\n- [x] Parse CSV file and create an object with an expected type\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiego-ivan%2Flibvalentine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiego-ivan%2Flibvalentine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiego-ivan%2Flibvalentine/lists"}