Skip to main content

Simple SQLite wrapper to make it easier to manage your database

Project description

# EasyDB

A really simple **SQLite wrapper** for that saves you from having to worry about creating tables or managing connections.

It can be used on existing SQLite database by simply passing in the database filename:

```python
from easydb import EasyDB
db = EasyDB('filename.db')
cursor = db.query("SELECT * FROM mytable")
```

New databases can be creating by specifying your schema as a dictionary, eg:

```python
schema = {
'table_name': ['column_name column_type', …],
'table_name': ['column_name column_type', …],
'table_name': ['column_name column_type', …]
}
db = EasyDB('filename.db', schema)
```

If the database file already exists then the schema won't be updated, but if it doesn't exist then it'll be created with the given schema. Here's a full example:

```python
from easydb import EasyDB
db = EasyDb('my.db', {'users': ['username text', 'description text']})

db.query("INSERT INTO users (username, description) VALUES (?, ?)", ('ben', 'some sort of description'))

for result in db.query("SELECT * FROM users"):
print result
# => ('ben', 'some sort of description')
```

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

easydb-0.1.tar.gz (1.9 kB view details)

Uploaded Source

File details

Details for the file easydb-0.1.tar.gz.

File metadata

  • Download URL: easydb-0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for easydb-0.1.tar.gz
Algorithm Hash digest
SHA256 318bec4d8350622265031391400fde6eca7e688f05c7e78a45635cd5d72ad32f
MD5 d9389bd3fb71f9d4db6944085cb44905
BLAKE2b-256 b2ae7082b9f36523f03f7ba42712bb5c65defd511a3d76cae087e6f7cfc977e0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page