{ "info": { "author": "thibaut boissin", "author_email": "thibaut.boissin@gmail.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Pandas transform checker\n\n## what is it ?\n\nThis library is focused on data quality checking on pandas transformations.\nTransformations are functions that takes a pandas DataFrame as input ( plus\nother params ) and output a DataFrame.\n\nThis library allow the user to specify a contract that the function must respect.\nIn this contract the user can specify:\n - the added columns\n - the deleted columns\n - the modified columns\n - if the function add/drop records\n - if the function modify the index ( ex: resampling )\n\nOnce the contract if specified, the function will raise a RuntimeError\nif one of it's specifications is violated.\n\n## how to use it ?\n\nThe package contains the decorator that performs the check it can be \nimported the following way:\n```\nfrom pandas_transform_checker.decorator_contract_checker import input_df_contract\n```\n\n### Args\n\ndf_param: name of the param of the function that is the input df\ncontract_params: dict defining the contract of the function in the following format:\n```\ncontract_dict = {\n \"col_additions\": {\n \"col_a\": \"int\",\n \"col_b\": \"float\"\n },\n \"col_deletions\": {\n \"col_c\",\n \"col_d\"\n },\n \"col_editions\": {\n \"col_e\",\n \"col_f\"\n },\n \"allow_index_edition\": False,\n \"allow_drop_record\": True\n}\n```\nwhich means that the function must create \"col_a\", \"col_b\", delete \"col_c\", \"col_d\", must\nnot modify any column data except \"col_e\", \"col_f\", and must not edit the index\n\nhere is the list of keys allowed in this dict:\n- col_additions: dict where keys are column names and values are dtypes (string)\n- col_deletions: set of str representing the deleted columns\n- col_editions: set of str representing the modified columns\n- allow_index_edition: bool indicating if the function modify the index\n- allow_add_drop_record (bool): indicate if the function can drop some records (ex. when dropna is used)\n\n### Usage\nwhen you have a function that takes a df as input:\n```\ndef super_func(df_input):\n ...\n```\njust add the annotation to automatically check properties\n```\n@input_df_contract(df_param=\"df_input\", contract_dict={\"col_editions\": {\"col_e\",\"col_f\"}})\ndef super_func(df_input):\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/thib-s/pandas_transform_checker", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "pandas-transform-checker", "package_url": "https://pypi.org/project/pandas-transform-checker/", "platform": "", "project_url": "https://pypi.org/project/pandas-transform-checker/", "project_urls": { "Homepage": "https://github.com/thib-s/pandas_transform_checker" }, "release_url": "https://pypi.org/project/pandas-transform-checker/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "function annotations to check properties on pandas dataframe transformations", "version": "0.1.1" }, "last_serial": 5372231, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "18f29e2480393eb5dff12fce6046a7a9", "sha256": "f87a8e657ba9cc1690fa8032a1a76bf55758af1485db4d3323e92e25a51fd0ed" }, "downloads": -1, "filename": "pandas_transform_checker-0.1.tar.gz", "has_sig": false, "md5_digest": "18f29e2480393eb5dff12fce6046a7a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3671, "upload_time": "2019-06-07T16:16:42", "url": "https://files.pythonhosted.org/packages/4c/4b/789c613073ad0ad6d51ef9c522bc7bf1d934b14f536a6dd04aa9397cd341/pandas_transform_checker-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "67295be1d52594e66acdc8ea0cbd6d00", "sha256": "2a1f55f591d232353fe153b9da5cca410c0bb9b4f301852169534ed89b8769de" }, "downloads": -1, "filename": "pandas_transform_checker-0.1.1.tar.gz", "has_sig": false, "md5_digest": "67295be1d52594e66acdc8ea0cbd6d00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3678, "upload_time": "2019-06-07T16:16:40", "url": "https://files.pythonhosted.org/packages/c5/c9/d8b9e8afc30b0215589ab2677273b754c0e589e925e86d2b8f1ed451b88e/pandas_transform_checker-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "67295be1d52594e66acdc8ea0cbd6d00", "sha256": "2a1f55f591d232353fe153b9da5cca410c0bb9b4f301852169534ed89b8769de" }, "downloads": -1, "filename": "pandas_transform_checker-0.1.1.tar.gz", "has_sig": false, "md5_digest": "67295be1d52594e66acdc8ea0cbd6d00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3678, "upload_time": "2019-06-07T16:16:40", "url": "https://files.pythonhosted.org/packages/c5/c9/d8b9e8afc30b0215589ab2677273b754c0e589e925e86d2b8f1ed451b88e/pandas_transform_checker-0.1.1.tar.gz" } ] }