diff --git a/README.md b/README.md index ec2c00b..2ae2f77 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,17 @@ import mdocfile df = mdocfile.read('my_mdoc_file.mdoc') ``` +`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() +``` + For writing valid mdoc files, please see [writing mdoc files](https://teamtomo.org/mdocfile/writing/). diff --git a/docs/index.md b/docs/index.md index 4f872f1..140ec9a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -29,6 +29,17 @@ import mdocfile df = mdocfile.read('my_mdoc_file.mdoc') ``` +`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() +``` + --- For writing valid mdoc files, please see [writing mdoc files](./writing.md).