Skip to content

Commit

Permalink
update docs with Mdoc.from_string().as_dataframe()
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-ji committed Aug 14, 2024
1 parent 219b552 commit bbbf6c3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
import mdocfile.Mdoc as 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/).

Expand Down
11 changes: 11 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
import mdocfile.Mdoc as Mdoc

mdoc_data = ...

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

---

For writing valid mdoc files, please see [writing mdoc files](./writing.md).
Expand Down

0 comments on commit bbbf6c3

Please sign in to comment.