Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/QuattroMusic/PyMermaid
A mermaid wrapper built in python
https://github.com/QuattroMusic/PyMermaid
graphs markdown mermaid python
Last synced: 3 months ago
JSON representation
A mermaid wrapper built in python
- Host: GitHub
- URL: https://github.com/QuattroMusic/PyMermaid
- Owner: QuattroMusic
- License: mit
- Created: 2022-03-20T19:25:36.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-18T17:59:36.000Z (almost 2 years ago)
- Last Synced: 2024-11-22T15:41:32.050Z (3 months ago)
- Topics: graphs, markdown, mermaid, python
- Language: Python
- Homepage:
- Size: 259 KB
- Stars: 32
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PyMermaid
PyMermaid is a simple to use mermaid wrapper built in python.
---
## FeaturesUsing the object-oriented programming style of python, we can achieve some
interesting result in the way of _programming the graph_.#### Some examples
```python
from PyMermaid.mermaid import flowchart as ff.set_layout(f.layout_leftToRight)
n1 = f.add_node("Start",shape = 1)
n2 = f.add_node("Decision",shape = f.nodeShape_rhombus)
n3 = f.add_node("Result one")
n4 = f.add_node("Result two")a = f.add_arrow(type=f.arrowType_normalArrow)
f.link(n1,n2,a)
f.link(n2,[n3,n4],a)print(f.evaluate())
```
```
# OUTPUT
# ```mermaid
# flowchart LR
# 0("Start")
# 1{"Decision"}
# 2["Result one"]
# 3["Result two"]
# 0 --> 1
# 1 --> 2 & 3
# ```
```
```mermaid
flowchart LR
0("Start")
1{"Decision"}
2["Result one"]
3["Result two"]
0 --> 1
1 --> 2 & 3
```
And many more functions to explore## Coverage
![](assets/GraphCoverage.png)## Installation
By simply downloading the folder `PyMermaid` and placing your python file outside of it,
you can start coding your beautiful graphs.
```
Project
|
├── your_python_code.py
└── PyMermaid
|
├── __init__.py
├── mermaid.py
├── flowchart
...
```You can see dependencies inside requirements.txt and install them with `pip install -r requirements.txt`.
## Contributing
Contributions are accepted!
Simply fork this repository, edit any file you want, then create a pull request to this repo.#### Will it become a library?
_Probably... in a future..._