Versatile Python package that brings powerful, C#-like collection and query capabilities to your projects.
Project description
Collective
Collective is a versatile Python package that brings powerful, C#-like collection and query capabilities to your projects. It provides intuitive, fluent interfaces for managing and transforming data collections with ease.
What's New?
The latest version of Collective includes:
- Modification Tracking: Each modifying operation increments the
modification_countattribute for precise operation auditing. - Expanded API: Additional methods for data transformations (
FlatMap,Distinct,Fuse, etc.). - Metadata Enrichment: The
Metadatamethod now includesModificationCount,LifetimeSeconds, and more insights.
Installation
pip install pz-collective
(Replace this with your actual installation command, e.g., if you’re hosting it on GitHub or PyPI)
Quick Example
from pz_collective import Collection, Queryable
# Create a collection
data = Collection(1, 2, 3, 4, 5)
# Use Collection methods
data.Add(6).Remove(3).Insert(0, 0).Sort().Reverse()
print(data.ToList()) # [6, 5, 4, 2, 1, 0]
# Metadata inspection
print(data.Metadata()) # includes 'ModificationCount' and more!
# Query with Queryable
result = Queryable(data).Where(lambda x: x % 2 == 0).Select(lambda x: x * 10).ToCollection()
print(result.ToList()) # [60, 40, 20, 0]
Features
✅ Add, remove, and manage items easily
✅ Track modifications (modification_count)
✅ Flexible slicing and index-based access
✅ LINQ-like querying with filtering, mapping, sorting
✅ Metadata insights (like type distribution, modification history)
✅ Advanced data manipulations (reduce, zip, flatten, etc.)
✅ Fluent, chainable interface for expressive data handling
License
MIT License
Let me know if you’d like to expand it further with badges, contributing guidelines, or examples of complex usage! 🚀
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 pz_collective-1.0.0.tar.gz.
File metadata
- Download URL: pz_collective-1.0.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01552f6dc6186a11b80f7ff82d7859a0afdeb56c9a115d04dd8163de36d7ef8b
|
|
| MD5 |
bb127e5f8ffa5af78b11c13d7e1b6c79
|
|
| BLAKE2b-256 |
7cfedccde76bfc850d95239824d334749ed467f1214cb6e18db1dfc7a0cae3d8
|
File details
Details for the file pz_collective-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pz_collective-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00710a545ab1ba7d2e1bb1d52be5dfd66d951f3708fe0c0f4cbab26e80abf060
|
|
| MD5 |
16d85ab61d39dddd6da6568261907e21
|
|
| BLAKE2b-256 |
165f7ef13547fae31c906a87b531f40a3f86efc5f3b7297af2e86ec6d6a5676f
|