dict-sourcer
Build for PyPi
docker run --rm -v "$(pwd)":/ci quay.io/pypa/manylinux2014_x86_64 /ci/build.sh pypi_publish.sh
or
python setup.py sdist bdist_wheel
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=<password>
twine upload target/wheels/*
Notice
When upgrading version should be changes in:
- setup.py
- Cargo.toml
- pyproject.toml
Example use
from event_sourcer import reduce_dict
class SumReducer:
def init(self):
return 0
def update(self, acc, value):
return acc + value
def finalize(self, acc):
return acc
class AvgReducer:
def init(self):
return (0, 0) # (total, count)
def update(self, acc, value):
total, count = acc
return (total + value, count + 1)
def finalize(self, acc):
total, count = acc
return total / count if count else None
# Any object supporting __getitem__ will work; here we use dicts.
def generate_objects():
yield {"a": 1, "b": 4}
yield {"a": 1, "c": 4}
reducers = {
"a": SumReducer(),
"b": AvgReducer(),
"c": AvgReducer(),
"d": SumReducer(),
}
result = reduce_dict(generate_objects(), reducers)
print(result)
Metadata
Release files for dict-sourcer 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dict_sourcer-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details for dict_sourcer-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
Release files / dict_sourcer-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | dict_sourcer-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 261.8 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4f105cb2aeb846b464898ae887e3fee6cd26f8fc9781ed78fcb9d1e743c140b7
|
|
BLAKE2b-256 checksum How to use checksums |
e00afaefdb010de1849711c706ab9fa8fe852df712f2804649ecc2a1376a85ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Security for dict-sourcer 0.3.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.