Skip to main content

JSON flat file database system

Project description

NoSQLite

A JSON based flat file NoSQL database.

Usage

from nosqlite.nosqlite import NoSQLite

ns = NoSQLite('file.json')

# Create a new table
ns.create_table('users')

# Insert a new record into the table
ns.insert({'username':'blah', 'password':'blah'}, 'users')

# Find a record in a table
ns.find({'username':'blah'}, 'users')

# Update a record in a table
ns.update({'username':'blah'}, {'username':'changed', 'password':'changed'}, 'users')

# Delete a record from a table
ns.delete({'username':'blah', 'password':'blah'}, 'users')

Documentation

# filename: name of local file/path to json data file
class NoSQLite(filename)
  
  # reload the json file (used by the class to update the jsonData after writing)
  reload()
  
  # write json data to file and reload
  writeOut()
  
  # creates a new table in the json data
  # tableName: name of table to be created
  create_table(tableName)
  
  # inserts data into table
  # data: json data to be inserted
  # table: name of table to insert into
  insert(data, table)
  
  # deletes data from table, deletes first found
  # data: json data to search table for
  # table: table to search and delete from
  delete(data, table)

  # deletes data from table, deletes all found
  # data: json data to search table for
  # table: table to search and delete from
  deleteMany(data, table)
  
  # updates data in table with newData, updates first found
  # data: json data to search table for
  # newData: new json data to change record to
  # table: table to search and update from
  update(data, newData, table)

  # updates data in table with newData, updates all found
  # data: json data to search table for
  # newData: new json data to change record to
  # table: table to search and update from
  updateMany(data, newData, table)

  # find all data in table
  # table: table to search
  findAll(table)

  # find data in table, returns all matching records
  # data: json data to search table for
  # table: table to search
  find(data, table)

  # find data in table, returns first matching record
  # data: json data to search table for
  # table: table to search
  findOne(data, table)

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

json-nosqlite-0.0.5.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

json_nosqlite-0.0.5-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file json-nosqlite-0.0.5.tar.gz.

File metadata

  • Download URL: json-nosqlite-0.0.5.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for json-nosqlite-0.0.5.tar.gz
Algorithm Hash digest
SHA256 ac1bc7c4486191439e564cd48b514c8f9c5b4db7e09f7e5a810b47b886cd47b9
MD5 9dce02054935d65fad6a251768d00a68
BLAKE2b-256 3bd6cc7648388f479fdf942f6c5ffa4aefcc3068596485d4a0613f488edd2f3b

See more details on using hashes here.

File details

Details for the file json_nosqlite-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: json_nosqlite-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for json_nosqlite-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 48df66dda4a1bea52c3e490a2edd864d3440e3daa3088b0386cc2a43da538883
MD5 a4730290c0abede750b16eb9201db6b8
BLAKE2b-256 7063328c9c658ef62e93d355a9b018ae28d27e4a575c3ac1d1eaef6886bce2bb

See more details on using hashes here.

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