pyrecords
Read records (list[dict]) from Excel or JSON, then order, filter and group them. Extracted
from templify so other CLIs can share it.
uv add pyrecords
from pathlib import Path
from pyrecords import OrderByKey, filter_data, get_compiler, group_by_data, order_by_data, readers
data = readers["xlsx"](Path("people.xlsx")) # first row = column names
data = order_by_data(data, [OrderByKey("city"), OrderByKey("-age")]) # "-" = descending
data = filter_data(data, get_compiler(), {"name": "int__gt", "args": ["age", "30"]})
groups = group_by_data(data, ["city"]) # [{"city": "Homs", "items": [...]}, ...]
| Module | What it does |
|---|---|
readers |
readers (xlsx, json → list of records) and object_readers (json → one record), picked by extension |
transformers |
order_by_data (via pyordering; empty values last), filter_data, group_by_data |
filter_rules |
rules: a pyspecification registry of int__gt, string__icontains, date__ge, ... and get_compiler() for all / any filter schemas |
Add a reader for another extension:
@readers.reader("csv")
def read_csv(filepath: Path) -> Data: ...
Metadata
Release files for pyrecords 0.2.0
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 |
|---|---|---|---|---|
| pyrecords-0.2.0.tar.gz | 20.2 kB | Without provenance | Details for pyrecords-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyrecords-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for pyrecords-0.2.0-py3-none-any.whl |
Total release size: 40.4 kB
Release files / pyrecords-0.2.0.tar.gz
| Download URL | pyrecords-0.2.0.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0f98a262e73dd6b441e65f9c58accc800b65dcc8a98ac615e0ecaef39cdfe35
|
|
BLAKE2b-256 checksum How to use checksums |
2d28a50dd944069e5267361d9e9ccb62a860db8354bfed3adf34b0bf3c85f84a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / pyrecords-0.2.0-py3-none-any.whl
| Download URL | pyrecords-0.2.0-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
263d6a289ed70cb2bb5b417b181c77c9a060adb1b345c5b46fe25a5c7a17d12c
|
|
BLAKE2b-256 checksum How to use checksums |
537ec83af55b7accb0f5f9bc16a45a4ee916730e416ae9b245aa46fd22c7c1e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for pyrecords 0.2.0
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.