# make-mermaid-swim-by-db
make mermaid ER code from db (python)
# Require
- Python3.10
- sqlalchemy
- mysqlclient
- **your (mysql)DB**
# usage
- install
```
pip install DB2mermaid
```
- use
```
from db2mermaid.db2mermaid import DB2Mermaid
dm = DB2Mermaid()
dm.init_db("user", "pasword", "127.0.0.1", "3306", "db_name")
dm.generate()
```
then, you will get `er.md`
### Output Sample of Skila
ref: https://downloads.mysql.com/docs/sakila-db.tar.gz
![output sapmle](./images/skila-sample.png)
[mermaid live editor](https://mermaid.live/edit#pako:eNqtV9GOojAU_RXSpzExE0FB8c0ZcdeMuhPH2exsTEwDxWkChZQyOy7x3_cC4qIWxM3yBJy255zbe28hQXbgEDREhI8p3nLsr5kCF7ZFwJP8Pr1e5qPZbLpY5cCGOsrz01_0-2j5-HW0vOvpLcWlPBIbhn0ixz18Aa-mc-tlNZo_52AcOlgAvD9IcRxOokgqJoeq5OidVjGkFtQuUQ1Qh0aCU1tIiG0qdinrRMKqwtQwiAT2Nmls5WuH7wErQYvX2UzxAhsLGrCmgUlFJDXiqkKS4rJpQcwEv7B1RUM-Kalfr1JJPqQxGTxsgxO21XTxlpEdoCo2DTLvlqSz40gEPpGWQIGdcxVaAOWkKjv-sUTKUSM-pl59NUwksqBy6UdpyfFoZaVBUGxOwPom998sPJnFpMa6LC4-ZngLYYPScN1zlddd1OuBJaV6DlT_sVtdU_ow-_aghNA3Yt5sA2vzpmr3jt3GaClxRHiFhbTV4Cj6FXCnaSxd6vmytE_fV4VS1QYtRVDhlTPI-rFSHBLZnIanbe3NGi0VTjyCI7LZEcwv7XqYbWPIlqpwBJxuKYMWe20gJyztxE7Mz3rr2HqcgrW73kZrFaP4SQkcnXuEbcX75VQ9nxp62CY-rAD9PiqdFtbida6ktGxbWtSCjQ6JTYHOhbqDJIma7kzhNamPV3mDjgfOLc0v2-nbvgBqs6QBm6S1X1myvu83oBTkU9ya55quN8jzAwtlH5AUp6bm1nj6Ok9pjujVUE6eGveKOtMh3qVJKrN8gCqVlE88uRpJRwfA-mIti9o6Q09qCPvph4DkaCqE3XI25XxJnZCyySNX0SlOqCr2a3JLlEoMUO7swkxNDKucojYCIjhGHPh0z6yukXiHJrRGQ7h1iItjT6xRPjSfZjkU5KOhi72ItBGORfCyY_bxRT7q8BdwfBtihoYJ-kTDXue-bxqGafa7ar9ndHp6G-3QUDXV-87A0LqGbupad6AO9m30OwhgCfXe6Hc0zTS6qto3O6rZbyOSqZjnPx3Zv0fG8TObIHhM9n8AOUymUQ)
# Caution ❗
this package is not full.
It cannot generate table relation, can only generate table definition 😢.
(And now, only mysql... 🤣)
# Future
Make CLI
Raw data
{
"_id": null,
"home_page": "https://github.com/kitsystemyou/make-mermaid-swim-by-db",
"name": "DB2mermaid",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "mermaid erDiagram",
"author": "singsignalyou",
"author_email": "kitsystemyou@gmail.com",
"download_url": "",
"platform": null,
"description": "# make-mermaid-swim-by-db\nmake mermaid ER code from db (python)\n\n# Require\n- Python3.10\n- sqlalchemy\n- mysqlclient\n- **your (mysql)DB**\n\n# usage\n- install\n```\npip install DB2mermaid\n```\n\n- use\n```\nfrom db2mermaid.db2mermaid import DB2Mermaid\n dm = DB2Mermaid()\n dm.init_db(\"user\", \"pasword\", \"127.0.0.1\", \"3306\", \"db_name\")\n dm.generate()\n```\n\nthen, you will get `er.md`\n\n### Output Sample of Skila\nref: https://downloads.mysql.com/docs/sakila-db.tar.gz\n\n![output sapmle](./images/skila-sample.png)\n\n[mermaid live editor](https://mermaid.live/edit#pako:eNqtV9GOojAU_RXSpzExE0FB8c0ZcdeMuhPH2exsTEwDxWkChZQyOy7x3_cC4qIWxM3yBJy255zbe28hQXbgEDREhI8p3nLsr5kCF7ZFwJP8Pr1e5qPZbLpY5cCGOsrz01_0-2j5-HW0vOvpLcWlPBIbhn0ixz18Aa-mc-tlNZo_52AcOlgAvD9IcRxOokgqJoeq5OidVjGkFtQuUQ1Qh0aCU1tIiG0qdinrRMKqwtQwiAT2Nmls5WuH7wErQYvX2UzxAhsLGrCmgUlFJDXiqkKS4rJpQcwEv7B1RUM-Kalfr1JJPqQxGTxsgxO21XTxlpEdoCo2DTLvlqSz40gEPpGWQIGdcxVaAOWkKjv-sUTKUSM-pl59NUwksqBy6UdpyfFoZaVBUGxOwPom998sPJnFpMa6LC4-ZngLYYPScN1zlddd1OuBJaV6DlT_sVtdU_ow-_aghNA3Yt5sA2vzpmr3jt3GaClxRHiFhbTV4Cj6FXCnaSxd6vmytE_fV4VS1QYtRVDhlTPI-rFSHBLZnIanbe3NGi0VTjyCI7LZEcwv7XqYbWPIlqpwBJxuKYMWe20gJyztxE7Mz3rr2HqcgrW73kZrFaP4SQkcnXuEbcX75VQ9nxp62CY-rAD9PiqdFtbida6ktGxbWtSCjQ6JTYHOhbqDJIma7kzhNamPV3mDjgfOLc0v2-nbvgBqs6QBm6S1X1myvu83oBTkU9ya55quN8jzAwtlH5AUp6bm1nj6Ok9pjujVUE6eGveKOtMh3qVJKrN8gCqVlE88uRpJRwfA-mIti9o6Q09qCPvph4DkaCqE3XI25XxJnZCyySNX0SlOqCr2a3JLlEoMUO7swkxNDKucojYCIjhGHPh0z6yukXiHJrRGQ7h1iItjT6xRPjSfZjkU5KOhi72ItBGORfCyY_bxRT7q8BdwfBtihoYJ-kTDXue-bxqGafa7ar9ndHp6G-3QUDXV-87A0LqGbupad6AO9m30OwhgCfXe6Hc0zTS6qto3O6rZbyOSqZjnPx3Zv0fG8TObIHhM9n8AOUymUQ)\n\n# Caution \u2757\nthis package is not full.\nIt cannot generate table relation, can only generate table definition \ud83d\ude22.\n(And now, only mysql... \ud83e\udd23)\n\n# Future\nMake CLI\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "db -> mermaid ER code",
"version": "1.0.3",
"split_keywords": [
"mermaid",
"erdiagram"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cae67eff14326ea0b0e195041f79951658539017b0a6f813b007a17544a7c005",
"md5": "823265bf41b56f6cb1d9a022a4213396",
"sha256": "79ca8bc3b3f047e175aeb2b90ae6f5f4c3979c40a825a7a27280cbef07448816"
},
"downloads": -1,
"filename": "DB2mermaid-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "823265bf41b56f6cb1d9a022a4213396",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3726,
"upload_time": "2023-03-19T13:36:54",
"upload_time_iso_8601": "2023-03-19T13:36:54.657003Z",
"url": "https://files.pythonhosted.org/packages/ca/e6/7eff14326ea0b0e195041f79951658539017b0a6f813b007a17544a7c005/DB2mermaid-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-19 13:36:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "kitsystemyou",
"github_project": "make-mermaid-swim-by-db",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "bleach",
"specs": [
[
"==",
"6.0.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2022.12.7"
]
]
},
{
"name": "cffi",
"specs": [
[
"==",
"1.15.1"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.1.0"
]
]
},
{
"name": "cryptography",
"specs": [
[
"==",
"39.0.2"
]
]
},
{
"name": "docutils",
"specs": [
[
"==",
"0.19"
]
]
},
{
"name": "greenlet",
"specs": [
[
"==",
"2.0.2"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.4"
]
]
},
{
"name": "importlib-metadata",
"specs": [
[
"==",
"6.0.0"
]
]
},
{
"name": "jaraco.classes",
"specs": [
[
"==",
"3.2.3"
]
]
},
{
"name": "jeepney",
"specs": [
[
"==",
"0.8.0"
]
]
},
{
"name": "keyring",
"specs": [
[
"==",
"23.13.1"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"2.2.0"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "more-itertools",
"specs": [
[
"==",
"9.1.0"
]
]
},
{
"name": "mysqlclient",
"specs": [
[
"==",
"2.1.1"
]
]
},
{
"name": "pkginfo",
"specs": [
[
"==",
"1.9.6"
]
]
},
{
"name": "pycparser",
"specs": [
[
"==",
"2.21"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.14.0"
]
]
},
{
"name": "readme-renderer",
"specs": [
[
"==",
"37.3"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.28.2"
]
]
},
{
"name": "requests-toolbelt",
"specs": [
[
"==",
"0.10.1"
]
]
},
{
"name": "rfc3986",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.3.2"
]
]
},
{
"name": "SecretStorage",
"specs": [
[
"==",
"3.3.3"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "SQLAlchemy",
"specs": [
[
"==",
"2.0.6"
]
]
},
{
"name": "twine",
"specs": [
[
"==",
"4.0.2"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.5.0"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"1.26.15"
]
]
},
{
"name": "webencodings",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.15.0"
]
]
}
],
"lcname": "db2mermaid"
}