Skip to main content

syrenka is mermaid markdown generator

Project description

syrenka

syrenka is mermaid markdown generator

Description

The aim of this project is to provide easy to use classes for generating mermaid charts and diagrams.

Installation

pip install syrenka

Example

Here are current classes with names starting with "Syrenka" in syrenka module:

---
title: syrenka class diagram
---
classDiagram
    class SyrenkaClass{
        -cls
        -indent
        -skip_underscores
        +__init__(self, cls, skip_underscores)
        +to_code(self, indent_level, indent_base)
    }
    class SyrenkaClassDiagram{
        -title
        -classes
        +__init__(self, title)
        +add_class(self, cls)
        +add_classes(self, classes)
        +to_code(self, indent_level, indent_base)
    }
    class SyrenkaFlowchart{
        +__init__(self, title, direction, nodes)
        +add(self, node)
        +connect(self, source, target, edge_type)
        +connect_by_id(self, source_id, target_id, edge_type)
        +get_node_by_id(self, id)
        +remove(self, node, exception_if_not_exists)
        +to_code(self, indent_level, indent_base)
    }

So how do we get it? This is a code snippet that does it:

import syrenka
from syrenka.base import generate_class_list_from_module

class_diagram  = syrenka.SyrenkaClassDiagram("syrenka class diagram")
class_diagram.add_classes(generate_class_list_from_module(module_name="syrenka", starts_with="Syrenka"))

for line in class_diagram.to_code():
    print(line)

and the output:

---
title: syrenka class diagram
---
classDiagram
    class SyrenkaClass{
        -cls
        -indent
        -skip_underscores
        +__init__(self, cls, skip_underscores)
        +to_code(self, indent_level, indent_base)
    }
    class SyrenkaClassDiagram{
        -title
        -classes
        +__init__(self, title)
        +add_class(self, cls)
        +add_classes(self, classes)
        +to_code(self, indent_level, indent_base)
    }
    class SyrenkaFlowchart{
        +__init__(self, title, direction, nodes)
        +add(self, node)
        +connect(self, source, target, edge_type)
        +connect_by_id(self, source_id, target_id, edge_type)
        +get_node_by_id(self, id)
        +remove(self, node, exception_if_not_exists)
        +to_code(self, indent_level, indent_base)
    }

ready to use mermaid markdown

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

syrenka-0.1.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

syrenka-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file syrenka-0.1.2.tar.gz.

File metadata

  • Download URL: syrenka-0.1.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for syrenka-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fcac48f8482b35ea7e27e440a13fc7b84b13019bfc5ab14290da0e89084aa8ff
MD5 cbdb351e6aa2b41327c8fa25c0495b58
BLAKE2b-256 08a69480ad0f66909b8b149ec1e4fde78f46244739d12aef574bde964edee2de

See more details on using hashes here.

Provenance

The following attestation bundles were made for syrenka-0.1.2.tar.gz:

Publisher: python-publish.yml on bartlomiejcieszkowski/syrenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syrenka-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: syrenka-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for syrenka-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 598cfead5c20822498174f893567b07b89a6a5d7202ebe7b137e470d19cc3ad2
MD5 904da3a26372abb7a2ab7710a130af2d
BLAKE2b-256 82d1993526289a11602598563f16599094793398bc0721536cc5f4034b177e8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for syrenka-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on bartlomiejcieszkowski/syrenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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