Skip to main content

JSON flat file database system

Project description

NoSQLite

A JSON based flat file NoSQL database.

Usage

from json-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 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.2.tar.gz (3.4 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.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: json-nosqlite-0.0.2.tar.gz
  • Upload date:
  • Size: 3.4 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.2.tar.gz
Algorithm Hash digest
SHA256 4907a4e38e93fd375a8ea4ce5187e790b9d2a01d8fb69f5dfa3c65039797246a
MD5 4f77aeb25540266f23fb5139ed8bac68
BLAKE2b-256 98d8641eeb76867dc17803d8ef07779f780ff597f2c0a571ec80df8115ab736a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: json_nosqlite-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9c373b97c9371c0f796c20ec654f64afcc5377d070b2ca5cc01a0a985ce28e6
MD5 01a51930bb8c22d701f61c12ea52347f
BLAKE2b-256 f47dd9a3e5ee9ab20a50392b0a49c7f5b0c05d6c36af59ce252a3ce1ffefc97d

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