✨ Simplify your SQLite experience without writing SQL
Overview • Features • Installation • Usage • Testing • License • Contributing
🗒️ Overview
A simple and intuitive SQLite wrapper library for Python that provides an easy-to-use interface for interacting with SQLite Databases. This library allows you to perform basic CRUD ( Create, Read, Update, Delete) operations without having to write raw SQL queries.
✨ Features
- Context Manager Support: Automatically handles database connection and closing.
- CRUD Operations: Easy methods for creating tables, inserting, updating, retrieving, and deleting data.
- No Raw SQL Required: Simplified API for common database operations.
🚀 Installation
This library can be installed via pip( recommended ) or git by cloning the repository and installing it locally.
To install Better SQLite via git:
git clone https://github.com/ayrun3412/Better-SQlite.git
cd Better-SQLite
pip install .
Via pip:
# pip3 for MacOS & Linux
pip install better-sqlite
📚 Usage
Creating a Table
from better_sqlite import Database
with Database('example.db') as db:
db.create_table("users", {"name": "TEXT", "age": "INTEGER"})
Inserting Data
with Database('example.db') as db:
db.insert("users", {"name": "Alice", "age": 30})
Retrieving Data
with Database('example.db') as db:
user = db.get("users", {"name": "Alice"})
print(user) # Output: {'name': 'Alice', 'age': 30}
Updating Data
with Database('example.db') as db:
db.update("users", {"age": 31}, {"name": "Alice"})
Deleting Data
with Database('example.db') as db:
db.delete("users", {"name": "Alice"})
🧪 Testing
To ensure the functionality of the library, you can run the tests using pytest.
First, Install pytest if you haven't already:
pip install pytest
Then run, the tests:
pytest
📝 License
This project is licensed under the MIT License - see the LICENSE for more details
🤝 Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.
Metadata
Release files for better-sqlite 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| better_sqlite-0.1.0.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| better_sqlite-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / better_sqlite-0.1.0.tar.gz
| Download URL | better_sqlite-0.1.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2745343e5b7a8d79f0175cc0ed96a96d29b9464b6ccfe2ac8c6823d44d04ac1
|
|
BLAKE2b-256 checksum How to use checksums |
bf2f79a496b7c4d54357f818228bc56b98aeda29ac2cbef3c5e495b4e08c01dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.5 Windows/11
|
Release files / better_sqlite-0.1.0-py3-none-any.whl
| Download URL | better_sqlite-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5717c02993619aed05172677d61fbbce56c7d6e09c9cb663df526decea7348b9
|
|
BLAKE2b-256 checksum How to use checksums |
2a95523294eae54d88bc77b580ae10e7aa9cc5c51daae8bf3cbfedfe8082d0ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.5 Windows/11
|