semvec/pypi-packages huggingface dataset:
mermaid-parser-py 0.0.4
Parse Mermaid into manipulable Python objects
License: MIT
Requires Python: <4.0,>=3.11

# mermaid-py-parser
Parse a mermaid text into editable objects. 

**Repository link**: [20001LastOrder/mermaid-parser-py](https://github.com/20001LastOrder/mermaid-parser-py)

## Motivation

I love Mermaid syntax for it's simplicity and expressiveness in creating diagrams. And I use them in a couple of my projects. However, I found that the lack of a robust Python library for parsing and manipulating Mermaid diagrams was a significant limitation.

This library packages the original JS Mermaid parser and ported it with `PythonMonkey` so that the parser can be used in Python. As a result, it can parse _almost any mermaid code into structured JSON object_. I also plan to continue add converting into `mermaid-py` objects and `NertworkX` for eaiser editing and analysis.


## Installation
Since this project relies on the original MermaidJS package, you need to have [Node.js](https://nodejs.org/) installed in your system.


Then, You can install the library using pip:

```bash
pip install mermaid-parser-py
```

Or install from source:

```bash
poetry install
```

If you want to rebuild the MermaidJS package, you can run the following:
```bash
cd mermaid_parser/js
npm install
npx rollup -c
```

## Basic Usage
### Converting Any Mermaid Code Into JSON

```python
from mermaid_parser import MermaidParser

parser = MermaidParser()
json_output = parser.parse("graph TD; A-->B; A-->C; B-->D; C-->D;")
print(json_output)
```

### Converting FlowChart to Mermaid-Py
```python
from mermaid_parser import FlowChartConverter

converter = FlowChartConverter()
flowchart = converter.convert("flowchart TD\nA[Start] --> |Process| B[End]")
print(flowchart)
```


## Known Limitation
To get the internal representation of Mermaid Diagrams, it uses the _deprecated_ `mermaidAPI` object, which may not be available in future versions of Mermaid.

The MermaidJS diagram does not directly work with serverside Node applications. To make it work, I had to hot-patch the MermaidJS pakcage during packaging time to modify the parts using browser features. See `mermaid_parser/js/rollup.config.mjs` for more details.

## Contribution
Any suggestions, issues, or pull requests are more than welcome 🤗!

### Run Tests
You can run the tests using `pytest`:

```bash
pytest tests
```
animate-sh 0.1.0
A Python library for printing animated ASCII art
License: MIT
Requires Python: >=3.12
Keywords: animation, ascii, terminal

# Animate

A Python library for printing animated ASCII art in the terminal.

## Features

- Simple and intuitive API
- Support for custom animations
- Configurable playback options (loop, timeout, FPS)
- Terminal-friendly and cross-platform

## Installation

Using pip:

```sh
pip install animate-sh
```

Using uv:

```sh
uv add animate-sh
```

With color support:

```sh
# pip
pip install animate-sh[color]

# uv
uv add animate-sh[color]
```

## Quick Start

```python
from animate import play
from animate.animations import Spinner

# Play a spinner animation
play(Spinner(), loop=True, timeout=10)
```

## Development

This project uses [just](https://github.com/casey/just) for task automation.

```sh
# Install dependencies
just install

# Run all checks (format, lint, type-check, test)
just check

# Individual commands
just test              # Run tests
just format            # Format code
just lint              # Lint code
just lint-fix          # Fix linting issues
just type-check        # Type check
just examples          # Run example scripts
just build             # Build distribution
just clean             # Clean build artifacts
```

## License

[MIT License](./LICENSE)
animate-py 0.1.0
A Python library for printing animated ASCII art
License: MIT
Requires Python: >=3.12
Keywords: animation, ascii, terminal

# Animate

A Python library for printing animated ASCII art in the terminal.

## Features

- Simple and intuitive API
- Support for custom animations
- Configurable playback options (loop, timeout, FPS)
- Terminal-friendly and cross-platform

## Installation

Using pip:

```sh
pip install animate
```

Using uv:

```sh
uv add animate
```

With color support:

```sh
# pip
pip install animate[color]

# uv
uv add animate[color]
```

## Quick Start

```python
from animate import play
from animate.animations import Spinner

# Play a spinner animation
play(Spinner(), loop=True, timeout=10)
```

## Development

This project uses [just](https://github.com/casey/just) for task automation.

```sh
# Install dependencies
just install

# Run all checks (format, lint, type-check, test)
just check

# Individual commands
just test              # Run tests
just format            # Format code
just lint              # Lint code
just lint-fix          # Fix linting issues
just type-check        # Type check
just examples          # Run example scripts
just build             # Build distribution
just clean             # Clean build artifacts
```

## License

[MIT License](./LICENSE)