semvec/pypi-packages huggingface dataset:
nwon_django_toolbox 0.6.28
Some Django Wizardry
License: MIT
Requires Python: <4.0,>=3.10

# NWON-Django-Toolbox

This package provides some Django additions that can be used across several projects.

## Settings

The Django Toolbox can be configured using the Django settings. We expect the key `NWON_DJANGO` that holds a dictionary. The dictionary must be of type `NWONDjangoSettings` that comes with this package (`nwon_django_toolbox.nwon_django_settings`). The keys mus be snake case or camel case.

For example like this

```python
NWON_DJANGO: NWONDjangoSettings = {
    "authorization_prefix": "Bearer",
    "logger_name": "your-log-name",
    "application_name": "application"
}
```

## Dependencies

The project has a bunch of dependencies that we use in most of our projects. In the end we have quite a lot and need to slim this down in the future.

Django related libraries are:

- Django (Obviously 🧠)
- django-polymorphic
- django-json-widget
- django-rest-polymorphic

For API documentation our models and serializer support two library which come as a dependency as well:

- drf-spectacular
- drf-yasg

On top we use a bunch of helper libraries

- Pydantic
- Pillow
- jsonref
- jsonschema-to-openapi
- pyhumps
- nwon-baseline

Package is meant for internal use at [NWON](https://nwon.de) as breaking changes may occur on version changes. This may change at some point but not for now 😇.

## Development Setup

We recommend developing using poetry.

This are the steps to setup the project with a local virtual environment:

1. Tell poetry to create dependencies in a `.venv` folder withing the project: `poetry config virtualenvs.in-project true`
2. Create a virtual environment using the local python version: `poetry env use $(cat .python-version)`
3. Install dependencies: `poetry install`

## Get ready to publish

You will need a token to publish packages. They can be obtained from here:
[https://pypi.org/manage/account/token/](PyPi Account)

Set the token locally using: `poetry config pypi-token.pypi pypi-XXXXXXXXXXXXXXXXXXXXXXXXXXXX`

## Publish Package

Test package publication

1. Add test PyPi repository: `poetry config repositories.testpypi https://test.pypi.org/legacy/`
2. Publish the package to the test repository: `poetry publish -r testpypi`
3. Test package: `pip install --index-url https://test.pypi.org/simple/ nwon_baseline`

If everything works fine publish the package via `poetry publish [patch|minor|major] --publish`.
configureout 2.3
A lightweight and flexible configuration loader for Python.
License: MIT
Requires Python: >=3.9
Keywords: configuration, loader

# Configureout
A lightweight and flexible configuration loader for Python. Supports loading configuration from dicts, JSON/JSONC strings, or files, with namespace-style access.

## Features
- Load config from dict, JSON string, or file
- Automatically converts nested structures to `Config`
- Modify, save, and update configurations easily
- Dictionary-style and attribute-style access

## Installation
You can install configureout via pip:
```bash
pip install configureout
```
Or just `configureout.py` in your project.

## Usage
```python
from configureout import Config

# Load from file
cfg = Config('config.json')
print(cfg.get('debug')) # True

# Or load from dict
cfg = Config({'debug': True, 'db': {'host': 'localhost', 'port': 8000}})
print(cfg.db.host) # localhost

# Or load from JSON string
cfg = Config('{"debug": true, "db": {"host": "localhost", "port": 8000}}')
print(cfg['db']['port']) # 8000
```

## Public Methods
```python
# Converts the internal namespace config to a standard Python dictionary.
to_dict()

# Saves the current configuration to a JSON file. (Attribute "config_path" is required for non-file configs or nested objects.)
save(config_path=None, **kwargs)

# Updates the configuration with new values (from dict or keyword args).
update(other=None, **kwargs) 

# Removes all nested elements from config.
clear()

# Returns a copy of the current configuration.
copy()

# Standard dictionary-style access methods.
keys() / values() / items() / get(key, default=None) / pop(key) / popitem()
```


## Magic Methods
```python
__getitem__(key) / __setitem__(key, value) # Enables dict-style access: cfg['key'].
__delitem__(key) # Deletes a config attribute.
__contains__(key) # Checks if key exists using 'key' in cfg.
__len__() # Returns the number of keys.
__iter__() # Enables iteration over keys.
__str__() # Returns a formatted JSON string of the config.
__repr__() # Developer-friendly representation of the config.
__bool__() # Returns False if the config is empty.
__eq__(other) # Compares config with another Config or dict.
__or__(other) / __ior__(other) # Merge configs using | and |= operators.
__reduce__() # Supports pickling.
```

## Restrictions
Attempting to override public methods will raise an error:
```python
cfg.update = "not allowed"  # Raises LockedMethodError
```

## Python Version
Python 3.9+ is required.

## License
MIT License