Oh-My-PickleDB is an open source key-value store using Python's json module.

Overview

logo

OH-MY-PICKLEDB

GitHub status GitHub issues GitHub pull requests GitHub license GitHub last commit


oh-my-pickleDB is a lightweight, fast, and intuitive data manager written in python

📝 Table of Contents

🧐 About

oh-my-pickleDB is an improved version of PickleDB, with notable differences compared to the original. Most important differences are:

  • Cryptographic utils - Encrypt/Decrypt data content using FERNET symmetric encryption
  • Code improvements - More readable documentation, improved code, etc...
  • Data conversions - Byte, json, or str conversions
  • More flexibility - Save/load data as bytes, json or str, you decide!
  • Utilities - Export data as XML

🏁 Getting Started

Prerequisites

python~=3.9
cryptography~=3.4.8
setuptools~=58.1.0
fire~=0.4.0

Installing

# Using python pip
$ pip install oh-my-pickledb

# Using git
$ git clone https://github.com/tory1103/oh-my-pickledb.git
$ cd oh-my-pickledb
$ pip install -r requirements.txt
$ python setup.py install

🔧 Running the tests

Tests are found on tests folder.
In future versions, tests will be added inside code documentation as multi-row comments.

Break down into end to end tests

cd /tests
python3 <test_name>.py

🎈 Usage

from my_pickledb import PickleDB

database = PickleDB("test.json")  # PickleDB object

database.set('key', 'value')  # Creates new key and value
database.get('key')  # Must return 'value'
database.save.as_json()  # Must save database to file on specified path

🚀 Deployment

oh-my-pickleDB is a python library, when installed, just import it to your project.

import my_pickledb
from my_pickledb import *

⛏️ Built Using

  • Python
  • Json
  • Data Structures

✍️ Authors

See also the list of contributors who participated in this project.

🎉 Acknowledgements

Useful links

You might also like...
Oh-My-PickleDB is an open source key-value store using Python's json module.
Oh-My-PickleDB is an open source key-value store using Python's json module.

OH-MY-PICKLEDB oh-my-pickleDB is a lightweight, fast, and intuitive data manager written in python 📝 Table of Contents About Getting Started Deployme

A Simple Key-Value Data-store written in Python

mercury-db This is a File Based Key-Value Datastore that supports basic CRUD (Create, Read, Update, Delete) operations developed using Python. The dat

K2HASH Python library - NoSQL Key Value Store(KVS) library
K2HASH Python library - NoSQL Key Value Store(KVS) library

k2hash_python Overview k2hash_python is an official python driver for k2hash. Install Firstly you must install the k2hash shared library: curl -o- htt

CaskDB is a disk-based, embedded, persistent, key-value store based on the Riak's bitcask paper, written in Python.
CaskDB is a disk-based, embedded, persistent, key-value store based on the Riak's bitcask paper, written in Python.

CaskDB - Disk based Log Structured Hash Table Store CaskDB is a disk-based, embedded, persistent, key-value store based on the Riak's bitcask paper, w

A simple, transparent, open-source key logger, written in Python, for tracking your own key-usage statistics.
A simple, transparent, open-source key logger, written in Python, for tracking your own key-usage statistics.

A simple, transparent, open-source key logger, written in Python, for tracking your own key-usage statistics, originally intended for keyboard layout optimization.

Random JSON Key:Pair Json Generator

Random JSON Key:Value Pair Generator This simple script take an engish dictionary of words and and makes random key value pairs. The dictionary has ap

AWS Tags As A Database is a Python library using AWS Tags as a Key-Value database.

AWS Tags As A Database is a Python library using AWS Tags as a Key-Value database. This database is completely free* 💸

🐍 A hyper-fast Python module for reading/writing JSON data using Rust's serde-json.
🐍 A hyper-fast Python module for reading/writing JSON data using Rust's serde-json.

A hyper-fast, safe Python module to read and write JSON data. Works as a drop-in replacement for Python's built-in json module. This is alpha software

Key Logger - Key Logger using Python

Key_Logger Key Logger using Python This is the basic Keylogger that i have made

Segcache: a memory-efficient and scalable in-memory key-value cache for small objects

Segcache: a memory-efficient and scalable in-memory key-value cache for small objects This repo contains the code of Segcache described in the followi

This is a package that allows you to create a key-value vault for storing variables in a global context

This is a package that allows you to create a key-value vault for storing variables in a global context. It allows you to set up a keyring with pre-defined constants which act as keys for the vault. These constants are then what is stored inside the vault. A key is just a string, but the value that the key is mapped to can be assigned to any type of object in Python. If the object is serializable (like a list or a dict), it can also be writen to a JSON file You can then use a decorator to annotate functions that you want to have use this vault to either store return variables in or to extract variables to be used as input for the function.

