{"id":21747936,"url":"https://github.com/its-just-nans/csv-to-custom-json-python","last_synced_at":"2026-02-08T20:33:23.707Z","repository":{"id":57417751,"uuid":"445854288","full_name":"Its-Just-Nans/csv-to-custom-json-python","owner":"Its-Just-Nans","description":"Easily transform your CSV to a custom JSON with cool options","archived":false,"fork":false,"pushed_at":"2024-12-29T18:54:02.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T03:04:38.174Z","etag":null,"topics":["csv","csv-parser","csv-to-json","csvtojson","custom-json","json","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Its-Just-Nans.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-01-08T15:21:08.000Z","updated_at":"2024-12-29T18:54:05.000Z","dependencies_parsed_at":"2024-11-26T08:11:19.927Z","dependency_job_id":"1b52ff24-af69-4a1e-8d69-3be5fcf35928","html_url":"https://github.com/Its-Just-Nans/csv-to-custom-json-python","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"a5583b7f013439ca76626f4a811b03edd5f2f45b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Its-Just-Nans%2Fcsv-to-custom-json-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Its-Just-Nans%2Fcsv-to-custom-json-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Its-Just-Nans%2Fcsv-to-custom-json-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Its-Just-Nans%2Fcsv-to-custom-json-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Its-Just-Nans","download_url":"https://codeload.github.com/Its-Just-Nans/csv-to-custom-json-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244723170,"owners_count":20499243,"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","csv-parser","csv-to-json","csvtojson","custom-json","json","python"],"created_at":"2024-11-26T08:11:07.457Z","updated_at":"2026-02-08T20:33:23.670Z","avatar_url":"https://github.com/Its-Just-Nans.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csv-to-custom-json-python [![pypi version](https://img.shields.io/pypi/v/csv-to-custom-json)](https://pypi.org/project/csv-to-custom-json/) ![pypi downloads](https://img.shields.io/pypi/dm/csv-to-custom-json)\n\n- [PyPi page](https://pypi.org/project/csv-to-custom-json/)\n- [PyPiStats](https://pypistats.org/packages/csv-to-custom-json)\n\n## How to install\n\n- [installation docs](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-install.md)\n\n```sh\npython3 -m pip install csv-to-custom-json\n```\n\n## Tests \u0026\u0026 coverage\n\nCoverage is 100%\n\n```sh\n# install\npython -m pip install coverage unittest\n\n# only test\npython -m unittest\n\n# coverage\ncoverage run -m unittest  \u0026\u0026 coverage report -m\n```\n\n## How to use csv-to-custom-json\n\n## Classic usage\n\nJust import the function and use it !\n\n```python\nfrom csv_to_custom_json import parseFile\n\nresult = parseFile(\"myfile.csv\")\n```\n\n## How to use the schema\n\nCreate a schema variable and put it as second parameter !\n\nExample with a simple `csv` :\n\n```csv\nnum1,num2,num3\n1,2,3\n4,5,6\n7,8,9\n```\n\n```python\nfrom csv_to_custom_json import parseFile\n\ndef callback(value):\n    return None\n\nschema = {\n    \"num1\": \"string\",\n    \"num2\": callback,\n    \"num3\": \"int\"\n}\n\nresult = parseFile(\"myfile.csv\", schema)\n```\n\n\u003e Caption :\n\u003e\n\u003e - ad you can see the schema can contains function, or string with the type\n\u003e - the values with type will be parsed\n\u003e - attribute of the object are the word in the first line of the csv\n\n## More complexe schema\n\nIt's the same as a simple schema :\n\n```python\nfrom csv_to_custom_json import parseFile\n\nschema = {\n    \"obj1\": {\n        \"obj2\": {\n            \"num4\": \"string\"\n        }\n    },\n    \"num2\": \"\",\n    \"num3\": \"\"\n}\nresult = parseFile(\"myfile.csv\", schema)\n```\n\nIf you want to check some real case, check out the folder `test` in the [GitHub repository](https://github.com/Its-Just-Nans/csv-to-custom-json-python)\n\nIf you want to see and use options check that documentation: [How-to-options](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-options.md)\n\n## See also\n\n- [Tricks](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-know-more.md)\n- [How-to-options](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-options.md)\n- [CHANGELOG.md](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/CHANGELOG.md)\n- [csv-to-custom-json in JavaScript](https://github.com/Its-Just-Nans/csv-to-custom-json)\n\n## License\n\nLicensed under the MIT License - [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fits-just-nans%2Fcsv-to-custom-json-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fits-just-nans%2Fcsv-to-custom-json-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fits-just-nans%2Fcsv-to-custom-json-python/lists"}