Skip to main content

A package to make database usage easier

Project description

EliteD

EliteD is a package to make database usage easier! Create database easily and read and update them.

Installing

To install the package you just need to execute the following in your command line:

pip3 install EliteD

Using the package

This is how you create and setup a Database

import EliteD #importing the package
database = EliteD.create_database(name="user.db", path="/path/to/db")
database.create_table(name="test", columns=[{"type": int, "name": "test"}]) 

The second line would create the database "user.db" at the given path The last line creates the table "test" in the database with the column "test" with integer as values. You can add as many columns as you want

If you already have a database, you can open the database like this:

import EliteD #import the module
database = EliteD.Database("/path/to/db") #Opens the database

If you need to delete a created table, you can do it like this:

import EliteD
database = EliteD.Database(path="/path/to/db")
database.delete_table("name of the table")

Writing values in a database

To add new values, you can use the insert_value method:

import EliteD
database = EliteD.Database(path="/path/to/db")
database.insert_value(table="test", values=("001", "bread"))

This would insert the values 001 and bread in the table test.

Reading, deleting and changing values of a database

To read a value of a database, you can use the read_value method:

import EliteD
database = EliteD.Database(path="/path/to/db")
read = database.read_value(table="test", values=["test"], conditions={"test": 0})
print(read)

values is the row you want to read from the table. You can give multiple values. To read out all values, you can use the EliteD.AllValues() class. Conditions can be specified when you only want to read out the values when a row (test in this case) has the specified value (0 in this case).

To delete database values you can use the delete_value method:

import EliteD
database = EliteD.Database(path="/path/to/db")
database.delete_value(table="test", row="trees", new_value=2, conditions={"floof": 1})

This would delete every value of the row trees from the table test if the value of floof is 1

To change database values, you can use update_value method:

import EliteD
database = EliteD.Database(path="/path/to/db")
database.update_value(table="test", row="roaw", new_value=2, conditions={"roawaaa": 1})

This would change every value of the row roaw from the table test to 2 if the value of roawaaa is 1

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

EliteD-1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

EliteD-1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file EliteD-1.1.tar.gz.

File metadata

  • Download URL: EliteD-1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for EliteD-1.1.tar.gz
Algorithm Hash digest
SHA256 418cd2473cb3d54cf726ac182e2ef04d64f393b3f15dc6c9651ed7dccb55325e
MD5 307009d4a55f9a35870b3f5bd26da313
BLAKE2b-256 fe69d50869edd2bd87fc3b81b99efe73e03760713b6f9c1335c11cd5918614d0

See more details on using hashes here.

File details

Details for the file EliteD-1.1-py3-none-any.whl.

File metadata

  • Download URL: EliteD-1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for EliteD-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3669b4580d1f572a4bda5904a21039514bf50a7e0cac8cc7ac65ab2429bb57ad
MD5 4f97dd910664e0cebf55a3ea868f74b2
BLAKE2b-256 c295c2d4669283a4d15701a4ef03ac5f0331770791cde49a908cb47223a0eaa0

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