# pdtable
![run-tests](https://github.com/startable/pdtable/workflows/run-tests/badge.svg)
The `pdtable` Python package offers interfaces to read, write, and manipulate StarTable data.
## Documentation
The pdtable documentation is available at [pdtable.readthedocs.io](https://pdtable.readthedocs.io/).
## Examples
Demo: see the [pdtable_demo notebook](examples/pdtable_demo.ipynb) or, if you a Jupyter notebook doesn't do it for you, the notebook's [paired script](examples/pdtable_demo.py).
## Installation
pdtable is available from pypi.org
```commandline
pip install pdtable
```
and from conda-forge
```commandline
conda install pdtable -c conda-forge
```
## Data and metadata: storage and access
Table blocks are stored as `TableDataFrame` objects, which inherit from `pandas.DataFrame` but include additional, hidden metadata. This hidden metadata contains all the information from Table blocks that does not fit in a classic Pandas dataframe object: table destinations, column units, table origin, etc.
Data in `TableDataFrame` objects can be accessed and manipulated using the Pandas API as it the object were a vanilla Pandas dataframe, with all the convenience that this entails.
The StarTable-specific metadata hidden in a `TableDataFrame`'s metadata *can* in principle be accessed directly; however a much more ergonomic interface is offered via a `Table` facade object, which is a thin wrapper around `TableDataFrame`. `Table` also supports some limited data manipulation, though with the advantage of more easily supporting StarTable-specific metadata; for example, easily specifying column units when adding new columns.
## I/O
Readers and writers are available for CSV and Excel, both as files and as streams. Parsing is efficient and, by default, lenient, though this is readily customized.
Reading can also be filtered early, such that only certain block types or tables with certain names get fully parsed. This can reduce reading time substantially when reading e.g. only a few tables from an otherwise large file or stream.
Directive blocks are parsed by the readers, and presented to the client code for application-specific interpretation.
Import from and export to JSON is also supported.
Raw data
{
"_id": null,
"home_page": "https://github.com/startable/pdtable/",
"name": "pdtable",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "startable data-structure file-format table dataframe json",
"author": "Jean-Fran\u00e7ois Corbett",
"author_email": "jeaco@orsted.dk",
"download_url": "https://files.pythonhosted.org/packages/61/54/d12e5dfff50a421e6e7b527bbbfacbf044e7711731ba476a6f6cc28f94f3/pdtable-1.0.1.tar.gz",
"platform": null,
"description": "# pdtable\n\n![run-tests](https://github.com/startable/pdtable/workflows/run-tests/badge.svg)\n\nThe `pdtable` Python package offers interfaces to read, write, and manipulate StarTable data.\n\n## Documentation\n\nThe pdtable documentation is available at [pdtable.readthedocs.io](https://pdtable.readthedocs.io/). \n\n## Examples \n\nDemo: see the [pdtable_demo notebook](examples/pdtable_demo.ipynb) or, if you a Jupyter notebook doesn't do it for you, the notebook's [paired script](examples/pdtable_demo.py).\n\n## Installation\n\npdtable is available from pypi.org\n```commandline\npip install pdtable\n```\nand from conda-forge\n```commandline\nconda install pdtable -c conda-forge\n```\n\n## Data and metadata: storage and access\n\nTable blocks are stored as `TableDataFrame` objects, which inherit from `pandas.DataFrame` but include additional, hidden metadata. This hidden metadata contains all the information from Table blocks that does not fit in a classic Pandas dataframe object: table destinations, column units, table origin, etc.\n\nData in `TableDataFrame` objects can be accessed and manipulated using the Pandas API as it the object were a vanilla Pandas dataframe, with all the convenience that this entails.\n\nThe StarTable-specific metadata hidden in a `TableDataFrame`'s metadata *can* in principle be accessed directly; however a much more ergonomic interface is offered via a `Table` facade object, which is a thin wrapper around `TableDataFrame`. `Table` also supports some limited data manipulation, though with the advantage of more easily supporting StarTable-specific metadata; for example, easily specifying column units when adding new columns.\n\n## I/O\n\nReaders and writers are available for CSV and Excel, both as files and as streams. Parsing is efficient and, by default, lenient, though this is readily customized.\n\nReading can also be filtered early, such that only certain block types or tables with certain names get fully parsed. This can reduce reading time substantially when reading e.g. only a few tables from an otherwise large file or stream.\n\nDirective blocks are parsed by the readers, and presented to the client code for application-specific interpretation.\n\nImport from and export to JSON is also supported.\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Reads and writes data stored in StarTable format; and stores table data inmemory as a Pandas data frame for easy manipulation.",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/startable/pdtable/"
},
"split_keywords": [
"startable",
"data-structure",
"file-format",
"table",
"dataframe",
"json"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e8a69ce0ff837eddc8273e5c75192f9381d0cec4a4e6d7a74812e225fdc05a02",
"md5": "ed32f19b07903fe6ddacbd8c1d339216",
"sha256": "063488cfe052b5dcb58b626b13742817eabc93e41aafad762621248d91cdf0bd"
},
"downloads": -1,
"filename": "pdtable-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ed32f19b07903fe6ddacbd8c1d339216",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 100833,
"upload_time": "2024-07-09T07:44:27",
"upload_time_iso_8601": "2024-07-09T07:44:27.779202Z",
"url": "https://files.pythonhosted.org/packages/e8/a6/9ce0ff837eddc8273e5c75192f9381d0cec4a4e6d7a74812e225fdc05a02/pdtable-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6154d12e5dfff50a421e6e7b527bbbfacbf044e7711731ba476a6f6cc28f94f3",
"md5": "514085a3d520c8135833356c53a1ff61",
"sha256": "bbc69b33e0f3ce1dfca842081b1793947102c1e922859626993022329f9f84b4"
},
"downloads": -1,
"filename": "pdtable-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "514085a3d520c8135833356c53a1ff61",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 80189,
"upload_time": "2024-07-09T07:44:29",
"upload_time_iso_8601": "2024-07-09T07:44:29.584125Z",
"url": "https://files.pythonhosted.org/packages/61/54/d12e5dfff50a421e6e7b527bbbfacbf044e7711731ba476a6f6cc28f94f3/pdtable-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-09 07:44:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "startable",
"github_project": "pdtable",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pdtable"
}