{"id":18873735,"url":"https://github.com/chobeat/hypothesis-csv","last_synced_at":"2025-04-14T16:21:36.610Z","repository":{"id":62570014,"uuid":"141624652","full_name":"chobeat/hypothesis-csv","owner":"chobeat","description":"Extension for the hypothesis framework to support the generative testing with CSV input","archived":false,"fork":false,"pushed_at":"2024-01-22T10:08:45.000Z","size":77,"stargazers_count":25,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T05:05:35.380Z","etag":null,"topics":["csv","generative-testing","hypothesis","property-based-testing","python-library","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chobeat.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","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":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-19T19:53:37.000Z","updated_at":"2024-11-27T10:51:20.000Z","dependencies_parsed_at":"2024-01-22T12:17:47.830Z","dependency_job_id":"52424d56-ab8f-458b-9808-d70248fd14de","html_url":"https://github.com/chobeat/hypothesis-csv","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":"0.16000000000000003","last_synced_commit":"a3659211d925c1739bf7d9aa04b550c9658f0912"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chobeat%2Fhypothesis-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chobeat%2Fhypothesis-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chobeat%2Fhypothesis-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chobeat%2Fhypothesis-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chobeat","download_url":"https://codeload.github.com/chobeat/hypothesis-csv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"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","generative-testing","hypothesis","property-based-testing","python-library","python3"],"created_at":"2024-11-08T05:35:42.155Z","updated_at":"2025-04-14T16:21:36.583Z","avatar_url":"https://github.com/chobeat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==============\nhypothesis-csv\n==============\n\n\n:code:`hypothesis-csv` is an extension to the `hypothesis` framework. The goal of this framework is to offer a flexible tool\nto perform generative-testing/property-based testing for software that accepts CSV files as an input.\n\n\n\nDescription\n===========\n\n`hypothesis-csv` is designed with two main use cases in mind:\n\n* test software that accepts a wide spectrum of CSV formats and doesn't make assumptions on the content (i.e. CSV parsers)\n* test software that accepts very specific CSV formats and makes assumption on the content, types and header fields.\n\nIt provides two strategies, :code:`data_rows` and :code:`csv`, to pursue this goal, both contained in the `strategies` module.\nPlease refer to their documentation and the examples for more details.\n\nExamples\n========\n\nGenerate arbitrary, non-empty CSV\n---------------------------------\n\n.. code-block:: python\n    :name: Generate arbitrary, non-empty CSV\n\n    from hypothesis_csv.strategies import csv\n    @given(csv=csv())\n    def test_my_csv_parse(csv):\n        parsed_csv=my_csv_parser(csv)\n        assert ...\n\nGenerate CSV of a given size (5 columns x 20 rows)\n--------------------------------------------------\n\n.. code-block:: python\n    :name: Generate CSV of a given size (5 columns x 20 rows)\n\n    from hypothesis_csv.strategies import csv\n    @given(csv=csv(lines=20,header=5))\n    def test_my_csv_parse(csv):\n        parsed_csv=my_csv_parser(csv)\n        assert parsed_csv.num_columns == 5\n        assert parsed_csv.num_rows == 20\n\n\n\nGenerate CSV with a header\n--------------------------\n.. code-block:: python\n    :name: Generate CSV with a header\n\n    from hypothesis_csv.strategies import csv\n    @given(csv=csv(header=[\"timestamp\",\"val_1\",\"val_2\"]))\n    def test_my_csv_parse(csv):\n        parsed_csv=my_csv_parser(csv)\n        assert parsed_csv.num_columns == 3\n\n\nGenerate CSV with columns of a given type\n-----------------------------------------\n\n.. code-block:: python\n    :name: Generate CSV with columns of a given type\n\n    from hypothesis_csv.strategies import csv\n    @given(csv=csv(columns=[text(),int(),float()]))\n    def test_my_csv_parse(csv):\n        parsed_csv=my_csv_parser(csv)\n        assert parsed_csv.num_columns == 3\n\n\nGenerate CSV with a given dialect\n---------------------------------\n\n.. code-block:: python\n    :name: Generate CSV in a given dialect\n\n    from hypothesis_csv.strategies import csv\n    @given(csv=csv(columns=[text(),int(),float()], dialect=\"excel-tab\"))\n    def test_my_csv_parse(csv):\n        ...\n\nGenerate CSV with drawns dialects\n---------------------------------\n\n.. code-block:: python\n    :name: Generate CSV with drawns dialects\n\n    from hypothesis_csv.strategies import csv\n    @given(csv=csv(columns=[text(),int(),float()], dialect=None))\n    def test_my_csv_parse(csv):\n        ...\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchobeat%2Fhypothesis-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchobeat%2Fhypothesis-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchobeat%2Fhypothesis-csv/lists"}