semvec/pypi-packages huggingface dataset:
heroshot 0.15.0
Screenshot automation integrations for Python documentation tools
License: MIT
Requires Python: >=3.8
Keywords: screenshot, automation, documentation, mkdocs, mkdocs-material, sphinx, dark-mode

# Heroshot

Screenshot automation for Python documentation tools.

## MkDocs

```bash
pip install heroshot[mkdocs]
```

Add to `mkdocs.yml`:

```yaml
plugins:
  - macros:
      modules: [heroshot]
```

Use in markdown:

```md
{{ heroshot("dashboard", "Dashboard overview") }}
```

## Sphinx

```bash
pip install heroshot[sphinx]
```

Add to `conf.py`:

```python
extensions = ['heroshot.sphinx']
```

Use in RST:

```rst
.. heroshot:: dashboard
   :alt: Dashboard overview
```

## Links

- [MkDocs Documentation](https://heroshot.sh/docs/integrations/mkdocs)
- [Sphinx Documentation](https://heroshot.sh/docs/integrations/sphinx)
- [GitHub](https://github.com/omachala/heroshot)
chainit 0.5.0
Chainable lazy iterators
License: MIT
Requires Python: >=3.10

# chainit

Documentation available here: https://lukapeschke.github.io/chainit/

This library provides the `ChainIt` class, a wrapper around stdlib's
[itertools](https://docs.python.org/3/library/itertools.html) module, allowing to chain
operations on iterables, resulting in easier-to-read code.

```python
import typing as t

def fib() -> t.Iterable[int]:
    a, b = 0, 1
    while True:
        yield a
        a, b = b, a + b

# Allows to write things like this...
(
    ChainIt(fib())
    .filter(lambda x: x % 2 == 0)
    .map(lambda x: x // 2)
    .flat_map(range)
    .take_while(lambda x: x < 6)
    .collect_list()
)

# ...rather than like this
from itertools import chain as ichain, islice, takewhile

list(
    takewhile(
        lambda x: x < 6,
        ichain.from_iterable(
            map(lambda x: range(x // 2), filter(lambda x: x % 2 == 0, fib()))
        ),
    )
)
```

## Installation

```
pip install chainit
```

## Examples

### Decorator

In addition to `ChainIt`, the library provides a `chainit` decorator. It makes a function returning
an iterable return a `ChainIt` instead:

```python
@chainit
def fac():
    n = 0
    fac = 1
    while True:
        yield fac
        n += 1
        fac *= n

assert fac().enumerate().take(5).collect() == ((0, 1), (1, 1), (2, 2), (3, 6), (4, 24))
```

### Using a `ChainIt` instance as an iterable

```python
assert list(fac().take(3)) == [1, 1, 2]

for idx, x in fac().enumerate():
    if idx > 3:
        break
    print(x)
```