{ "info": { "author": "Sacha Beniamine", "author_email": "beniamine@shh.mpg.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "\n\nThis is a wrapper on [pycldf](https://pypi.org/project/pycldf/) to write pandas DataFrames as CLDF datasets. It implements some boilerplate to automatically add components, tables and columns, and deduce as much metadata as possible from pandas DataFrames rather than specify every column.\n\n\nUsage\n------\n\n- First, create your `Dataset` and `DataFrames`. You should either use standard column names for columns that are part of the specification, or prepare a `titles` dict as explained below to map from your names to standard names.\n\n import pandas as pd\n from pycldf import Dataset\n forms_df = pd.DataFrame({\"Cell\":[\"prs.1sg\",\"prs.2sg\"],\n \"Forms\":[\"mange\",\"manges\"],\n \"Source\":[\"bibkey1\", \"bibkey1\"]})\n dataset = Wordlist.in_dir('MyDataset')\n\n\n- Create a `Writer` instance, passing the dataset and a dictionary of table names (use component names to have the metadata automatically filled) to pandas DataFrames. `pdcldf` will automatically update the dataset to add the columns that are in your DataFrames and not in the spec, and remove optional columns that are in the spec but not in your DataFrames.\n\n\n from pdcldf import Writer\n writer = Writer(dataset, {\"FormTable\": forms_df})\n\n\n- Optionally, you can specify `titles` and `sep` arguments. `titles` is a dictionary of column names in your DataFrame to standard CLDF column names, in case you used a custom column name. The lib will update the metadata accordingly. The argument `sep` is used for columns which contain lists or tuples. It should be a dictionary of column names (str) to separator (str) for that column. When writing the dataset, the separator will be used to join tuple or list items. If you don't specify any, the separator used will be the one specified in the static field `Writer.default_sep`.\n\n\n writer = Writer(dataset, {\"FormTable\": forms_df},\n titles={\"Cell\":\"Parameters_ID\"},\n sep={\"Cell\":\"~\"})\n\n\n- Add sources as tuples. You could also directly use `pycldf`'s `dataset.add_sources` which takes `Source` objects.\n\n\n sources = [('book', 'bibkey1',\n {'author': 'Some Author', 'year': '2019', 'title': 'Paper title', 'address': 'Somewhere'})]\n writer.add_sources(*sources)\n\n\n- Write to files:\n\n\n writer.write()\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://gitlab.com/sbeniamine/pdcldf", "keywords": "", "license": "Apache License Version 2.0", "maintainer": "", "maintainer_email": "", "name": "pdcldf", "package_url": "https://pypi.org/project/pdcldf/", "platform": "", "project_url": "https://pypi.org/project/pdcldf/", "project_urls": { "Homepage": "https://gitlab.com/sbeniamine/pdcldf" }, "release_url": "https://pypi.org/project/pdcldf/0.1/", "requires_dist": null, "requires_python": ">=3.5", "summary": "A small wrapper on pycldf to write pandas DataFrames as CLDF datasets.", "version": "0.1" }, "last_serial": 5879366, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ee706993dfc4a05ecc2b108aad367db9", "sha256": "e90c65b2a78de15ccfcd23d49b1e683ab8f4db19c17cbdef1acef84109bf96fa" }, "downloads": -1, "filename": "pdcldf-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ee706993dfc4a05ecc2b108aad367db9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8736, "upload_time": "2019-09-24T12:15:20", "url": "https://files.pythonhosted.org/packages/4b/b6/c0bb11b8427b3ebaa204f91994cbb82f2f66161d7bc4c94fc1cc57d737a5/pdcldf-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42bffc2e283af39a70ae941724b44943", "sha256": "5848087804363e18a5ba90d410e6107850cb78fb151f55dadb7aa30c660c5d2b" }, "downloads": -1, "filename": "pdcldf-0.1.tar.gz", "has_sig": false, "md5_digest": "42bffc2e283af39a70ae941724b44943", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4086, "upload_time": "2019-09-24T12:15:23", "url": "https://files.pythonhosted.org/packages/ec/ce/bb996c1c866b6cbe518c552f86d7119b59c2305dcdc7c1d27f2d08eca639/pdcldf-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ee706993dfc4a05ecc2b108aad367db9", "sha256": "e90c65b2a78de15ccfcd23d49b1e683ab8f4db19c17cbdef1acef84109bf96fa" }, "downloads": -1, "filename": "pdcldf-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ee706993dfc4a05ecc2b108aad367db9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8736, "upload_time": "2019-09-24T12:15:20", "url": "https://files.pythonhosted.org/packages/4b/b6/c0bb11b8427b3ebaa204f91994cbb82f2f66161d7bc4c94fc1cc57d737a5/pdcldf-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42bffc2e283af39a70ae941724b44943", "sha256": "5848087804363e18a5ba90d410e6107850cb78fb151f55dadb7aa30c660c5d2b" }, "downloads": -1, "filename": "pdcldf-0.1.tar.gz", "has_sig": false, "md5_digest": "42bffc2e283af39a70ae941724b44943", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4086, "upload_time": "2019-09-24T12:15:23", "url": "https://files.pythonhosted.org/packages/ec/ce/bb996c1c866b6cbe518c552f86d7119b59c2305dcdc7c1d27f2d08eca639/pdcldf-0.1.tar.gz" } ] }