{ "info": { "author": "Chris Mutel", "author_email": "cmutel@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Visualization" ], "description": "# Correspondentia\n\n[![Build Status](https://travis-ci.org/BONSAMURAIS/correspondentia.svg?branch=master)](https://travis-ci.org/BONSAMURAIS/correspondentia) [![Build status](https://ci.appveyor.com/api/projects/status/2ktjyy6bn8vao95k?svg=true)](https://ci.appveyor.com/project/cmutel/correspondentia)\n\nPython library to map correspondence tables in different formats to data structures.\n\nA quick example:\n\n```python\n\nfrom correspondentia import match_fields\n\nnumbers_to_names = {\n 1: [{\"value\": \"one\", \"type\": \"exact\"}],\n 2: [{\"value\": \"two\", \"weight\": 0.5, \"type\": \"disaggregation\"},\n {\"value\": \"deux\", \"weight\": 0.5, \"type\": \"disaggregation\"}],\n}\n\nmy_data = [{\n 'count': 1,\n 'name': 'foo'\n}, {\n 'count': 2,\n 'name': 'bar'\n}]\n\nlist(match_fields(my_data, numbers_to_names, \"count\"))\n> [{'count': 'one', 'name': 'foo'},\n {'count': 'two', 'name': 'bar', 'correspondentia_allocation': 0.5},\n {'count': 'deux', 'name': 'bar', 'correspondentia_allocation': 0.5}]\n\n```\n\n`match_fields` return a generator.\n\n## Input data\n\nInput data should be an iterable of objects supporting the dictionary interface.\n\n## Input tables\n\n`correspondentia` currently can import the following formats:\n\n* CSVs following the simple schema\n\nWe plan to also eventually support the following:\n\n* RDF (Turtle) correspondence tables following the BONSAI spec\n* CSVs with BONSAI ontology predicates\n\nYou can also write custom importers, or define correspondence tables manually. In either case, the correspondence table data should include at least the following fields (additional fields are also allowed):\n\n```python\n\n{\n \"label in origin schema (usually str, but can be int or float)\": {\n \"value\": \"label in destination schema (usually str, but can be int or float)\",\n \"type\": one of [\"exact\", \"disaggregation\"],\n \"weight\": float, # optional\n }\n}\n\n```\n\n## Simple CSV schema for input tables\n\nA CSV with two required and one optional columns.\n\n* First column: Label in origin schema\n* Second column: Label in destination schema\n* Third column (optional): Weight used for disaggregation.\n\nIf matching is 1-N or N-1, just use multiple rows with redundant labels.\n\nCSVs should follow the Open Knowledge CSV spec. Do not use column headers.\n\n## Installation\n\nInstallation via normal pathways; currently has no dependencies.\n\n## Contributing\n\nFollow standard fork/pull-request procedure.\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/BONSAMURAIS/correspondentia", "keywords": "", "license": "BSD 3-clause", "maintainer": "", "maintainer_email": "", "name": "correspondentia", "package_url": "https://pypi.org/project/correspondentia/", "platform": "", "project_url": "https://pypi.org/project/correspondentia/", "project_urls": { "Homepage": "https://github.com/BONSAMURAIS/correspondentia" }, "release_url": "https://pypi.org/project/correspondentia/0.1/", "requires_dist": null, "requires_python": "", "summary": "your_name_here", "version": "0.1" }, "last_serial": 5342475, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a9c83d57381bd150d18141ddd707321b", "sha256": "8ade2677f1724fc64fc7d1590aa9bb95aa7c95624a90b70e88373eacc39a1d7c" }, "downloads": -1, "filename": "correspondentia-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a9c83d57381bd150d18141ddd707321b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3582, "upload_time": "2019-05-08T07:29:54", "url": "https://files.pythonhosted.org/packages/48/77/16c3f945dbeb21cfc8beee7a384e4045a7e36fa600ec52988d6c4305e3f6/correspondentia-0.0.1.tar.gz" } ], "0.1": [ { "comment_text": "", "digests": { "md5": "0af754738d9352ffd49086f779e4d1d7", "sha256": "8c83ba0dda802b7203f5a10b413ed06759f1316d9c6170ee46c7a9dadbe760b3" }, "downloads": -1, "filename": "correspondentia-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0af754738d9352ffd49086f779e4d1d7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5399, "upload_time": "2019-05-31T12:04:05", "url": "https://files.pythonhosted.org/packages/b5/50/001a45927b2ff6ec3fba7e90bd491c1f36054bf85eee1f4cf3ef52668f5b/correspondentia-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e3353a066ce0492e747694c3bf87dbc5", "sha256": "86a2163b1108c3a59312b7d0f99eac4dd4a6137b73aa400d607667bf1e40ec21" }, "downloads": -1, "filename": "correspondentia-0.1.tar.gz", "has_sig": false, "md5_digest": "e3353a066ce0492e747694c3bf87dbc5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4985, "upload_time": "2019-05-31T12:04:06", "url": "https://files.pythonhosted.org/packages/a5/b5/4b3a385c92c791522283157537527feb00652fc48807a427a5cd9253fc21/correspondentia-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0af754738d9352ffd49086f779e4d1d7", "sha256": "8c83ba0dda802b7203f5a10b413ed06759f1316d9c6170ee46c7a9dadbe760b3" }, "downloads": -1, "filename": "correspondentia-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0af754738d9352ffd49086f779e4d1d7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5399, "upload_time": "2019-05-31T12:04:05", "url": "https://files.pythonhosted.org/packages/b5/50/001a45927b2ff6ec3fba7e90bd491c1f36054bf85eee1f4cf3ef52668f5b/correspondentia-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e3353a066ce0492e747694c3bf87dbc5", "sha256": "86a2163b1108c3a59312b7d0f99eac4dd4a6137b73aa400d607667bf1e40ec21" }, "downloads": -1, "filename": "correspondentia-0.1.tar.gz", "has_sig": false, "md5_digest": "e3353a066ce0492e747694c3bf87dbc5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4985, "upload_time": "2019-05-31T12:04:06", "url": "https://files.pythonhosted.org/packages/a5/b5/4b3a385c92c791522283157537527feb00652fc48807a427a5cd9253fc21/correspondentia-0.1.tar.gz" } ] }