Metadata-Version: 2.1
Name: aiida-dataframe
Version: 0.1.0
Summary: AiiDA data plugin for pandas DataFrame objects
Keywords: aiida,plugin
Author-email: Henning Janßen <henning.janssen@gmx.net>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: Programming Language :: Python
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Framework :: AiiDA
Requires-Dist: aiida-core>=1.0,<3
Requires-Dist: pandas
Requires-Dist: tables
Requires-Dist: tabulate
Requires-Dist: sphinx ; extra == "docs"
Requires-Dist: sphinxcontrib-contentui ; extra == "docs"
Requires-Dist: sphinxcontrib-details-directive ; extra == "docs"
Requires-Dist: furo ; extra == "docs"
Requires-Dist: markupsafe<2.1 ; extra == "docs"
Requires-Dist: pre-commit~=2.2 ; extra == "pre-commit"
Requires-Dist: pylint>=2.5.0,<2.9 ; extra == "pre-commit"
Requires-Dist: pgtest~=1.3.1 ; extra == "testing"
Requires-Dist: wheel~=0.31 ; extra == "testing"
Requires-Dist: coverage[toml] ; extra == "testing"
Requires-Dist: pytest~=6.0 ; extra == "testing"
Requires-Dist: pytest-cov ; extra == "testing"
Requires-Dist: pytest-regressions ; extra == "testing"
Project-URL: Documentation, https://aiida-dataframe.readthedocs.io
Project-URL: Home, https://aiida-dataframe.readthedocs.io
Project-URL: Source, https://github.com/janssenhenning/aiida-dataframe
Provides-Extra: docs
Provides-Extra: pre-commit
Provides-Extra: testing

[![Build Status][ci-badge]][ci-link]
[![Coverage Status][cov-badge]][cov-link]
[![Docs status][docs-badge]][docs-link]
[![PyPI version][pypi-badge]][pypi-link]

# aiida-dataframe

AiiDA data plugin for pandas DataFrame objects

## Features

 * Store `pandas.DataFrame` objects in the Database:
   ```python
   import pandas as pd
   PandasFrameData = DataFactory('dataframe.frame')
   df = pd.DataFrame(
        {
            "A": 1.0,
            "B": pd.Timestamp("20130102"),
            "C": pd.Series(1, index=list(range(4)), dtype="float32"),
            "D": np.array([3] * 4, dtype="int32"),
            "E": pd.Categorical(["test", "train", "test", "train"]),
            "F": "foo",
        }
    )
   df_node = PandasFrameData(df)
   df_node.store()
   ```

 * Retrieving the `pandas.DataFrame` from the Database :
   ```python
   from aiida.orm import QueryBuilder
   df_node = QueryBuilder().append(PandasFrameData).first()[0]
   df = df_node.df #The df property reconstructs the pandas DataFrame
   print(df.head())
   ```

## Installation

```shell
pip install aiida-dataframe
verdi quicksetup  # better to set up a new profile
verdi plugin list aiida.data  # should now show your data plugins
```

## Usage

The plugin also includes verdi commands to inspect its data types:
```shell
verdi data dataframe list
verdi data dataframe export <PK>
verdi data dataframe show <PK>
```

## Development

```shell
git clone https://github.com/janssenhenning/aiida-dataframe .
cd aiida-dataframe
pip install --upgrade pip
pip install -e .[pre-commit,testing]  # install extra dependencies
pre-commit install  # install pre-commit hooks
pytest -v  # discover and run all tests
```

See the [developer guide](http://aiida-dataframe.readthedocs.io/en/latest/developer_guide/index.html) for more information.

## License

MIT
## Contact

henning.janssen@gmx.net


[ci-badge]: https://github.com/janssenhenning/aiida-dataframe/workflows/ci/badge.svg?branch=main
[ci-link]: https://github.com/janssenhenning/aiida-dataframe/actions
[cov-badge]: https://codecov.io/gh/janssenhenning/aiida-dataframe/branch/main/graph/badge.svg
[cov-link]: https://codecov.io/gh/janssenhenning/aiida-dataframe
[docs-badge]: https://readthedocs.org/projects/aiida-dataframe/badge
[docs-link]: http://aiida-dataframe.readthedocs.io/
[pypi-badge]: https://badge.fury.io/py/aiida-dataframe.svg
[pypi-link]: https://badge.fury.io/py/aiida-dataframe

