Metadata-Version: 2.4
Name: mdocfile
Version: 0.2.3
Summary: SerialEM mdoc files as pandas dataframes.
Project-URL: homepage, https://github.com/teamtomo/mdocfile
Project-URL: repository, https://github.com/teamtomo/mdocfile
Author-email: Alister Burt <alisterburt@gmail.com>
License: BSD 3-Clause License
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.9
Requires-Dist: pandas
Requires-Dist: pydantic>=2
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: ipython; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pdbpp; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: rich; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest>=6.0; extra == 'test'
Description-Content-Type: text/markdown

# mdocfile

[![License](https://img.shields.io/pypi/l/mdocfile.svg?color=green)](https://github.com/teamtomo/mdocfile/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/mdocfile.svg?color=green)](https://pypi.org/project/mdocfile)
[![Python Version](https://img.shields.io/pypi/pyversions/mdocfile.svg?color=green)](https://python.org)
[![CI](https://github.com/teamtomo/mdocfile/actions/workflows/ci.yml/badge.svg)](https://github.com/teamtomo/mdocfile/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/teamtomo/mdocfile/branch/main/graph/badge.svg)](https://codecov.io/gh/teamtomo/mdocfile)

SerialEM mdoc files as pandas dataframes.

<p align="center" width="100%">
    <img width="70%" src="https://user-images.githubusercontent.com/7307488/205445941-8db4ad0e-648a-446e-812d-bd1b81ec19b8.png"> 
</p>

*mdocfile* is Python package for working with [SerialEM](https://bio3d.colorado.edu/SerialEM/) mdoc files.

---

# Quickstart

`mdocfile.read()` will return the contents of an mdoc file as a pandas 
dataframe.

```python

import mdocfile

df = mdocfile.read('my_mdoc_file.mdoc')
```

For writing valid mdoc files, please see 
[writing mdoc files](https://teamtomo.org/mdocfile/writing/).

# Installation

pip:

```shell
pip install mdocfile
```

# Parsing from text

`Mdoc.from_string().as_dataframe()` will return the contents of string mdoc data as a pandas dataframe. 
This is useful for mdoc data that is not stored in a file (e.g. from a database or a web request). 

```python
from mdocfile.data_models import Mdoc

mdoc_data = ...

mdoc = Mdoc.from_string(mdoc_data).as_dataframe()
```
