DictList2
DictList2 — это лёгкая Python-библиотека, расширяющая стандартный список для удобной работы с массивами словарей.
Возможности
- 📦
unique()— исключает дубликаты по всем полям; - 🔢
sort()— сортировка по одному или нескольким ключам; - 🎯
distinct()— уникальные значения по выбранным полям; - 🔍
filter()— фильтрация по условиям; - 🔄
gen_filter()— группировка с возможностью сортировки; - 🔗
join()/left_join()— объединения списков по ключу; - 🧮
group_by()— группировка с подсчётом суммы; - 📊
aggregate()— универсальная агрегация:sum,count,avg,min,max.
Установка
pip install dictlist2
Пример использования
from dictlist2 import DictList2
data = DictList2([
{"project": "A", "user": "Anna", "hours": 2},
{"project": "A", "user": "Ivan", "hours": 3},
{"project": "B", "user": "Anna", "hours": 4},
{"project": "A", "user": "Anna", "hours": 1},
])
# Группировка с агрегацией
result = data.aggregate(
group_columns="project",
aggregations={"hours": ["sum", "avg"], "user": "count"}
)
for row in result:
print(row)
Когда использовать DictList2?
- Обработка данных из баз данных или API.
- Построение отчётов без использования Pandas.
- Быстрая фильтрация, группировка и агрегация словарей.
Совместимость
- Python 3.10+
- Без внешних зависимостей
Лицензия
MIT License
Metadata
Release files for DictList2 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dictlist2-1.0.3.tar.gz | 13.6 kB | Without provenance | Details for dictlist2-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dictlist2-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for dictlist2-1.0.3-py3-none-any.whl |
Total release size: 22.1 kB
Release files / dictlist2-1.0.3.tar.gz
| Download URL | dictlist2-1.0.3.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8edd7fe985913260b2e5229a0a2233fc55783e771d42c0bd5cde8b1b09a0b6b9
|
|
BLAKE2b-256 checksum How to use checksums |
2adaa5d630d206262cb146ac7a1d9dc006297c3a8f73618c1d5336214e693665
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Release files / dictlist2-1.0.3-py3-none-any.whl
| Download URL | dictlist2-1.0.3-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd68fdaaa29e3428d9bfe6583defa892b5d42e7c55724a06633c74a3d616193f
|
|
BLAKE2b-256 checksum How to use checksums |
f519bcffedcee1f4426c122f87c4a6f7ac987e2cb13d14035a97b08f57e63585
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Security for DictList2 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.