Skip to main content

A simple nosql data base

Project description

nosqllite

A lite nosql database for python

Example

import nosqllite

db = nosqllite.Database.new("demo_db")

doc = db.add_document("users")

db["users"].data = [{"name":"Foo_1"},{"name":"Foo_2"}]

print(db["users"].data[-1]["name"])

db.save() 

print(doc.data)
print(db.documents)
for doc in db:
    print(doc.type_of())
    for d in doc:
        print(d)

db["users"].data.pop(-1)
print(db["users"].data)
db.save()

for more check out my experiments.

Install

nosqllite is on pypi

pip install nosqllite

Usage

There is only a few things you need to understand:

There is Database

import nosqllite

db = nosqllite.Database.new("demo_db")

# or if you have one already you can also 

db = nosqll.Database("demo_db")

# you can also add documents
db.save()

A nosql data base i made up of documets, this are json files.

doc = db.add_document("foo") # this have added a json file in the dir ./demo_db/foo.json

Then there is groups. Groups are just a dirs.

db.add_group("sub") # this adds a dir into ./demo_db/sub/ 
db["sub"].add_document("subdoc") # this have added a json file in the dir ./demo_db/sub/subdoc.json
db["sub"].add_group("subsub") # this adds a dir into ./demo_db/sub/subsub/ 
db["sub"]["subsub"].add_document("test")
db["sub"]["subsub"]["test"].data["some_key"] = "value"
db.save()

Build

git clone git@github.com:AxelGard/nosqllite.git
cd nosqllite
python3 -m venv env
source env/bin/activate
pip install -e .[dev]

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

nosqllite-0.1.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nosqllite-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nosqllite-0.1.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nosqllite-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fcc7cab51ffeac7e8c9817d2cd21cacb2acd6dcc32124d5bf85727d700fb8eb4
MD5 1a45c00968ae2c3563224c64cef4eaca
BLAKE2b-256 89b2373dc077c1b54b18b14b30a4af702801a135773d07a872738c37bffb219b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nosqllite-0.1.2.tar.gz:

Publisher: release.yml on AxelGard/nosqllite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: nosqllite-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nosqllite-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a28fb82d6f0be2a3593561578264b3a9a35c89aca37e07670edebf42237aa445
MD5 259c817a586f88ec1140b857589b3ee5
BLAKE2b-256 ba93f7066d6cfb7b4ddfa656c57343048670e7cb04307232aa55bcd258fc985b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nosqllite-0.1.2-py3-none-any.whl:

Publisher: release.yml on AxelGard/nosqllite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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