{"id":16088208,"url":"https://github.com/kesha1225/typedcsv","last_synced_at":"2025-03-18T06:30:49.336Z","repository":{"id":113804852,"uuid":"313834289","full_name":"kesha1225/TypedCSV","owner":"kesha1225","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-26T13:14:09.000Z","size":108,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T07:49:34.705Z","etag":null,"topics":["csv","csv-files","csv-reader","csv-types","csv-writer","typing"],"latest_commit_sha":null,"homepage":"","language":"Python","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/kesha1225.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":"2020-11-18T05:40:08.000Z","updated_at":"2025-01-27T17:46:51.000Z","dependencies_parsed_at":"2023-07-07T09:00:39.095Z","dependency_job_id":null,"html_url":"https://github.com/kesha1225/TypedCSV","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kesha1225%2FTypedCSV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kesha1225%2FTypedCSV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kesha1225%2FTypedCSV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kesha1225%2FTypedCSV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kesha1225","download_url":"https://codeload.github.com/kesha1225/TypedCSV/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243907263,"owners_count":20367200,"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-files","csv-reader","csv-types","csv-writer","typing"],"created_at":"2024-10-09T13:35:19.503Z","updated_at":"2025-03-18T06:30:49.328Z","avatar_url":"https://github.com/kesha1225.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypedCsv\n\nTyped extension for default [csv library](https://docs.python.org/3/library/csv.html)\n\nInstallation\n```\npip install typed_csv\n```\n\n\nPut your csv data into typed model\n```python\nfrom typed_csv import TypedReader, BaseModel\n\n\nclass UsersModel(BaseModel):\n    name: str\n    phone: int\n\n\nwith open(\"users.csv\") as csvfile:\n    typed_reader = TypedReader(csvfile, delimiter=\";\", model=UsersModel)\n    for row in typed_reader:\n        print(type(row))  # \u003cclass '__main__.UsersModel'\u003e\n        print(row.name)\n```\n\n\nPut your typed model into csv file\n\n```python\nfrom typed_csv import TypedWriter, BaseModel\n\n\nclass UsersModel(BaseModel):\n    name: str\n    phone: int\n\n\nwith open(\"users.csv\") as csvfile:\n    writer = TypedWriter(csvfile, model=UsersModel)\n    writer.writeheader()\n\n    writer.writerow(UsersModel(name=\"Kolya\", phone=89041588888))\n    writer.writerow(UsersModel(name=\"Antosha\", phone=89123456789))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkesha1225%2Ftypedcsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkesha1225%2Ftypedcsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkesha1225%2Ftypedcsv/lists"}