pluckit
Extract values from collection items.
Install
pip install pluckit
Usage
from pluckit import pluck
data = [
{'x': 1, 'y': 2},
{'x': 2, 'y': 4},
{'x': 3, 'y': 6},
]
pluck(data, 'x')
> [1, 2, 3]
# supports arbitrarily deep plucks and function calls
people = [
{ 'name': 'Daniel', 'friends': [ 'Josh', 'Mel' ] },
{ 'name': 'Mel', 'friends': [ 'Daniel', 'Suzy' ] },
]
pluck(people, 'friends[-1].lower[:3]')
> [ 'mel', 'suz' ]
# use Pluckables for built-in functionality
from pluckit.pluckable import PluckableList
PluckableList([
{'x': 1, 'y': 2},
{'x': 2, 'y': 4},
{'x': 3, 'y': 6},
]).pluck('x')
> [1, 2, 3]
# use the Pluckable mixin to build your own
from pluckit import Pluckable
class MyDict(dict, Pluckable): pass
MyDict({
'home' : {'x' : 1, 'y' : 2},
'work' : {'x' : 3, 'y' : 6},
}).pluck('x')
> {'home' : 1, 'work' : 3}
Metadata
Release files for pluckit 0.6.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 |
|---|---|---|---|---|
| pluckit-0.6.0.tar.gz | 5.5 kB | Without provenance | Details for pluckit-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pluckit-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for pluckit-0.6.0-py3-none-any.whl |
Total release size: 10.8 kB
Release files / pluckit-0.6.0.tar.gz
| Download URL | pluckit-0.6.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
975148f31de6d38bdc9e1022821e8834e817860035a4c2b6a0b899b2865258c6
|
|
BLAKE2b-256 checksum How to use checksums |
3b50476771bba6afa872b8d42073a74f46a667a25266e1ee5f004f9c92c9a23b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / pluckit-0.6.0-py3-none-any.whl
| Download URL | pluckit-0.6.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
188d97c801d3cb82c4c6b56b1bca879c42cd404080f97e8e6a1c4acb57e93b8b
|
|
BLAKE2b-256 checksum How to use checksums |
61b797fb8cad75ed15bd7d68ce36820d85905add71a499774fb552fa87b4fbb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Security for pluckit 0.6.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.