Skip to main content

All rights are reserved to Name.

data

get a data
check if a data exist

get (select)

parameters : valueName(str), Category(optional(str))
if value is None value will return None

import namedb
print(f'Price : {namedb.get("price")}')

error handling
exemple :

import namedb
try:
  namedb.get('a world without taxes')
except namedb.ValueNotExist:
  print('Damn it')

Mutli-tasking select more then one thing using || to separate them
return a list of all of the arugments instanid of just the argument
exemple :

import namedb
thing = namedb.get('a life|| a world without taxes')
print(thing[0])
print(thing[1])

search (exist)

parameters : valueName(str), Category(optional(str))
if value exist it will return True (bool)
else False

import namedb
var = namedb.search('price')
if var:
  print('Give me your money!')

mutli-tasking separate differents ellement with ||
return True is all the values exist else it return False

import namedb
var = namedb.search('price||due')
if var:
  print('Give me your money!')

edit-data

add (aadd)

parameters : ValueName(str), Value(Any), Category(optional(str))
if worked it will return True else False

import namedb
namedb.add('price', 90)

error handling
exemple :

import namedb
try:
  namedb.add('taxes', 0.19)
except namedb.ValueAlreadyExist:
  print('Damn it')

edit (replace)

Big updates with edit

edit-value

parameters : valuename(str), value(any)

import namedb
namedb.edit('taxes', 'does not exist')

add to a number

parameters : valuename(str), add(int)

import namedb
namedb.edit('tomatostock', add=3)

minus to a number

parameters : valuename(str), minus(int)

import namedb
namedb.edit('tomatostock', minus=5)

append to a list

parameters : valuename(str), append(any)

import namedb
namedb.edit('product', append='tomato')

remove to a list

parameters : valuename(str), remove(any)

import namedb
namedb.edit('product', remove='tomato')

remove (delete)

parameters : ValueName(str), cache(optional(bool)), Category(optional(str))
if worked it will return True else False
stock the value in the cache if cache is true (false by default)

import namedb
namedb.remove('price')

error handling
exemple :

import namedb
try:
  namedb.remove('a world without taxes')
except namedb.ValueNotExist:
  print('Damn it')

mutli-tasking separate the values that you want to delete with ||

import namedb
namedb.remove('price||due')

json

just transfer json for now

transferjson (atransferjson)

parameters : Data(json), Category(optional(str))
if worked it will return True else False

import namedb
jsoncode = {
'price': 90,
'due': 60
}
namedb.transferjson(jsoncode)
print(f'{namedb.get("price")}')

prefix

find or edit data with a prefix

prefix (aprefix)

parameters : type(value or name), prefix(str), Category(optional(str))
return a list with all the files that starts with the prefix

import namedb
for costumer in namedb.prefix(type='value', 'costumersdue'):
  print(f'Due : {costumer}')

error handling
exemple :

import namedb
try:
  namedb.prefix('hi', 'taxes')
except ValueError:
  print('Damn it')

clearprefix (cleanprefix)

parameters : prefix(str), Category(optional(str))
delete all the values that starts with the prefix

import namedb
namedb.clearprefix('due')

cache

Restore data or remove data with a prefix or without

restore (arestore)

parameters : valuename(str), Category(optional(str))
restore a value from the cache (and return it)

import namedb
namedb.remove('taxes')
print('too good to be real')
namedb.restore('taxes')

error handling
exemple :

import namedb
try:
  namedb.restore('a world without taxes')
except namedb.ValueNotExist:
  print('Damn it')

clearcache (cleancache)

parameters : None clear the cache

import namedb
namedb.remove('money')
namedb.clearcache()

clearcacheprefix (cleancacheprefix)

parameters : prefix(str), Category(optional(str)) clear the cache with a prefix

import namedb
namedb.remove('exemple2286')
namedb.clearcacheprefix('exemple')

category

create a category or remove it
We highly recommend using category

createcat (acreatecat)

Parameters : categoryname(str)
Create a category

import namedb
namedb.createcat('example')

deletecat (adeletecat)

Parameters : categoryname(str)
Delete a category

import namedb
namedb.deletecat('example')

listcat (alistcat)

parameters : catname(str), type(str ["name", "value"])
list all values or name

import namedb
for value in namedb.listcat('stock', 'name'):
  print(value)

async

everything work the same just change the name of the fonction example :

import namedb
async def get_money(user_id: str):
  value = await namedb.select(f'money{user_id}')
  return value

setup

install setup.py and run it (answers the questions)

Directory path (example : C:/windows/desktop/my/project/) : C:/windows/Users/Me/Pycharm/project/

migrating from version 1.6

multi-tasking now exist
example:

import namedb
namedb.remove('taxes||bad things')

recommandation

Please use try: and except: if you run a constant code because this errors can make your code stop
We higly recommend using category



We aren't responsible for data lost.

bonus

This is one of the last versions of this database because I havte no ideas of what to do now except optimisation so don't expect big changes for the next versions it's probably be like backend optimisations
I will check to publish this as python package btw

Metadata

Release files for namedb 1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for namedb 1.7
File Size Uploaded
namedb-1.7.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for namedb 1.7
File Interpreter ABI Platform
namedb-1.7-py3-none-any.whl Python 3 none any Details

Total release size: 6.2 kB

Release files / namedb-1.7.tar.gz

Download URL namedb-1.7.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b398796b2b718d983ac2555477525915bc3e3bf8c6450665a58837e40de15b82
BLAKE2b-256 checksum
How to use checksums
c671e8d1a4ec6af12e7d20f65d0e6ebc39de422653ac486725bbc9261d5d226f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.12

Release files / namedb-1.7-py3-none-any.whl

Download URL namedb-1.7-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96df8f8ca06f4655e8fce197cb39dfd4b0dbc68dde73b9965a65960a518007a1
BLAKE2b-256 checksum
How to use checksums
c5b386743bc478373355be53c4ee791d2ab5c55b4afca642b47cb67651ccd9ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.12

Release history Release notifications | RSS feed

This release

1.7 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page