Skip to main content

Cache and contain utilities.

Project description

pip3 install vessel

Cache Usage

import vessel

# basic
cache = vessel.Cache(2)
# all methods return tuples of entries affected
cache.create((0, 19), {'id': 0, 'age': 19, 'name': 'Hazel'} ) # hi
cache.create((0, 23), {'id': 0, 'age': 23, 'name': 'Baiy'}  ) # hi
cache.create((1, 21), {'id': 0, 'age': 21, 'name': 'George'}) # hi
cache.update((0, 23), {'name': 'Bailey'}                    ) # woops
cache.update((0,)   , {'school': '5th GL'}                  ) # new data
cache.delete((0, 19)                                        ) # bye hazel
cache.delete((0,)                                           ) # bye everyone

# simple
cache = vessel.DBCache(('id', 'age'))
# no need to specify keys
cache.create({'id': 0, 'age': 19, 'name': 'Hazel'} , None)
cache.create({'id': 0, 'age': 23, 'name': 'Baiy'}  , None)
cache.create({'id': 1, 'age': 31, 'name': 'George'}, None)
cache.update({'id': 0, 'age': 23, 'name': 'Bailey'}, None)
cache.update({'id': 0, 'school': '5th GL'}         , None)
cache.delete(None                                  , (0, 19))
cache.delete(None                                  , (0,))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for vessel, version 2.1.0
Filename, size File type Python version Upload date Hashes
Filename, size vessel-2.1.0-py3-none-any.whl (10.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size vessel-2.1.0.tar.gz (8.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page