A simple API that will return a key-value pair of randomly generated UUID
A simple API that will return a key-value pair of randomly generated UUID

A simple API that will return a key-value pair of randomly generated UUID. Key will be a timestamp and value will be UUID. While the server is running, whenever the API is called, it should return all the previous UUIDs ever generated by the API alongside a new UUID.

UUID_ApiGenerator - This an API that will return a key-value pair of randomly generated UUID

This an API that will return a key-value pair of randomly generated UUID. Key will be a timestamp and value will be UUID. While the

Import some key/value data to Prometheus custom-built Node Exporter in Python
Import some key/value data to Prometheus custom-built Node Exporter in Python

About the app In one particilar project, i had to import some key/value data to Prometheus. So i have decided to create my custom-built Node Exporter

PyCache - simple key:value server written with Python

PyCache simple key:value server written with Python and client is here run server python -m pycache.server or from pycache.server import start_server

Viperdb - A tiny log-structured key-value database written in pure Python

ViperDB 🐍 ViperDB is a lightweight embedded key-value store written in pure Pyt

Json utils is a python module that you can use when working with json files.

Json-utils Json utils is a python module that you can use when working with json files. it comes packed with a lot of featrues Features Converting jso

Key Cast - Cast your key presses and mouse clicks on the screen, while casting your favorite application on the screen. Better than the rest.
Key Cast - Cast your key presses and mouse clicks on the screen, while casting your favorite application on the screen. Better than the rest.

Key Cast Screen cast your keyboard and mouse clicks in style Project Homepage » View Demo · Report Bug · Request Feature Table of Contents Introductio

A program will generate a eth key pair that has the public key that starts with a defined amount of 0

ETHAdressGenerator This short program will generate a eth key pair that has the public key that starts with a defined amount of 0 Requirements Python

