Skip to main content

Introduction

Islet is a pure python key-value file database. It allows for multiple serializers for both the keys and values. The API is designed to use all of the same python dictionary methods python programmers are used to in addition to the typical dbm methods.

Installation

Install via pip:

pip install islet

Or conda:

conda install -c mullenkamp islet

I’ll probably put it on conda-forge once I feel like it’s up to an appropriate standard…

Serialization

Both the keys and values stored in Islet must be bytes when written to disk. This is the default when “open” is called. Islet allows for various serializers to be used for taking input keys and values and converting them to bytes. The in-build serializers include pickle, str, json, and orjson (if orjson is installed). If you want to serialize to json, then it is highly recommended to use orjson as it is substantially faster than the standard json python module. The user can also pass custom serializers to the key_serializer and value_serializer parameters. These must have “dumps” and “loads” static methods. This allows the user to chain a serializer and a compressor together if desired.

Usage

The docstrings have a lot of info about the classes and methods. Files should be opened with the islet.open function. Read the docstrings of the open function for more details.

Write data

import islet

with islet.open('test.book', 'n', value_serializer='pickle', key_serializer='str') as db:
  db['test_key'] = ['one', 2, 'three', 4]

Read data

with islet.open('test.book', 'r') as db:
  test_data = db['test_key']

Notice that you don’t need to pass serializer parameters when reading. Islet stores this info on the initial file creation.

Recommendations

In most cases, the user should use python’s context manager “with” when reading and writing data. This will ensure data is properly written and (optionally) locks are released on the file. If the context manager is not used, then the user must be sure to run the db.sync() at the end of a series of writes to ensure the data has been fully written to disk. And as with other dbm style APIs, the db.close() must be run to close the file and release locks. MultiThreading is safe for multiple readers and writers, but only multiple readers are safe with MultiProcessing.

Benchmarks

Coming soon…

Metadata

Release files for islet 0.0.2

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

Source distribution (sdist)

Source distribution for islet 0.0.2
File Size Uploaded
islet-0.0.2.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for islet 0.0.2
File Interpreter ABI Platform
islet-0.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 33.5 kB

Release files / islet-0.0.2.tar.gz

Download URL islet-0.0.2.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9b3e957ccfc5774624c3917d8ff01ea5a840b8534f9170e8e1a4c90ea8681d2b
BLAKE2b-256 checksum
How to use checksums
0444965e84fe4960deb1f8a7ad43d383e5f9d1ae188db2498431c44af4393744
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.15

Release files / islet-0.0.2-py2.py3-none-any.whl

Download URL islet-0.0.2-py2.py3-none-any.whl
Size 15.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b4c07134ca510139eff5ad13f532c052c0169322ecc5e8c5a96173df2f55424e
BLAKE2b-256 checksum
How to use checksums
27e5d02020671e7ed527dbefc520f6eeece35ad4ec3fdea70b3e9eeacd4350a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.15
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