Metadata-Version: 2.4
Name: prelude_py
Version: 0.2.0
Summary: Lazy imports for common scientific Python libraries.
Project-URL: Homepage, https://github.com/davidrm-bio/prelude_py
Project-URL: Repository, https://github.com/davidrm-bio/prelude_py
Project-URL: Issues, https://github.com/davidrm-bio/prelude_py/issues
Author-email: David Rodriguez Morales <rodriguezmorales@med.uni-frankfurt.de>
Maintainer-email: David Rodriguez Morales <rodriguezmorales@med.uni-frankfurt.de>
License: MIT License
        
        Copyright (c) 2026 David Rodriguez Morales
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: lazy-import,scientific-python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: numpy
Requires-Dist: pandas
Provides-Extra: all
Requires-Dist: anndata; extra == 'all'
Requires-Dist: decoupler; extra == 'all'
Requires-Dist: dotools-py; extra == 'all'
Requires-Dist: matplotlib; extra == 'all'
Requires-Dist: numba; extra == 'all'
Requires-Dist: numpy; extra == 'all'
Requires-Dist: pandas; extra == 'all'
Requires-Dist: pertpy; extra == 'all'
Requires-Dist: polars; extra == 'all'
Requires-Dist: scanpy; extra == 'all'
Requires-Dist: scvi-tools; extra == 'all'
Requires-Dist: seaborn; extra == 'all'
Requires-Dist: squidpy; extra == 'all'
Provides-Extra: dev
Requires-Dist: pre-commit; extra == 'dev'
Provides-Extra: test
Requires-Dist: anndata; extra == 'test'
Requires-Dist: coverage[toml]; extra == 'test'
Requires-Dist: decoupler; extra == 'test'
Requires-Dist: dotools-py; extra == 'test'
Requires-Dist: matplotlib; extra == 'test'
Requires-Dist: numba; extra == 'test'
Requires-Dist: numpy; extra == 'test'
Requires-Dist: pandas; extra == 'test'
Requires-Dist: pertpy; extra == 'test'
Requires-Dist: polars; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Requires-Dist: scanpy; extra == 'test'
Requires-Dist: scvi-tools; extra == 'test'
Requires-Dist: seaborn; extra == 'test'
Requires-Dist: squidpy; extra == 'test'
Description-Content-Type: text/markdown

# Prelude_py

[![Tests][badge-tests]][tests]
[![Coverage][badge-coverage]][codecoverage]
[![Issues][badge-issues]][issue tracker]
[![Stars][badge-stars]](https://github.com/davidrm-bio/prelude_py/stargazers)
[![PyPI][badge-pypi]][pypi]
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/prelude-py?period=monthly&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=monthly+downloads)](https://pepy.tech/projects/prelude-py)

[badge-tests]: https://img.shields.io/github/actions/workflow/status/davidrm-bio/prelude_py/test.yaml?branch=main
[badge-issues]: https://img.shields.io/github/issues/davidrm-bio/prelude_py
[badge-stars]: https://img.shields.io/github/stars/davidrm-bio/prelude_py?style=flat&logo=github&color=yellow
[badge-coverage]: https://codecov.io/gh/davidrm-bio/prelude_py/branch/main/graph/badge.svg
[badge-pypi]: https://img.shields.io/pypi/v/prelude_py.svg



`prelude_py` is a lightweight convenience module that provides lazy imports for commonly used scientific Python 
libraries through familiar aliases. Instead of importing each library individually, you can access them 
from a single namespace.

Modules are imported only when first accessed, so importing `prelude_py` itself has virtually no overhead.

## Installation

Install the package:

```bash
uv pip install prelude_py
```

To install all supported optional dependencies:

```bash
uv pip install "prelude_py[all]"
```

## Usage

```python
from prelude_py import np, pd, sns, plt

# NumPy
x = np.linspace(0, 10, 100)
y = np.sin(x)

# Pandas
df = pd.DataFrame({"x": x, "sin(x)": y})

# Seaborn
sns.set_theme(style="whitegrid")
sns.lineplot(data=df, x="x", y="sin(x)")
plt.title("Sine Wave")
plt.tight_layout()
plt.show()
```

Output:

<p align="center">
  <img src="docs/images/matplotlib_example.png" width="700">
</p>


```python
from prelude_py import do

# Load example AnnData
adata = do.dt.example_10x_processed()

# Plot UMAP colored by cell annotation
do.pl.umap(adata, color="annotation")
```

Output:

<p align="center">
  <img src="docs/images/UMAP_annotation.png" alt="Matplotlib example plot" width="700">
</p>


## Available aliases

| Alias  | Package             |
| ------ | ------------------- |
| `np`   | `numpy`             |
| `nb`   | `numba`             |
| `pd`   | `pandas`            |
| `pl`   | `polars`            |
| `mpl`  | `matplotlib`        |
| `plt`  | `matplotlib.pyplot` |
| `sns`  | `seaborn`           |
| `do`   | `dotools_py`        |
| `ad`   | `anndata`           |
| `sc`   | `scanpy`            |
| `dc`   | `decoupler`         |
| `sq`   | `squidpy`           |
| `pt`   | `pertpy`            |
| `scvi` | `scvi`              |

## License

This project is distributed under the MIT License.

[issue tracker]: https://github.com/davidrm-bio/prelude_py/issues
[tests]: https://github.com/davidrm-bio/prelude_py/actions/workflows/test.yaml
[pypi]: https://pypi.org/project/prelude_py/
[codecoverage]: https://codecov.io/gh/davidrm-bio/prelude_py
[down]: https://pepy.tech/project/dotools-py
