semvec/pypi-packages huggingface dataset:
shfmt-py 3.12.0.2
Python wrapper around invoking shfmt (https://github.com/mvdan/sh)
License: MIT
Requires Python: >=3.9

[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/MaxWinterstein/shfmt-py/master.svg)](https://results.pre-commit.ci/latest/github/MaxWinterstein/shfmt-py/master)

# shfmt-py

A python wrapper to provide a pip-installable [shfmt] binary.

Internally this package provides a convenient way to download the pre-built
shellcheck binary for your particular platform.

This package is totally cloned from [shellcheck-py] and modified to provide `shfmt` instead.

## Installation

```bash
pip install shfmt-py
```

## Usage

### CLI

After installation, the `shfmt` binary should be available in your
environment (or `shfmt.exe` on windows).

### As pre-commit hook

See [pre-commit] for instructions

Sample `.pre-commit-config.yaml`:

```yaml
- repo: https://github.com/maxwinterstein/shfmt-py
  rev: v3.12.0.1
  hooks:
    - id: shfmt
```

## FAQ

Q: It won't get updated via e.g. `Renovate Bot`

A: See https://github.com/shfmt-py/update-via-renovate .

Q: I get something like `SSL: CERTIFICATE_VERIFY_FAILED` on macOS

A: Install certificates with e.g.: `"/Applications/Python 3.9/Install Certificates.command"`. See [here][here1] or [here][here2] for a solution.


[shfmt]: https://github.com/mvdan/sh
[pre-commit]: https://pre-commit.com
[shellcheck-py]: https://github.com/shellcheck-py/shellcheck-py
[here1]: https://github.com/albertogeniola/MerossIot/issues/62#issuecomment-535769621
[here2]: https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error
django-cache-otp 0.2.2
OTP system based on cache
License: MIT

from build.lib.django_cache_otp.decorators import skip_if_existsfrom django_cache_otp import generate_otp

# django-cache-otp

A simple Django package for generating and validating OTPs using Django's cache framework.

## Table of Contents
- [Installation](#installation)
- [Setup](#setup)
  - [Configure Cache (Using Redis)](#configure-cache-using-redis)
- [Usage](#usage)
- [Features](#features)
- [Contributing](#contributing)
- [License](#license)

## Installation
Install via pip:

```bash
pip install django-cache-otp
```

# Setup
### Configure Cache (Using Redis)
set up your cache settings `settings.py`:

```python
CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": "redis://127.0.0.1:6379/1",
    }
}
```

## Usage
```python
from django_cache_otp import generate_otp, validate_otp

otp = generate_otp("username", otp_length=6, timeout=60)  # Example: 123456, valid for 60 seconds
is_valid = validate_otp("username", otp)  # Returns True or False
```
if you want to not generate new OTP when username already has one:

```python
otp = generate_otp("username", otp_length=6, timeout=60, skip_if_exists=True)
# return None if username already has an OTP
```


## Features
* Easy integration with Django's cache framework.
* Customizable OTP length and timeout.
* Supports various cache backends (e.g., Redis, Memcached).
* Using SECRET_KEY for encrypt otp.

## Contributing
Contributions are very welcome! Please follow these steps:

* Fork the repository.
* Create a new branch (git checkout -b feature/YourFeature).
* Make your changes and commit them (git commit -m 'Add some feature').
* Push to the branch (git push origin feature/YourFeature).
* Open a pull request.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.