semvec/pypi-packages huggingface dataset:
envu 1.2.0
The simplest possible syntax for loading environment variables from the .env file and system environment variables.
License: MIT
Requires Python: <4.0,>=3.8
Keywords: env, .env, environment, environment variables

# envu

This package provides a convenient way to load environment variables from the `.env` file and system environment variables, automatically parsing them into appropriate Python types (`bool`, `int`, `float`, or `str`). It also allows you to access the loaded variables as attributes.

**Features:**

- Parses `.env` file values into their correct types.
- Supports boolean, integer, float, and string conversions.
- Skips empty lines and comments.
- Raises an error for malformed `.env` lines or missing variables.
- Provides a `__dir__` method for inspecting available keys.

## Installation

```sh
pip install envu
```

## Usage

```python
>>> import env  # not envu

>>> env.KEY  # Access environment variables as attributes
'Value'

>>> env.DEBUG  # Boolean Variable
False

>>> env.SECRET_KEY  # String Variable
'fake-secret-key'

>>> env.POSTGRESQL_PORT  # Integer Variable
5432

>>> env.SLEEP_TIME  # Float Variable
1.5

>>> env.ALLOWED_HOSTS.split(",")  # Convert to a list
["localhost", "127.0.0.1", "example.com"]

>>> env.UNDEFINED_VARIABLE  # Undefined Variable
None

>>> env.MY_VARIABLE or "default_value"  # Get the variable with a default fallback
"default_value"

```

### Example: How do I use it with Django?

For a typical Django project, the `.env` file is placed like this:

```bash
my_project/
├── .env                 # Your environment variables
├── manage.py            # Django project entry point
├── my_project/          # Main application folder
│   ├── __init__.py
│   ├── settings.py      # Django settings file where .env is loaded
│   ├── urls.py
│   └── wsgi.py
└── apps/
    ├── app1/
    └── app2/
```

An example of Django settings

```python
import env
from unipath import Path

BASE_DIR = Path(__file__).parent


SECRET_KEY = env.SECRET_KEY
DEBUG = env.DEBUG or False
ALLOWED_HOSTS = env.ALLOWED_HOSTS.split(",")


DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": env.DJANGO_DB_NAME,
        "USER": env.DJANGO_DB_USERNAME,
        "PASSWORD": env.DJANGO_DB_PASSWORD,
        "PORT": env.DJANGO_DB_PORT or 5432,
        "HOST": env.DJANGO_DB_HOST or "localhost",
    }
}


EMAIL_HOST_PASSWORD = env.EMAIL_HOST_PASSWORD
EMAIL_HOST_USER = env.EMAIL_HOST_USER
EMAIL_PORT = env.EMAIL_PORT or 25
EMAIL_HOST = env.EMAIL_HOST or "localhost"
EMAIL_USE_TLS = env.EMAIL_USE_TLS or False

# ...
```

## Running Tests

To run the tests, make sure you have `pytest` installed. You can install it using `requirements.txt`:

```sh
pip install -r requirements.txt
```

Then run:

```sh
pytest
```

This command will discover and execute all test cases in the project.
For more advanced options, you can refer to the [pytest documentation](https://docs.pytest.org/en/stable/).
ABCParse 0.1.4
A better base class to automatically parse local args.
License: MIT
Requires Python: >=3.8.0

# ABCParse

![Python Tests](https://github.com/mvinyard/ABCParse/actions/workflows/python-tests.yml/badge.svg)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/ABCParse.svg)](https://pypi.python.org/pypi/ABCParse/)
[![PyPI version](https://badge.fury.io/py/ABCParse.svg)](https://badge.fury.io/py/ABCParse)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

A better base class that handles parsing local arguments.

```bash
pip install ABCParse
```

```python
from ABCParse import ABCParse


class SomeClass(ABCParse):
    def __init__(self, arg1, arg2):
      self.__parse__(kwargs=locals())
      
something = SomeClass(arg1 = 4, arg2 = "name")
```

## Logging

ABCParse includes a built-in logging system that provides visibility into the parsing process. You can configure the logging level, format, and output destination.

### Basic Usage

```python
from ABCParse import set_global_log_level, get_logger

# Set the global log level
set_global_log_level("debug")  # Options: debug, info, warning, error, critical

# Get a custom logger for your module
logger = get_logger(name="my_module")
logger.info("This is an info message")
logger.debug("This is a debug message")
```

### Advanced Configuration

```python
from ABCParse import get_logger

# Configure a logger with custom settings
logger = get_logger(
    name="my_custom_logger",
    level="debug",
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    date_format="%Y-%m-%d %H:%M:%S",
    file_path="logs/my_app.log",  # Optional: log to file
    propagate=False
)

# Log messages at different levels
logger.debug("Detailed information for debugging")
logger.info("General information about program execution")
logger.warning("Warning about potential issues")
logger.error("Error that occurred during execution")
logger.critical("Critical error that may cause program failure")

# Log dictionary data
config = {"param1": 42, "param2": "value", "enabled": True}
logger.log_dict(config, level="debug", prefix="Configuration")
```
gcs-logger 0.1.7
Logging tool for GameChange Solar projects
License: MIT
Requires Python: <4,>=3.10

# GCS Logger

This is a simple logger wrapped by a Color Handler to use across GCS projects.

## Installation

```bash
pip install gcs-logger
```
With poetry:

```bash
poetry add gcs-logger
```

## Usage

```python
from gcs_logger import get_gcs_logger

get_logger = get_gcs_logger(__name__, 'DEBUG')
```
parseflow 0.1.0
ParseFlow is a versatile Python library for extracting and structuring content from various document formats, including PDFs, Word documents, Excel files, images, and more. It provides a standardized JSON output, making it ideal for Retrieval-Augmented Generation (RAG), document processing, and data extraction workflows.
License: MIT
Requires Python: >=3.10

# parseflow
ParseFlow is a versatile Python library for extracting and structuring content from various document formats, including PDFs, Word documents, Excel files, images, and more. It provides a standardized JSON output, making it ideal for Retrieval-Augmented Generation (RAG), document processing, and data extraction workflows.