Base classes for mergeable entities
Project description
pleroma
πλήρωμα — Greek; Sum total.
Base classes for mergeable entities. Provides MergeableMixin for dataclasses and MergeableModel
for pydantic v2, with a composable last-non-None-wins merge strategy that can be customised at
any granularity.
Full documentation: https://pleroma.readthedocs.io
Installation
pip install pleroma
With pydantic v2 support:
pip install "pleroma[pydantic]"
Quick start
import dataclasses
from pleroma import MergeableMixin
@dataclasses.dataclass
class Config(MergeableMixin):
host: str | None = None
port: int | None = None
debug: bool | None = None
defaults = Config(host="localhost", port=8080, debug=False)
overrides = Config(port=9090)
result = Config.merge([defaults, overrides])
# Config(host='localhost', port=9090, debug=False)
License
MIT — see LICENSE.md.
Author
Jesús Alonso Abad
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pleroma-0.2.0.tar.gz.
File metadata
- Download URL: pleroma-0.2.0.tar.gz
- Upload date:
- Size: 732.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a96994c589b8f995e618e5467e0a811029baf5d3d012c4f7b27515af6aad4a36
|
|
| MD5 |
facb9246c37c44d9213d75548b8c1e4c
|
|
| BLAKE2b-256 |
249797c41baaad471da26acebd447556cf185f15fca37cda489a7e26feae8ad0
|
File details
Details for the file pleroma-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pleroma-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6309fb2048c4f4260f71884f9e65d9327b72e6d275c6fa9fe04f9ca51235b12f
|
|
| MD5 |
d94c946d68f3ddc2888d5b1fffb67adb
|
|
| BLAKE2b-256 |
45903e64eb4d8c6ff5e686c04f3078b08f931dc962ba07b9a579f9d3aa1af1ba
|