An simple database for your projects.
Project description
ASD DATABASE
A simple database for your projects.
Install
pip install asd-database
Usage
Here's a quick example to get you started:
from asd_database import ASDDatabase
# Create a new database
db = ASDDatabase('my_database')
# Create a table with columns 'id', 'name', and 'email'
db.create_table('users', ['id', 'name', 'email'])
# Insert data into the table
db.insertdata([1, 'Mario Rossi', 'mario@example.com'], 'users')
db.insertdata([2, 'Luca Bianchi', 'luca@example.com'], 'users')
# Read the second row (header is row 0)
print(db.read('users', 2))
File Structure
Each table is stored in a .asd file inside the database directory. The first row contains the column headers, and each subsequent row represents a data entry.
Example users.asd file:
id|name|email
1|Mario Rossi|mario@example.com
2|Luca Bianchi|luca@example.com
API Reference
ASDDatabase(db_name)
Creates or opens a database directory.
create_table(table_name, columns)
Creates a new table with the specified columns.
Parameters:
table_name(str): The name of the table.columns(list): A list of column names.
insertdata(data, table_name)
Inserts a row of data into the specified table.
Parameters:
data(list): A list of values corresponding to the table columns.table_name(str): The name of the table.
read(table_name, row)
Reads a specific row from the specified table.
Parameters:
table_name(str): The name of the table.row(int): The row number to read (header is row 0).
Returns:
- A list of values from the specified row.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asd_database-1.0.0.tar.gz.
File metadata
- Download URL: asd_database-1.0.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
041aca1d98bef36a935c336c45c2ffbe5f903a0ec2f27388e5b3954c5a03fb57
|
|
| MD5 |
518e097bc04a0e4df671434e545ac1b4
|
|
| BLAKE2b-256 |
f15478575b9eecc8f86d13fc6a413039290d2729952ea36a7e6f36263cee1f0a
|
File details
Details for the file asd_database-1.0.0-py3-none-any.whl.
File metadata
- Download URL: asd_database-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12af709482ce1853787308ae22f2c245c2cb6a054826effdeab0c9ed97358315
|
|
| MD5 |
001419c5fd1830a95a7bf3c3c4c64266
|
|
| BLAKE2b-256 |
42cc5478d15af7235fdcdf5bc1471aa38fea634d0c495333648781a8be8c4613
|