semvec/pypi-packages huggingface dataset:
enver 0.2.0
Organize your config and environment variables
Requires Python: >=3.8,<4.0

# enver

Enver is a simple config / environment helper.

[![Test And Lint](https://github.com/danhje/enver/actions/workflows/python-test.yml/badge.svg)](https://github.com/danhje/enver/actions/workflows/python-test.yml)
[![codecov](https://codecov.io/gh/danhje/enver/branch/master/graph/badge.svg)](https://codecov.io/gh/danhje/enver)
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/danhje/enver?include_prereleases)
![PyPI](https://img.shields.io/pypi/v/enver)

Collect all your config values and environment variables in a single location, so new contributors knows what variables must be
  set, and don't have to go searching for `os.environ` or `os.getenv` scattered throughout the code.

Features:
- Automatic validation of environment variables.
- Automatic casting to desired data type using Pydantic.
- Optional default values.
- Fails fast if a variable has no value (either default or override).
- Allows lookup using dot notation, e.g. `env.DB_PASSWORD`, as well as subscript (`env['DB_PASSWORD']`) or the `get()` method `env.get('DB_PASSWORD')`.

## Installation

```
pip install enver
```

## Usage

Create a class that inherits from Enver, with config variables as class attributes. Putting this class in a separate config.py file might be a good idea, but is not necessary.


```python
# config.py

from enver import Enver
from typing import Optional, List, Dict

class Config(Enver):
    MY_DB_HOST: str = "127.0.0.1"
    MY_DB_USER: str = "user"
    MY_DB_PASSWORD: str  # No default value, will be supplied as environment value.
    THIS_VAL_MIGHT_NOT_EXIST_IN_ENV: Optional[str]
    PI: float  # Read from env and converted to float, if possible.
    ENABLE_LOGGING: bool = True
    LOCATIONS: List[str] = ["/opt", "/etc"]
    MAPPING: Dict[str, float]
```

If environment values with the same name as any of the attributes exist, those will be used, overriding any defaults. Values will be converted to the specified type. If conversion is not possible, an exception is thrown.

Here's how to use the values:

```python
# service.py

from .config import Config

env = Config()

user = env.MY_DB_USER
password = env.MY_DB_PASSWORD

if env.exists('FEATURE_1'):
  feature_1()

all_values = env.all()
```

The `Enver` class and any derived classes are singletons, meaning they always return the same instance:

```python
env1 = Config()
env2 = Config()
assert env1 is env2
```

Which means this is fine:

````python
user = Config().MY_DB_USER
password = Config().MY_DB_PASSWORD
````

## Development

Dependencies for the project are managed with poetry.
To install all dependencies run:

```shell
poetry install
```

To install pre-commit and set up its git hooks:
```
pip install pre-commit
pre-commit install
```
Now pre-commit will run automatically on every commit.
nest-dfa 1.1.2
dfa filter func
Requires Python: >=3

#### Installing

-----

Install with **pip**

```shell
pip install nest-dfa==1.1.2
```


#### Usage

------

- DFAFilter用法

  > :explain: 敏感词过滤
  >
  > :syntax: DFAFilter(sensitive_words: str) -> None
  >
  > :syntax: filter(self, message: str, repl: str="*") -> str
  >
  > :param: sensitive_words， 敏感词文本文件地址
  >
  > :param: message  需要检测敏感词的字符串
  >
  > :param: repl  敏感词需要替换的标识，默认为 *
  >
  > :return: 过滤后的字符串
  
  ```python
  >>> from pydfa.dfa import DFAFilter
  >>> dfa = DFAFilter(sensitive_words="/mnt/d/sensitive_words.txt")
  >>> message = "大家足球投注哈麻醉"
  >>> print(dfa.filter(message))
  >>> "大家****哈**"
  ```
muz 0.0.4
A console music player.
Requires Python: >=3.6
Keywords: userelaina

userelaina - Muz
====================================

.. image:: https://img.shields.io/pypi/v/muz.svg
   :target: https://pypi.org/project/muz/

A console music player. 

You can use pip to install packages from the `Python Package Index`_ and other indexes.

* `GitHub page`_
* `Issue tracking`_

.. _Python Package Index: https://pypi.org
.. _GitHub page: https://github.com/userElaina/console-music-player
.. _Issue tracking: https://github.com/userElaina/console-music-player/issues
rsap2p 0.0.1
Decentralized end-to-end encrypted communication tool.
Requires Python: >=3.6
Keywords: userelaina

userelaina - rsap2p
====================================

.. image:: https://img.shields.io/pypi/v/rsap2p.svg
   :target: https://pypi.org/project/rsap2p/

Decentralized end-to-end encrypted communication tool.

You can use pip to install packages from the `Python Package Index`_ and other indexes.

* `GitHub page`_
* `Issue tracking`_

.. _Python Package Index: https://pypi.org
.. _GitHub page: https://github.com/userelaina/rsap2p
.. _Issue tracking: https://github.com/userelaina/rsap2p/issues
userelaina 0.0.4
Syntax sugar.
Requires Python: >=3.6
Keywords: userelaina

userelaina - Syntax sugar
====================================

.. image:: https://img.shields.io/pypi/v/userelaina.svg
   :target: https://pypi.org/project/userelaina/

Syntax sugar for myself. 

You can use pip to install packages from the `Python Package Index`_ and other indexes.

* `GitHub page`_
* `Issue tracking`_

.. _Python Package Index: https://pypi.org
.. _GitHub page: https://github.com/userElaina/sugar
.. _Issue tracking: https://github.com/userElaina/sugar/issues