{"id":24227563,"url":"https://github.com/devprabal/csv","last_synced_at":"2026-05-28T13:31:22.179Z","repository":{"id":271262479,"uuid":"912805059","full_name":"devprabal/csv","owner":"devprabal","description":"C struct to csv file","archived":false,"fork":false,"pushed_at":"2025-01-06T15:51:21.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T06:14:33.274Z","etag":null,"topics":["c","csv","csv-export"],"latest_commit_sha":null,"homepage":"","language":"C","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/devprabal.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2025-01-06T12:35:32.000Z","updated_at":"2025-01-06T15:53:46.000Z","dependencies_parsed_at":"2025-01-06T16:49:53.516Z","dependency_job_id":"b6c87f26-039a-4dc3-a81c-6b5c16769422","html_url":"https://github.com/devprabal/csv","commit_stats":null,"previous_names":["devprabal/csv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devprabal/csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devprabal%2Fcsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devprabal%2Fcsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devprabal%2Fcsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devprabal%2Fcsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devprabal","download_url":"https://codeload.github.com/devprabal/csv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devprabal%2Fcsv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33611248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"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":["c","csv","csv-export"],"created_at":"2025-01-14T10:18:15.740Z","updated_at":"2026-05-28T13:31:22.161Z","avatar_url":"https://github.com/devprabal.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\n\nSerialize C structs into csv files by providing only number of rows, field conversion functions and field sizes.\n\n## Why\n\nI have often found serialization / deserialization as one of most frequent tasks in software. While one can achieve the same by writing normal C code, it becomes a mundane and error prone task when you need to do it again for some other module / structure.\n\nAlso, by this project I want to highlight the separation of **user** definitions from the library definitions. The library (`core.c`) has no idea how the structures are implemented. It only knows how to retrieve them (`void*`) using function pointers passed in its config from the user layer. This **separation of control** is often desirable in large projects and also demonstrates good software practice of loosely coupled modules, while maintaining high cohesion inside a module.\n\nWhile it may seem an over-work in this repo, but, if you follow the examples, you can add your own structure for serialization easily too. I have also provided *person* `struct` example which can use both global memory pool and heap storage for an array of people.\n\n## Compile and run\n\n```bash\nmake\n./main.out\n```\n## Output\n\n\n```c\nstruct Address_Internal_Rep {\n    int flat_no;\n    COUNTRY country;\n    char city[20];\n};\n\nstruct Person_Internal_Rep {\n    char name[NAME_BUF_SIZE];\n    char pronouns[PRONOUNS_BUF_SIZE];\n    uint8_t age;\n    Address_Internal_Rep address;\n    Person_Internal_Rep* next;\n};\n```\n\ngets converted into -\u003e \n\n\n```csv\nprabal, he/him, 25, flat_no. 204, Noida, IND, \ngopal, he/him, 23, flat_no. 101, Delhi, IND, \nshin dongjoon, he/him, 29, flat_no. 305, Gyeonggi-do, KOR, \nwoo soyeon, she/her, 26, flat_no. 204, Busan, KOR,\n```\n\n## Files\n\n```bash\ndevp@IdeaPad:/mnt/d/csv_github/csv$ tree -L 2\n.\n├── Makefile\n├── README.md\n├── adapter.h\n├── core.c\n├── core.h\n├── examples\n│   ├── external_definitions_ehs_schd.c\n│   ├── external_definitions_ehs_schd.h\n│   ├── external_definitions_person.c\n│   └── external_definitions_person.h\n├── main.c\n```\n\nEsentially, there are two major code files -  \n\n- `core.c` (converts your struct into csv file)\n- `external_definitions_person.c` (provide how to convert your struct into a string, call init api `csv_init()` and serialization api `v3()`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevprabal%2Fcsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevprabal%2Fcsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevprabal%2Fcsv/lists"}