rekha


Namerekha JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryBeautiful matplotlib visualizations with a Plotly Express-like interface
upload_time2025-07-14 08:29:02
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseApache-2.0
keywords matplotlib plotting visualization data-science plotly-express
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

# Rekha

*The semantic plotting library for Python with publication-quality output*

[![Documentation](https://img.shields.io/badge/๐Ÿ“–_Documentation-blue?style=for-the-badge)](https://project-vajra.github.io/rekha/)
[![Discord](https://img.shields.io/badge/๐Ÿ’ฌ_Discord-7289da?style=for-the-badge)](https://discord.gg/wjaSvGgsNN)
[![PyPI](https://img.shields.io/pypi/v/rekha?style=for-the-badge&color=green)](https://pypi.org/project/rekha/)

---

**One line of code. Publication-ready plots.**

Rekha combines Plotly Express's intuitive API with matplotlib's powerful rendering engine, giving you beautiful visualizations without the boilerplate.

</div>

## ๐Ÿš€ Quick Start

### Installation

```bash
pip install rekha
```

### Basic Usage

```python
import rekha as rk
import pandas as pd

# Your data (any pandas DataFrame)
df = pd.read_csv('your_data.csv')

# One line = beautiful plot
fig = rk.scatter(df, x='x', y='y', color='category')
fig.show()
```

**That's it!** You now have publication-ready visualizations with zero configuration.

## ๐Ÿ“Š Sample Graphs

<div align="center">

### Scatter Plot
```python
rk.scatter(df, x='x', y='y', color='species')
```
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="docs/_static/plots/scatter_colored_dark.png">
  <source media="(prefers-color-scheme: light)" srcset="docs/_static/plots/scatter_colored_light.png">
  <img src="docs/_static/plots/scatter_colored_light.png" width="450">
</picture>

### Line Plot  
```python
rk.line(df, x='date', y='price', color='stock')
```
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="docs/_static/plots/line_basic_dark.png">
  <source media="(prefers-color-scheme: light)" srcset="docs/_static/plots/line_basic_light.png">
  <img src="docs/_static/plots/line_basic_light.png" width="450">
</picture>

### Bar Chart
```python
rk.bar(df, x='category', y='sales', color='region')
```
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="docs/_static/plots/bar_grouped_dark.png">
  <source media="(prefers-color-scheme: light)" srcset="docs/_static/plots/bar_grouped_light.png">
  <img src="docs/_static/plots/bar_grouped_light.png" width="450">
</picture>

### Heatmap
```python
rk.heatmap(correlation_matrix, text_auto=True)
```
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="docs/_static/plots/heatmap_correlation_dark.png">
  <source media="(prefers-color-scheme: light)" srcset="docs/_static/plots/heatmap_correlation_light.png">
  <img src="docs/_static/plots/heatmap_correlation_light.png" width="450">
</picture>

**Every plot type. Same simple API. Beautiful results.**

๐Ÿ“– **[See all plot types in our documentation โ†’](https://project-vajra.github.io/rekha/)**

</div>

## Why Rekha Exists

**The Plotting Library Dilemma:**

- **Matplotlib** = Powerful but painful. Every plot requires 20+ lines of boilerplate.
- **Plotly Express** = has great semantics but limited customization and poor aesthetics for publications.
- **Seaborn** = Good defaults but restrictive API and complicated to use.

**Rekha's Solution:** Get the best of all worlds. Plotly Express semantics + matplotlib quality + unlimited customization.

## โœจ What Makes Rekha Special

๐ŸŽฏ **One-Line Plots** - Create publication-ready visualizations with a single function call  
๐ŸŽจ **Intelligent Defaults** - Beautiful themes that work in light mode, dark mode, and print  
๐Ÿ“Š **All Plot Types** - Line, scatter, bar, histogram, box, heatmap, CDF - unified API  
๐Ÿ–จ๏ธ **Print Perfection** - Automatic grayscale optimization with patterns for accessibility  
โšก **Zero Config** - Works beautifully out of the box, customize when you need to  
๐Ÿ”ง **Unlimited Power** - Full matplotlib access when you need advanced customization

## Plot Types

Rekha supports all major statistical visualizations with a unified interface:

- **Line plots** - Time series, trends, multiple series
- **Scatter plots** - Relationships, correlations, bubble charts  
- **Bar charts** - Categorical comparisons, grouped/stacked bars
- **Histograms** - Data distributions, density plots
- **Box plots** - Statistical summaries, outlier detection
- **Heatmaps** - 2D data, correlation matrices
- **CDF plots** - Cumulative distributions, percentile analysis

## Key Features

### Smart Export Formats
```python
fig.save('plot.pdf', format='paper')    # Publication PDF
fig.save('plot.svg', format='web')      # Web-ready SVG  
fig.save('plot.png', format='social')   # High-res PNG
```

### Theme Support
```python
fig = rk.scatter(df, x='x', y='y', dark_mode=True)           # Dark theme
fig = rk.bar(df, x='cat', y='val', grayscale_friendly=True)  # Print-ready
```

### Full Matplotlib Access
```python
fig = rk.scatter(df, x='x', y='y')
fig.get_axes()[0].axhline(y=0, color='red', linestyle='--')  # Custom elements
```

## ๐Ÿ“– Documentation

Comprehensive documentation is available at: **https://project-vajra.github.io/rekha/**

- **[Quick Start Guide](https://project-vajra.github.io/rekha/quickstart.html)** - Get up and running in minutes
- **[User Guide](https://project-vajra.github.io/rekha/user_guide/)** - Comprehensive feature documentation
- **[API Reference](https://project-vajra.github.io/rekha/api/)** - Complete function reference

## Philosophy

Rekha follows these principles:

1. **Beautiful defaults** - Plots should look professional without tweaking
2. **Simple API** - Common tasks should be one-liners
3. **Full control** - Complex customization should be possible
4. **Performance** - No unnecessary overhead

## ๐Ÿค Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for detailed information on:

- Setting up development environment
- Code style and testing requirements
- Documentation standards
- Pull request process

### Quick Development Setup

```bash
git clone https://github.com/project-vajra/rekha.git
cd rekha

# Install in development mode
make install-dev

# Install pre-commit hooks
pre-commit install

# Verify setup works
make format && make lint && make test

# See all available development commands
make help
```

## Related Projects

Rekha is part of the Project Vajra ecosystem:

- **[Vajra](https://github.com/project-vajra/vajra)** - High-performance inference engine for large language models
- **[Rekha](https://github.com/project-vajra/rekha)** - Beautiful matplotlib visualizations (this project)

## License

Apache License 2.0 - see [LICENSE](LICENSE) file for details.

## Etymology

*Rekha* (เคฐเฅ‡เค–เคพ) is a Sanskrit/Hindi word meaning "line", "stroke", or "diagram". It seemed fitting for a library focused on creating beautiful line plots, scatter plots, and other visualizations.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rekha",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": "Vajra Team <team@project-vajra.org>",
    "keywords": "matplotlib, plotting, visualization, data-science, plotly-express",
    "author": null,
    "author_email": "Vajra Team <team@project-vajra.org>",
    "download_url": "https://files.pythonhosted.org/packages/00/d1/e2aa8c1ca22f49f056d2b7927fc08eafd0387fa9969e59620a8cd561a7f1/rekha-0.0.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# Rekha\n\n*The semantic plotting library for Python with publication-quality output*\n\n[![Documentation](https://img.shields.io/badge/\ud83d\udcd6_Documentation-blue?style=for-the-badge)](https://project-vajra.github.io/rekha/)\n[![Discord](https://img.shields.io/badge/\ud83d\udcac_Discord-7289da?style=for-the-badge)](https://discord.gg/wjaSvGgsNN)\n[![PyPI](https://img.shields.io/pypi/v/rekha?style=for-the-badge&color=green)](https://pypi.org/project/rekha/)\n\n---\n\n**One line of code. Publication-ready plots.**\n\nRekha combines Plotly Express's intuitive API with matplotlib's powerful rendering engine, giving you beautiful visualizations without the boilerplate.\n\n</div>\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\npip install rekha\n```\n\n### Basic Usage\n\n```python\nimport rekha as rk\nimport pandas as pd\n\n# Your data (any pandas DataFrame)\ndf = pd.read_csv('your_data.csv')\n\n# One line = beautiful plot\nfig = rk.scatter(df, x='x', y='y', color='category')\nfig.show()\n```\n\n**That's it!** You now have publication-ready visualizations with zero configuration.\n\n## \ud83d\udcca Sample Graphs\n\n<div align=\"center\">\n\n### Scatter Plot\n```python\nrk.scatter(df, x='x', y='y', color='species')\n```\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"docs/_static/plots/scatter_colored_dark.png\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"docs/_static/plots/scatter_colored_light.png\">\n  <img src=\"docs/_static/plots/scatter_colored_light.png\" width=\"450\">\n</picture>\n\n### Line Plot  \n```python\nrk.line(df, x='date', y='price', color='stock')\n```\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"docs/_static/plots/line_basic_dark.png\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"docs/_static/plots/line_basic_light.png\">\n  <img src=\"docs/_static/plots/line_basic_light.png\" width=\"450\">\n</picture>\n\n### Bar Chart\n```python\nrk.bar(df, x='category', y='sales', color='region')\n```\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"docs/_static/plots/bar_grouped_dark.png\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"docs/_static/plots/bar_grouped_light.png\">\n  <img src=\"docs/_static/plots/bar_grouped_light.png\" width=\"450\">\n</picture>\n\n### Heatmap\n```python\nrk.heatmap(correlation_matrix, text_auto=True)\n```\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"docs/_static/plots/heatmap_correlation_dark.png\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"docs/_static/plots/heatmap_correlation_light.png\">\n  <img src=\"docs/_static/plots/heatmap_correlation_light.png\" width=\"450\">\n</picture>\n\n**Every plot type. Same simple API. Beautiful results.**\n\n\ud83d\udcd6 **[See all plot types in our documentation \u2192](https://project-vajra.github.io/rekha/)**\n\n</div>\n\n## Why Rekha Exists\n\n**The Plotting Library Dilemma:**\n\n- **Matplotlib** = Powerful but painful. Every plot requires 20+ lines of boilerplate.\n- **Plotly Express** = has great semantics but limited customization and poor aesthetics for publications.\n- **Seaborn** = Good defaults but restrictive API and complicated to use.\n\n**Rekha's Solution:** Get the best of all worlds. Plotly Express semantics + matplotlib quality + unlimited customization.\n\n## \u2728 What Makes Rekha Special\n\n\ud83c\udfaf **One-Line Plots** - Create publication-ready visualizations with a single function call  \n\ud83c\udfa8 **Intelligent Defaults** - Beautiful themes that work in light mode, dark mode, and print  \n\ud83d\udcca **All Plot Types** - Line, scatter, bar, histogram, box, heatmap, CDF - unified API  \n\ud83d\udda8\ufe0f **Print Perfection** - Automatic grayscale optimization with patterns for accessibility  \n\u26a1 **Zero Config** - Works beautifully out of the box, customize when you need to  \n\ud83d\udd27 **Unlimited Power** - Full matplotlib access when you need advanced customization\n\n## Plot Types\n\nRekha supports all major statistical visualizations with a unified interface:\n\n- **Line plots** - Time series, trends, multiple series\n- **Scatter plots** - Relationships, correlations, bubble charts  \n- **Bar charts** - Categorical comparisons, grouped/stacked bars\n- **Histograms** - Data distributions, density plots\n- **Box plots** - Statistical summaries, outlier detection\n- **Heatmaps** - 2D data, correlation matrices\n- **CDF plots** - Cumulative distributions, percentile analysis\n\n## Key Features\n\n### Smart Export Formats\n```python\nfig.save('plot.pdf', format='paper')    # Publication PDF\nfig.save('plot.svg', format='web')      # Web-ready SVG  \nfig.save('plot.png', format='social')   # High-res PNG\n```\n\n### Theme Support\n```python\nfig = rk.scatter(df, x='x', y='y', dark_mode=True)           # Dark theme\nfig = rk.bar(df, x='cat', y='val', grayscale_friendly=True)  # Print-ready\n```\n\n### Full Matplotlib Access\n```python\nfig = rk.scatter(df, x='x', y='y')\nfig.get_axes()[0].axhline(y=0, color='red', linestyle='--')  # Custom elements\n```\n\n## \ud83d\udcd6 Documentation\n\nComprehensive documentation is available at: **https://project-vajra.github.io/rekha/**\n\n- **[Quick Start Guide](https://project-vajra.github.io/rekha/quickstart.html)** - Get up and running in minutes\n- **[User Guide](https://project-vajra.github.io/rekha/user_guide/)** - Comprehensive feature documentation\n- **[API Reference](https://project-vajra.github.io/rekha/api/)** - Complete function reference\n\n## Philosophy\n\nRekha follows these principles:\n\n1. **Beautiful defaults** - Plots should look professional without tweaking\n2. **Simple API** - Common tasks should be one-liners\n3. **Full control** - Complex customization should be possible\n4. **Performance** - No unnecessary overhead\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for detailed information on:\n\n- Setting up development environment\n- Code style and testing requirements\n- Documentation standards\n- Pull request process\n\n### Quick Development Setup\n\n```bash\ngit clone https://github.com/project-vajra/rekha.git\ncd rekha\n\n# Install in development mode\nmake install-dev\n\n# Install pre-commit hooks\npre-commit install\n\n# Verify setup works\nmake format && make lint && make test\n\n# See all available development commands\nmake help\n```\n\n## Related Projects\n\nRekha is part of the Project Vajra ecosystem:\n\n- **[Vajra](https://github.com/project-vajra/vajra)** - High-performance inference engine for large language models\n- **[Rekha](https://github.com/project-vajra/rekha)** - Beautiful matplotlib visualizations (this project)\n\n## License\n\nApache License 2.0 - see [LICENSE](LICENSE) file for details.\n\n## Etymology\n\n*Rekha* (\u0930\u0947\u0916\u093e) is a Sanskrit/Hindi word meaning \"line\", \"stroke\", or \"diagram\". It seemed fitting for a library focused on creating beautiful line plots, scatter plots, and other visualizations.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Beautiful matplotlib visualizations with a Plotly Express-like interface",
    "version": "0.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/project-vajra/rekha/issues",
        "Changelog": "https://github.com/project-vajra/rekha/blob/main/CHANGELOG.md",
        "Documentation": "https://project-vajra.github.io/rekha",
        "Homepage": "https://github.com/project-vajra/rekha",
        "Repository": "https://github.com/project-vajra/rekha"
    },
    "split_keywords": [
        "matplotlib",
        " plotting",
        " visualization",
        " data-science",
        " plotly-express"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0bc698df080f9670fe13a355bb3b801939a40d24a3cf314f93fb56059f0aaacd",
                "md5": "aace5828700fd7326ec72c510073d9aa",
                "sha256": "15a77612924bb36b6bca48ec3d6566741d294f9a0e50916e021ca0072b71f927"
            },
            "downloads": -1,
            "filename": "rekha-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aace5828700fd7326ec72c510073d9aa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 49900,
            "upload_time": "2025-07-14T08:29:00",
            "upload_time_iso_8601": "2025-07-14T08:29:00.776709Z",
            "url": "https://files.pythonhosted.org/packages/0b/c6/98df080f9670fe13a355bb3b801939a40d24a3cf314f93fb56059f0aaacd/rekha-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "00d1e2aa8c1ca22f49f056d2b7927fc08eafd0387fa9969e59620a8cd561a7f1",
                "md5": "4dd711e5a268b136b92e50c470aa682f",
                "sha256": "6b426e32d3843e8649ae644e8edc4725e784db5cc11d387e9a29c1a684a2a569"
            },
            "downloads": -1,
            "filename": "rekha-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4dd711e5a268b136b92e50c470aa682f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 1238870,
            "upload_time": "2025-07-14T08:29:02",
            "upload_time_iso_8601": "2025-07-14T08:29:02.684283Z",
            "url": "https://files.pythonhosted.org/packages/00/d1/e2aa8c1ca22f49f056d2b7927fc08eafd0387fa9969e59620a8cd561a7f1/rekha-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-14 08:29:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "project-vajra",
    "github_project": "rekha",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rekha"
}
        
Elapsed time: 1.27155s