Skip to main content

SQL Pickle

SQL Pickle is a simple key-value store that uses SQLite to store pickled objects.

from sqlpickle import KeyValueStore
store = KeyValueStore('test.db')

store['test'] = 1
print(store['test']) 
# 1

store['very_complex_object'] = {'a': 1, 'b': 2}

Memoization

from sqlpickle import memoize, KeyValueStore

@memoize(KeyValueStore('test.db'))
def expensive_function(x):
    return x**2

expensive_function(2) # 4
expensive_function(2) # 4

Other features

'key' in store # True
store.keys() # ['key1', 'key2']
store.items() # [('key1', 1), ('key2', 2)]
store.get('key1') # 1
store.get('key2') # 2
store.get('key3') # KeyError
len(store) # 2
store.random_keys(2) # ['key1', 'key2']

Release files for sqlpickle 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlpickle 0.1.3
File Size Uploaded
sqlpickle-0.1.3.tar.gz 1.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlpickle 0.1.3
File Interpreter ABI Platform
sqlpickle-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 4.0 kB

Release files / sqlpickle-0.1.3.tar.gz

Download URL sqlpickle-0.1.3.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e745ed4213b6993a4e0da9327fe6d904745b66f4cbddce7ebf132e22a7b1629
BLAKE2b-256 checksum
How to use checksums
d5e683478579e06acbad88e863b4bc22f4a3a90096723941544f022b0594c7c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Darwin/23.6.0

Release files / sqlpickle-0.1.3-py3-none-any.whl

Download URL sqlpickle-0.1.3-py3-none-any.whl
Size 2.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3cea6e4ddb8eb5641d6453f5c936db090ac6ebc4b57a6e3110acee34ebadd66
BLAKE2b-256 checksum
How to use checksums
f3743b0f68d7a46405c9aee50473e5345d3887bc7fe37fe992c7ebd25c188ff0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page