Comments
  • .append method wont work as meant ( v0.2 or lower )

    .append method wont work as meant ( v0.2 or lower )

    Describe the bug Append method wont append to list as meant, it will infinite list loop

    To Reproduce database.set("test", "s") database.append("test", "ss")

    Meant response: ["s", "ss"] Actual response: [["s"], "ss"]

    Desktop:

    • OS: Windows
    • Version <=0.2
    bug 
    opened by tory1103 1
  • List merge

    List merge

    When I need to merge multiple lists, it's a complete hassle. I would like a function inside PickleDB that makes this automatic.

    Combination List Code Example:

    list1 = [1, 2, 3]
    list2 = [4, 5, 6]
    
    list3 = Fuse(list1, list2) # [1, 2, 3, 4, 5, 6]
    
    list1.merge(list2) #  [1, 2, 3, 4, 5, 6]
    

    It will be an method of PickleDB List object

    enhancement 
    opened by tory1103 0
  • Bump cryptography from 3.1.1 to 3.3.2

    Bump cryptography from 3.1.1 to 3.3.2

    Bumps cryptography from 3.1.1 to 3.3.2.

    Changelog

    Sourced from cryptography's changelog.

    3.3.2 - 2021-02-07

    
    * **SECURITY ISSUE:** Fixed a bug where certain sequences of ``update()`` calls
      when symmetrically encrypting very large payloads (>2GB) could result in an
      integer overflow, leading to buffer overflows. *CVE-2020-36242* **Update:**
      This fix is a workaround for *CVE-2021-23840* in OpenSSL, fixed in OpenSSL
      1.1.1j.
    

    .. _v3-3-1:

    3.3.1 - 2020-12-09

    • Re-added a legacy symbol causing problems for older pyOpenSSL users.

    .. _v3-3:

    3.3 - 2020-12-08

    
    * **BACKWARDS INCOMPATIBLE:** Support for Python 3.5 has been removed due to
      low usage and maintenance burden.
    * **BACKWARDS INCOMPATIBLE:** The
      :class:`~cryptography.hazmat.primitives.ciphers.modes.GCM` and
      :class:`~cryptography.hazmat.primitives.ciphers.aead.AESGCM` now require
      64-bit to 1024-bit (8 byte to 128 byte) initialization vectors. This change
      is to conform with an upcoming OpenSSL release that will no longer support
      sizes outside this window.
    * **BACKWARDS INCOMPATIBLE:** When deserializing asymmetric keys we now
      raise ``ValueError`` rather than ``UnsupportedAlgorithm`` when an
      unsupported cipher is used. This change is to conform with an upcoming
      OpenSSL release that will no longer distinguish between error types.
    * **BACKWARDS INCOMPATIBLE:** We no longer allow loading of finite field
      Diffie-Hellman parameters of less than 512 bits in length. This change is to
      conform with an upcoming OpenSSL release that no longer supports smaller
      sizes. These keys were already wildly insecure and should not have been used
      in any application outside of testing.
    * Updated Windows, macOS, and ``manylinux`` wheels to be compiled with
      OpenSSL 1.1.1i.
    * Python 2 support is deprecated in ``cryptography``. This is the last release
      that will support Python 2.
    * Added the
      :meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey.recover_data_from_signature`
      function to
      :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey`
      for recovering the signed data from an RSA signature.
    

    .. _v3-2-1:

    </tr></table>

    ... (truncated)

    Commits
    • 82b6ce2 correct buffer overflows cause by integer overflow in openssl (#5747)
    • 1ff0d50 re-add Cryptography_HAS_TLSEXT_HOSTNAME and bump for 3.3.1 (#5625)
    • 7e8fff7 Prepare for 3.3 release (#5603)
    • b5278c9 Fixed DH tests for latest CentOS FIPS OpenSSL (#5604)
    • 6693d55 Add support for RSA signature recovery (#5573)
    • 8686d52 Document that PKCS1v1.5 is not constant time (#5600)
    • 1be144a bump cffi minimum version to help out pyopenssl (#5598)
    • 96f2d96 remove legacy debugging code from setup.py (#5597)
    • 2660f93 Document that Firefox doesn't support unencrypted pkcs12 (#5596)
    • a209669 Added tls bindings for new OpenSSL APIs (#5595)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • get returning None

    get returning None

    Bug Description: I wrote a very simple test program to learn to use this module. I have two functions: store() and retrieve()

    The store function works fine and is able to store and save the data passed to it to a .db file.

    My retrieve function is very simple and straight forward. This function is returning None instead of the value stored. At this point I don't know if it's a me problem, or a bug.

    I'm on Windows 11 (sadly), and I'm using python version 3.11.1

    my import:

    from my_pickledb import PickleDB as pickledb
    

    The store function:

    @classmethod
        def store(cls, key: str, img_as_text: str):
            db = pickledb('test.db')
            db.set(key, img_as_text)
            db.save.as_json()
    

    The retrieve function:

    @classmethod
        def retrieve(cls, key: str) -> str:
            db = pickledb('test.db')
            return db.get(key)
    
    question 
    opened by CodeCanna 1
Owner
Adrián Toral
self-learning student interested in improving coding skills and keep learning about technology
Adrián Toral
AWS Tags As A Database is a Python library using AWS Tags as a Key-Value database.

AWS Tags As A Database is a Python library using AWS Tags as a Key-Value database. This database is completely free* ??

Oren Leung 42 Nov 25, 2022
LightDB is a lightweight JSON Database for Python

LightDB What is this? LightDB is a lightweight JSON Database for Python that allows you to quickly and easily write data to a file Installing pip3 ins

Stanislaw 14 Oct 1, 2022
A Simple , ☁️ Lightweight , 💪 Efficent JSON based database for 🐍 Python.

A Simple, Lightweight, Efficent JSON based DataBase for Python The current stable version is v1.6.1 pip install pysondb==1.6.1 Support the project her

PysonDB 282 Jan 7, 2023
securedb is a fast and lightweight Python framework to easily interact with JSON-based encrypted databases.

securedb securedb is a Python framework that lets you work with encrypted JSON databases. Features: newkey() to generate an encryption key write(key,

Filippo Romani 2 Nov 23, 2022
Tiny local JSON database for Python.

Pylowdb Simple to use local JSON database ?? # This is pure python, not specific to pylowdb ;) db.data['posts'] = ({ 'id': 1, 'title': 'pylowdb is awe

Hussein Sarea 3 Jan 26, 2022
ClutterDB - Extremely simple JSON database made for infrequent changes which behaves like a dict

extremely simple JSON database made for infrequent changes which behaves like a dict this was made for ClutterBot

Clutter Development 1 Jan 12, 2022
Shelf DB is a tiny document database for Python to stores documents or JSON-like data

Shelf DB Introduction Shelf DB is a tiny document database for Python to stores documents or JSON-like data. Get it $ pip install shelfdb shelfquery S

Um Nontasuwan 35 Nov 3, 2022
Simpledb-py: Simple JSON database

Simpledb-py: Simple JSON database

тейлс 2 Feb 9, 2022
Simple json type database for python3

What it is? Simple json type database for python3! What about speed? The speed is great! All data is stored in RAM until saved. How to install? pip in

null 3 Feb 11, 2022
Tools for analyzing Git history using SQLite

git-history Tools for analyzing Git history using SQLite Installation Install this tool using pip: $ pip install git-history Usage This tool can be r

Simon Willison 128 Jan 2, 2023