semvec/pypi-packages huggingface dataset:
prevcurrnext 0.1.1
Iteration utils for "prev", "curr", and "next"-style for-loops.
License: MIT
Requires Python: <4.0,>=3.12

# prevcurrnext

Iteration utils for "prev", "curr", and "next"-style for-loops.

## Install

```bash
pip install prevcurrnext
```

## Usage

The `prevcurrnext` function yields pairs of consecutive elements from an iterable, allowing you to see the "previous", "current", and "next" items for each element. It includes options to yield `None` at the beginning and/or end of the sequence for convenient boundary handling.

```python
from prevcurrnext import prevcurr, currnext, prevcurrnext

# Basic usage
for prev, curr in prevcurr([1, 2, 3]):
    print(prev, curr)
# Output:
# None 1
# 1 2
# 2 3

# Customizing boundary behavior
# Adding None at the end
for prev, curr in prevcurr([1, 2, 3], end_curr_on_none=True):
    print(prev, curr)
# Output:
# None 1
# 1 2
# 2 3
# 3 None

for curr, _next in currnext([1, 2, 3]):
    print(curr, _next)
# Output:
# 1 2
# 2 3
# 3 None

for prev, curr, _next in prevcurrnext([1, 2, 3]):
    print(prev, curr, _next)
# Output:
# None 1 2
# 1 2 3
# 2 3 None
```

### Available functions

* **`currprev`**
* **`prevcurr`**
* **`currnext`**
* **`nextcurr`**
* **`prevcurrnext`**
* **`nextcurrprev`**

All functions have nearly the exact same parameters:

- **`iterable`**: The iterable to process.
- **`start_prev_on_none`**: Whether to yield `None` for the "previous" item before the first element. Default is `True`.
- **`end_curr_on_none`**: Whether to yield `None` for the "current" item after the last element. Default is `False`.
- **`end_next_on_none`**: Whether to yield `None` for the "next" item after the last element. Default is `True`.

## Contributing

Contributions are welcome! If you find issues or have suggestions, please open an issue or submit a pull request on [GitHub](https://github.com/yourusername/prevcurr).

## Development Setup

#### If you use [Poetry](https://python-poetry.org/)

```bash
poetry install
poetry run pytest
```

#### Otherwise...

```bash
python -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
pip install -e .
pytest
```

## License

This project is licensed under the [MIT License](LICENSE).
faker-animals 0.1.0
A provider for the python faker library to generate random animals data
License: MIT

# faker-animals
A provider for the python faker library to generate animals data.

## Description

`faker-animals` offers comprehensive and accurate animals data,covering an extensive range of species. It includes info like the common name and the scientific name. This data can be useful for applications requiring realistic representations of biological diversity, educational tools, wildlife databases, or any project that needs accurate animal species data.

## Installation

Install with pip:

``` bash
pip install faker-animals
```

Add as a provider to your Faker instance:

``` python
from faker import Faker
from faker_animals import AnimalsProvider
fake.add_provider(AnimalsProvider)
```

If you already use faker, you probably know the conventional use is:

```python
fake = Faker()
```

## Usage examples

### Animal

``` python
>>> fake.animal()

{
    'common_name': 'Kangaroo',
    'scientific_name': 'Macropodidae',
    'class': 'mammals'
}
```


### Animal Common Name

``` python
>>> fake.animal_name()

'Brown Bear'
```

### Animal Scientific Name

``` python
>>> fake.animal_name_scientific()

'Ursus arctos'
```

### Bird

``` python
>>> fake.bird()

{
  'common_name': 'African Grey Parrot',
  'scientific_name': 'Psittacus erithacus',
  'class': 'birds'
}
```

### Mammal

``` python
>>> fake.mammal()

{
  'common_name': 'Alaskan Husky',
  'scientific_name': 'Canis lupus',
  'class': 'mammals'
}
```

### Fish

``` python
>>> fake.fish()

{
  'common_name': 'White Catfish',
  'scientific_name': 'A. catus',
  'class': 'fish'
}
```

### Reptile

``` python
>>> fake.reptile()

{
  'common_name': 'Black Mamba',
  'scientific_name': 'D. polylepis',
  'class': 'reptiles'
}
```

### Amphibian

``` python
>>> fake.amphibian()

{
  'common_name': 'Green Frog',
  'scientific_name': 'Lithobates clamitans',
  'class': 'amphibians'
}
```