{ "info": { "author": "Cl\u00e9ment Bouscasse", "author_email": "clement.bouscasse@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# behave-pandas\n\nUtility package for the [Behave](https://github.com/behave/behave) BDD testing framework, to make converting gherkin tables\nto and from [pandas](https://github.com/pandas-dev/pandas) data frames a breeze.\n\n## Build Status\n![Travis CI badge](https://travis-ci.org/clembou/behave-pandas.svg?branch=master)\n\n## Installation\n\n```bash\npip install behave-pandas\n```\n\n## Features\n\n* Easily convert a Gherkin table into a pandas data frame with explicit dtype information\n* Easily convert a pandas data frame into a behave table that can be parsed by behave-pandas\n* Support converting data frames with multiple index levels either on columns or rows\n* Handle missing data for dtypes that support it.\n\n## API\n\nThe behave-pandas api is extremely simple, and consists in two functions:\n\n```python\nfrom behave_pandas import table_to_dataframe, dataframe_to_table\n```\n\n## Example\n\n```gherkin\nFeature: Table printer\n\n as a tester\n I want to be able to create gherkin tables from existing data frames\n\n Scenario: simple index\n Given a gherkin table as input\n | str | float | str |\n | index_col | float_col | str_col |\n | egg | 3.0 | silly walks |\n | spam | 4.1 | spanish inquisition |\n | bacon | 5.2 | dead parrot |\n When converted to a data frame using 1 row as column names and 1 column as index\n And printed using data_frame_to_table\n Then it prints a valid string copy pasteable into gherkin files\n \"\"\"\n | object | float64 | object |\n | index_col | float_col | str_col |\n | egg | 3.0 | silly walks |\n | spam | 4.1 | spanish inquisition |\n | bacon | 5.2 | dead parrot |\n \"\"\"\n```\n\nAssociated steps:\n\n```python\nfrom behave import *\nfrom behave_pandas import table_to_dataframe, dataframe_to_table\n\nuse_step_matcher(\"parse\")\n\n@when('converted to a data frame using {column_levels:d} row as column names and {index_levels:d} column as index')\ndef step_impl(context, column_levels, index_levels):\n context.parsed = table_to_dataframe(context.input, column_levels=column_levels, index_levels=index_levels)\n\n\n@then(\"it prints a valid string copy pasteable into gherkin files\")\ndef step_impl(context):\n assert context.result == context.text\n\n\n@step(\"printed using data_frame_to_table\")\ndef step_impl(context):\n context.result = dataframe_to_table(context.parsed)\n```\n\nParsed dataframe:\n\n```\n>>> context.parsed\n float_col str_col\nindex_col\negg 3.0 silly walks\nspam 4.1 spanish inquisition\nbacon 5.2 dead parrot\n\n>>> context.parsed.info()\n\nIndex: 3 entries, egg to bacon\nData columns (total 2 columns):\nfloat_col 3 non-null float64\nstr_col 3 non-null object\ndtypes: float64(1), object(1)\nmemory usage: 72.0+ bytes\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/clembou/behave-pandas", "keywords": "behave pandas testing bdd", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "behave-pandas", "package_url": "https://pypi.org/project/behave-pandas/", "platform": "", "project_url": "https://pypi.org/project/behave-pandas/", "project_urls": { "Homepage": "https://github.com/clembou/behave-pandas" }, "release_url": "https://pypi.org/project/behave-pandas/0.3.0/", "requires_dist": [ "behave", "pandas", "tabulate" ], "requires_python": ">=3.5", "summary": "Provides helper functions to help converting behave tables into pandas dataframes and vice versa.", "version": "0.3.0" }, "last_serial": 4705477, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "001f4ee14d6c60ab8e30d5e789115ed4", "sha256": "913831c7791a75c600a27bb4d3f085d326f40986bd7873e665610479d6845ff8" }, "downloads": -1, "filename": "behave_pandas-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "001f4ee14d6c60ab8e30d5e789115ed4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 7374, "upload_time": "2018-02-10T22:01:55", "url": "https://files.pythonhosted.org/packages/d8/d9/431b0a940140b4ab49b4baacf05a909431fde84950aff8da90ee7e8f3855/behave_pandas-0.1.0-py3-none-any.whl" } ], "0.1.0.dev1": [ { "comment_text": "", "digests": { "md5": "18feebd9029c6d2e6b58816fab2eed87", "sha256": "f90637bb3cfce64bd3fdb8665ee3aea15bd94e56739bc8f675f6f25bfd41d05e" }, "downloads": -1, "filename": "behave_pandas-0.1.0.dev1-py3-none-any.whl", "has_sig": false, "md5_digest": "18feebd9029c6d2e6b58816fab2eed87", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4755, "upload_time": "2018-02-07T21:08:53", "url": "https://files.pythonhosted.org/packages/d8/bf/e057ab3f5a79db512816d35fdb8d34dd7d275c235a78ec8b3cbd16b60385/behave_pandas-0.1.0.dev1-py3-none-any.whl" } ], "0.1.0.dev2": [ { "comment_text": "", "digests": { "md5": "63193af126ec7d536f10f67b1a77bd8d", "sha256": "0e3d434d6ad4d3eb19b5f1d0ee8fba518caeb540d90c4ca9123c7a86dac5006d" }, "downloads": -1, "filename": "behave_pandas-0.1.0.dev2-py3-none-any.whl", "has_sig": false, "md5_digest": "63193af126ec7d536f10f67b1a77bd8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 7143, "upload_time": "2018-02-10T18:00:04", "url": "https://files.pythonhosted.org/packages/e4/25/3c392a211e90c88ad4091e5ce339dd32c3e85742b6e94428eb30fd445117/behave_pandas-0.1.0.dev2-py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ea6dd43744449efbb03450d79f3b902a", "sha256": "8a9cfb0eaa0cfc4fc1b6e8679dc7c1f33fe48a4d95b92e6510c23c528737bb14" }, "downloads": -1, "filename": "behave_pandas-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ea6dd43744449efbb03450d79f3b902a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 5368, "upload_time": "2018-06-03T18:27:48", "url": "https://files.pythonhosted.org/packages/b0/3a/13b21e0cd2bb0ed5cd04c8b761df0c988c84ced96f32dd21dd87ae773f47/behave_pandas-0.2.0-py3-none-any.whl" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "83a755af1b09c157fdc77ad1cb48abdb", "sha256": "edd7d43a512d342d9e945a444514fb4b6a57ac2913f3b8653a57eee27529450e" }, "downloads": -1, "filename": "behave_pandas-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "83a755af1b09c157fdc77ad1cb48abdb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6333, "upload_time": "2019-01-16T23:08:07", "url": "https://files.pythonhosted.org/packages/e5/84/ce70ad9edca2b1beadc6bc2195a758439e0bddaf2cc5ea24e4016a162d48/behave_pandas-0.3.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "83a755af1b09c157fdc77ad1cb48abdb", "sha256": "edd7d43a512d342d9e945a444514fb4b6a57ac2913f3b8653a57eee27529450e" }, "downloads": -1, "filename": "behave_pandas-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "83a755af1b09c157fdc77ad1cb48abdb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6333, "upload_time": "2019-01-16T23:08:07", "url": "https://files.pythonhosted.org/packages/e5/84/ce70ad9edca2b1beadc6bc2195a758439e0bddaf2cc5ea24e4016a162d48/behave_pandas-0.3.0-py3-none-any.whl" } ] }