{ "info": { "author": "Superconductive Health", "author_email": "dev@superconductivehealth.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pair\n\n`cooper_pair` is a Python library that provides programmatic access to Superconductive's GraphQL API.\n\nIt supports a limited number of common use cases. (See below.)\n`cooper_pair` is *not* intended as a general-purpose integration library for GraphQL.\nMost useful GraphQL queries are *not* supported within the `cooper_pair` API.\n\n## Why limit the use cases?\n\nGraphQL is a composable query language. The space of allowed queries is enormous, and\ndevelopers are empowered to choose the right query for a given job. This de-couples development\nbehind the API from development that consumes the API, and allows each to move faster,\nindependently.\n\nWrapping a flexible GraphQL API in a rigid python library would completely defeat that purpose.\n\nInstead, think of `cooper_pair` as training wheels. It makes it easy to quickly connect\nto GraphQL, and perform a few common functions. It also provides a collection of example\nqueries to learn how to use GraphQL and the Allotrope API.\n\nIn other words, `cooper-pair` can help you get started, but you will be able to get far more\nout of Allotrope once you learn to query it natively using GraphQL.\n\n## Installation\n\n cd cooper-pair\n pip install .\n\nOr,\n\n pip install git+ssh://git@github.com/superconductive/cooper.git#egg=cooper_pair&subdirectory=pair\n\n## Usage\n\n### Instantiate the API\n\n from cooper_pair import CooperPair\n\n pair = CooperPair(\n graphql_endpoint=\"http://my-data-valet-url:3010/graphql\",\n email='my_user@some_email.com',\n password='my_very_secure_password'\n )\n\n### List datasets\n\n response = pair.list_datasets()\n print( json.dumps(response, indent=2))\n\n### Get a dataset\n response = pair.get_dataset(\"RGF2YXNldPoxODl=\")\n print( json.dumps(response, indent=2))\n\n### List checkpoints\n\n response = pair.list_checkpoints()\n print( json.dumps(response, indent=2) )\n\n### Create a new dataset and evaluate it against an existing checkpoint\n\nFrom a dataframe:\n\n my_df = pd.DataFrame({\n \"x\" : [1,2,3,4,5],\n \"y\" : [6,7,8,9,10],\n })\n response = pair.evaluate_checkpoint_on_pandas_df(\n checkpoint_id=\"Q2hlY2twb2ludDox\",\n pandas_df=my_df,\n filename=\"my_dataframe_name\"\n )\n evaluation_id = response['addEvaluation']['evaluation']['id']\n dataset_id = response['addEvaluation']['evaluation']['dataset']['id']\n\nFrom a file:\n\n with open('my_file.csv', 'rb') as fd:\n dataset = pair.evaluate_checkpoint_on_file(\n checkpoint_id=\"Q2hlY2twb2ludDox\",\n fd=fd,\n )\n evaluation_id = response['addEvaluation']['evaluation']['id']\n dataset_id = response['addEvaluation']['evaluation']['dataset']['id']\n\nNote: Evaluation is asynchronous. When the response first comes back from Allotrope,\nit will have `status=\"created\"`. This will change to `pending` when a worker picks it up,\nthen to `success` or `failed` depending on the result of the evaluation.\n\nYou can query for status as follows:\n\n response = pair.query(\"\"\"\n query evaluationQuery($id: ID!) {\n evaluation(id: $id) {\n id,\n status\n }\n }\n \"\"\",\n variables={\n 'id' : evaluation_id\n })\n print(response)\n\n### Creating a new checkpoint from JSON\n\n import json\n with open('checkpoint_definition.json', 'rb') as fd:\n checkpoint_config = json.load(fd)\n\n pair.add_checkpoint_from_expectations_config(\n checkpoint_config, \"Checkpoint Name\")\n\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/superconductive/cooper-pair", "keywords": "", "license": "", "maintainer": "Superconductive Health", "maintainer_email": "dev@superconductivehealth.com", "name": "cooper-pair", "package_url": "https://pypi.org/project/cooper-pair/", "platform": "", "project_url": "https://pypi.org/project/cooper-pair/", "project_urls": { "Homepage": "https://github.com/superconductive/cooper-pair" }, "release_url": "https://pypi.org/project/cooper-pair/0.0.4/", "requires_dist": [ "gql", "requests", "great-expectations" ], "requires_python": "", "summary": "A small library that provides programmatic access to Superconductive's GraphQL API.", "version": "0.0.4" }, "last_serial": 4608780, "releases": { "0.0.4": [ { "comment_text": "", "digests": { "md5": "cd1103c60df745b9aeda58de68580938", "sha256": "8a4f7ecd79dbca5594efd4a3b40a5557e0c5c39ec8359d3797e2275666c400ae" }, "downloads": -1, "filename": "cooper_pair-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "cd1103c60df745b9aeda58de68580938", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21317, "upload_time": "2018-12-17T16:51:40", "url": "https://files.pythonhosted.org/packages/32/b6/9a26459bbb868eab286be3c1d2d4658ffd1747d42b176870dc97fcccd1ec/cooper_pair-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09d555a47c37b9d92ac09b33a701b600", "sha256": "d9ae780a684c6b2ede7837138b8b1bb844036ccc7e66184ff3858d05d7eb244f" }, "downloads": -1, "filename": "cooper_pair-0.0.4.tar.gz", "has_sig": false, "md5_digest": "09d555a47c37b9d92ac09b33a701b600", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15853, "upload_time": "2018-12-17T16:51:43", "url": "https://files.pythonhosted.org/packages/47/dc/ba09ccc43404a025c5889fda4dc832fbcd409f3910911a0c1d55a0a87559/cooper_pair-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cd1103c60df745b9aeda58de68580938", "sha256": "8a4f7ecd79dbca5594efd4a3b40a5557e0c5c39ec8359d3797e2275666c400ae" }, "downloads": -1, "filename": "cooper_pair-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "cd1103c60df745b9aeda58de68580938", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21317, "upload_time": "2018-12-17T16:51:40", "url": "https://files.pythonhosted.org/packages/32/b6/9a26459bbb868eab286be3c1d2d4658ffd1747d42b176870dc97fcccd1ec/cooper_pair-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09d555a47c37b9d92ac09b33a701b600", "sha256": "d9ae780a684c6b2ede7837138b8b1bb844036ccc7e66184ff3858d05d7eb244f" }, "downloads": -1, "filename": "cooper_pair-0.0.4.tar.gz", "has_sig": false, "md5_digest": "09d555a47c37b9d92ac09b33a701b600", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15853, "upload_time": "2018-12-17T16:51:43", "url": "https://files.pythonhosted.org/packages/47/dc/ba09ccc43404a025c5889fda4dc832fbcd409f3910911a0c1d55a0a87559/cooper_pair-0.0.4.tar.gz" } ] }