Minimal Keys
Compute the minimal keys for a collection of strings or sequences. This is intended for use in presenting data in a user interface.
For example, the minimal keys of ["assignments/alice/hw1.txt", "assignments/bob/hw1.txt"] are ["alice", "bob"].
The minimal keys of ["alice/assignments/hw1.txt", "bob/assignments/hw1.txt"] are also ["alice", "bob"].
Finally, the minimal keys of ["assignments/alice.txt", "assignments/bob.txt"] are—wait for it—["alice", "bob"].
This is the same basic idea as a database superkey, except that the actual minimal unique keys are returned, instead of the attributes that select these keys.
The current implementation trims only the beginnings and ends of sequences, because this is all that I’ve needed so far. I have in my head a more sophisticated implementation that uses difflib, but it is too long to fit in the header of this README.
Install
$ pip install minimalkeys
Usage
>>> from minimalkeys import minimalkeys
>>> minimal_keys(["assignments/alice/hw1.txt", "assignments/bob/hw1.txt"])
['alice', 'bob']
License
MIT
Metadata
Release files for minimalkeys 0.1.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 |
|---|---|---|---|---|
| minimalkeys-0.1.0.tar.gz | 7.0 kB | Without provenance | Details for minimalkeys-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| minimalkeys-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for minimalkeys-0.1.0-py3-none-any.whl |
Total release size: 12.6 kB
Release files / minimalkeys-0.1.0.tar.gz
| Download URL | minimalkeys-0.1.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4db6acff83c61393ab1502f2d472e743b8524ec837f28f6b16c660de75abe730
|
|
BLAKE2b-256 checksum How to use checksums |
715905e32b2cf8804e65d59288bb0239738a9bc182aa620f1704e31ca3511987
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / minimalkeys-0.1.0-py3-none-any.whl
| Download URL | minimalkeys-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a154df20d4195bdae1d3d939fadeadc30f323d3b02d42ee54569eb58dbc5d72
|
|
BLAKE2b-256 checksum How to use checksums |
e0dbe7035fe83b0ffd50209489dd3dded5f63a309796be7acf0484b2ffefe907
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for minimalkeys 0.1.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.