Skip to main content

Convert pandas DataFrame to Mermaid flowcharts

Project description

README.md

# pandas-mermaid

Convert a **pandas DataFrame** into a **Mermaid flowchart** definition.

## 📦 Installation

Install from **PyPI**:

```bash
pip install pandas-mermaid

Or install the latest development version from GitHub:

pip install git+https://github.com/raghuvasanthrao/pandas-mermaid.git

🚀 Usage

import pandas as pd
import pandas_mermaid.converter as pdm

# Create a sample DataFrame
df = pd.DataFrame({
    'Name': ['Node1', 'Node2', 'Node3'],
    'Value': [10, 20, 30],
})

# Convert DataFrame to Mermaid flowchart (Left-to-Right)
mermaid_chart = pdm.df_to_mermaid(df, direction="LR") #LR TB

# Print the Mermaid definition
print(mermaid_chart)

Output:

flowchart LR
    node0[Name: Node1, Value: 10]
    node1[Name: Node2, Value: 20]
    node2[Name: Node3, Value: 30]
    node0 --> node1
    node1 --> node2

You can paste the above output into Mermaid Live Editor to visualize the flowchart.

📄 License

This project is licensed under the MIT License.

---

If you want, I can also **add a rendered Mermaid diagram directly into the README** so that when someone views your GitHub page, they’ll see the flowchart without leaving the page. That would make the repo look even more appealing.  

Do you want me to add that?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandas_mermaid-0.2.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandas_mermaid-0.2.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file pandas_mermaid-0.2.0.tar.gz.

File metadata

  • Download URL: pandas_mermaid-0.2.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for pandas_mermaid-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4dd46e782d6d2cf6704f1aee16c35966167b0c462d5f9fa8cf1afc9f7bd78812
MD5 d70bc8c01decb5f975c0b4615be52ad4
BLAKE2b-256 15b5a0feea1a7689b5cb7db0b8c4273118132dc32ea7acc39eac18041ba7063a

See more details on using hashes here.

File details

Details for the file pandas_mermaid-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pandas_mermaid-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for pandas_mermaid-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b93423a4eb8320f39e09dae569efbc5675c9cd7972f47925c70d73e1302d8fa6
MD5 1d30d6a072a25a37e721fdcafd118c08
BLAKE2b-256 92850cf90989a675e4a94a2d3cf069228ef1e5de0b4cd1ad7bdcdc7f3ade7cdc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page