SQList is like shelve but for lists. It serializes data with pickle and puts into SQLite database.
Usage
SQList object behaves mostly like casual Python list. For example you can create SQList from list.
>>> import sqlist >>> values = sqlist.SQList([1, 2, 3]) >>> values sqlist.SQList([1, 2, 3])
You can get item from list by index.
>>> values[0] 1 >>> values[-1] 3
Slices are available too.
>>> values[0:2] [1, 2]
You can easily append item to SQList and pop them from it.
>>> values.append(23) >>> values sqlist.SQList([1, 2, 3, 23]) >>> valuea.pop(0) 1 >>> values sqlist.SQList([2, 3, 23])
Unfortunately inserting is not available yet but planned for future versions.
Sorting
You can easily sort SQList just in place, but be careful, this sorting can be quite long.
>>> values.sort(key=lambda x: 1 / x) >>> values sqlist.SQList([23, 3, 2]) >>> values.sort() >>> values sqlist.SQList([2, 3, 23])
Also there is a way to keep your SQList permanently sorted.
>>> values = sqlist.SQList(['a', 'aa', 'aaaa'], key=lambda x: len('x'))
>>> values
sqlist.SQList(['a', 'aa', 'aaaa'], key=lambda x: len('x'))
>>> values.append('bbb')
>>> values
sqlist.SQList(['a', 'aa', 'bbb', 'aaaa'], key=lambda x: len('x'))
This way is a bit ugly but it was designed for high performance.
Multithreading
At the moment SQList is not thread safe, may be it will become so later.
Metadata
Release files for sqlist 0.2.2
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 |
|---|---|---|---|---|
| sqlist-0.2.2.tar.gz | 5.5 kB | Without provenance | Details for sqlist-0.2.2.tar.gz |
Release files / sqlist-0.2.2.tar.gz
| Download URL | sqlist-0.2.2.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ba428c51378a7f449d979fc80abb52bd5273bc7217218fdf3324a0e94dd0217
|
|
BLAKE2b-256 checksum How to use checksums |
7e2f980ea2a93cfb5498013623a0058c2e70c13d86d2d618c103d95b9f2a1e29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for sqlist 0.2.2
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.