Skip to main content

No project description provided

Project description

nosqueel

A lightweight, file-based NoSQL key-value database designed for simple and practical uses. It requires no external dependencies and stores all data locally in a single file. Perfect for applications needing a straightforward and efficient storage solution.

pip install nosqueel

How it works

nosqueel uses sqlite3 as its engine, thereby benefiting from its power, integrity, and practicality. This looks strange but it works like a charm.

Usage

from nosqueel import NoSqueel

# initialize the database
db = NoSqueel('db.nosqueel') # or .db, or .anything, you choose

# insert a key-value pair
db.put('key1', 'value1')

# by default the .put method is unique safe, i.e. it raises an error
# if the key already exists. if you don't want that behavior you can
# use replace_if_exists=True.
db.put('key1', 'value1', replace_if_exists=True)

# retrieve a value by key
value = db.get('key1')
print(value)  # output: 'value1'
# note: the get method returns None for non-existing keys

# update a value
db.update('key1', 123)
updated_value = db.get('key1')
print(updated_value)  # output: 123

# delete a key-value pair
db.delete('key1')

# search for keys by value
db.put('key2', 'common_value')
db.put('key3', 'common_value')
keys = db.search('common_value')
print(keys)  # output: ['key2', 'key3']

# retrieve all keys
all_keys = db.keys()
print(all_keys)  # output: ['key2', 'key3']

Nosqueel uses pickle to serialize data (keys and values). This means you are free to use any python type that can be serialized using pickle for both keys and values.

Roadmap

  • tables
  • begin immediate transaction (for better locking)
  • clean code/make it more efficient

Project details


Download files

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

Source Distribution

keyv-0.1.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

keyv-0.1.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file keyv-0.1.2.tar.gz.

File metadata

  • Download URL: keyv-0.1.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Windows/10

File hashes

Hashes for keyv-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1a43200bd28c7bacbcdf057d866b27820976bf459d714fd98fc2972fa38a0f08
MD5 b3e8345cf4a8a7ee376f2b3b9936ca1f
BLAKE2b-256 ad944dae7d0245821e14c6d54ba57fb9f3490f4d55e3fca1eac1d7dc485875bd

See more details on using hashes here.

File details

Details for the file keyv-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: keyv-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Windows/10

File hashes

Hashes for keyv-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1c230f0f19f6b4ddd218bbc76414b548910b3eaebf0e0ad3a076b8cc5131fd18
MD5 e41b9b5e6a49b805d91931d648cc83d0
BLAKE2b-256 419166695f29905c594266cd059d9fee29fe8cc07c88af987d938effa76e05b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page