https://github.com/zguillez/zpy-database
Python database wrapper
https://github.com/zguillez/zpy-database
database developer-tools helper mysql python
Last synced: 3 months ago
JSON representation
Python database wrapper
- Host: GitHub
- URL: https://github.com/zguillez/zpy-database
- Owner: zguillez
- License: mit
- Created: 2023-02-13T12:10:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-14T00:44:48.000Z (over 3 years ago)
- Last Synced: 2025-01-11T04:35:08.955Z (over 1 year ago)
- Topics: database, developer-tools, helper, mysql, python
- Language: Python
- Homepage: https://pypi.org/project/zpy-database/
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zpy-database v0.1.7
> [Zguillez](https://zguillez.io) | Guillermo de la Iglesia
## Pyton database wrapper
# Getting Started
## Install
```
pip install --upgrade zpy-database
```
# Usage
```
from zpy_database import database as db
db.connect({
'conn': os.environ['DB_HOST'],
'database': os.environ['DB_NAME'],
'user': os.environ['DB_USER'],
'password': os.environ['DB_PASS']
})
```
```
data = db.sql("SELECT id, name FROM my_table")
print(data[0])
```
```
data = db.dict("SELECT id, name FROM my_table", ['id', 'name'])
print(data[0]['name'])
```
```
db.close()
```
# Contributing and issues
Contributors are welcome, please fork and send pull requests! If you have any ideas on how to make this project better
then please submit an issue or [email](mailto:guillermo@delaiglesia.email) me.
# License
©2023 Zguillez.IO
Original code licensed under [MIT](https://en.wikipedia.org/wiki/MIT_License) Open Source projects used within this
project retain their original licenses.
# Changelog
### v0.1.7 (February 13, 2023)
* Initial commit