Vinson Database is a lightweight, file-based Python database.
Project description
Vinson Database
Vinson Database is a lightweight, file-based Python database designed to manage structured data simply and efficiently. Optimized for handling CRUD operations with flexible querying and filtering capabilities, Vinson Database is ideal for small to medium datasets that require robust data manipulation without the overhead of traditional databases. The system also provides support for managing duplicates and indexing with primary keys.
Features
- Effortless Data Management: Perform basic CRUD operations (Create, Read, Update, Delete) with ease.
- Advanced Querying: Retrieve data using primary keys, single-parameter queries, or multi-parameter queries for flexible data access.
- Custom Updates: Update records based on single or multiple fields with options for fast batch updates.
- Duplicate Management: Identify and remove duplicate records based on unique fields or entire records.
Installation
To get started, clone the repository:
pip install git+https://github.com/vinmahajan/vinson.git
Usage Guide
1. Initialize the Database
Create a new database by instantiating the DB class with a database name:
mydb = DB("studentsn")
2. Add Data
Add new data entries using the add method:
mydb.add(data={"roll_no": i, "name": f"sonic{i}", "age": random.randint(10, 20)})
3. Read Data
Retrieve records with flexible querying options:
- Primary Key Query: Fetch a record by primary key:
mydb.primary_query(key='roll_no', value=11)
- Single Parameter Query: Retrieve records matching a single parameter:
mydb.query(key='name', value='sonic156')
- Multiple Parameters Query: Query data using multiple field-value pairs:
mydb.multiple_query(name='sonic1', age=15)
4. Update Data
Update specific records with both basic and fast update options:
# Basic update based on a single parameter
mydb.update(criteria={'roll_no': 1}, updates={'name': 'sonicmc', 'age': 10})
# Fast update with multiple criteria
mydb.update_fast(criteria={'roll_no': 4, 'name': 'sonic4'}, updates={'age': 2})
5. Delete Data
Remove records based on specified criteria:
mydb.delete_data(criteria={'name': 'sonic4', 'age': 2})
6. Handle Duplicates
Vinson Database provides methods to clean duplicate entries:
- Remove duplicates based on a unique field (e.g.,
roll_no):mydb.delete_duplicates(unique_key='roll_no')
- Remove duplicates based on the entire record:
mydb.delete_duplicates()
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 vinson-0.1.tar.gz.
File metadata
- Download URL: vinson-0.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5d5b9d808264e31541a0949823c5d4409a592caf9f0e4c6e96ecc9ea7c91721
|
|
| MD5 |
804483f186ef0bdfd537f67962fc0797
|
|
| BLAKE2b-256 |
7d9c211ec4e7eeaaaefd9bfec7a8bbf25661625f39f2a41f787cc05a28a05cec
|
File details
Details for the file vinson-0.1-py3-none-any.whl.
File metadata
- Download URL: vinson-0.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66508a70408cfba8d5f1fda13844c5441dff9a9fad9db0d85e5463129bf773fa
|
|
| MD5 |
93b791e4a555a256d4c2f47abde5f1c0
|
|
| BLAKE2b-256 |
e8bac7b4be7ae7d84ae602f114b9ce92a378c852d2fcdcdc3118e889e5fdc2fa
|