A simple and light DB package
Project description
# instadb
A simple a light DB python package
## Features
- query from postgres and reshift
- load data into pandas dataframe
- query from sql or filename
- automatically setup connections from env variables
- automatic query annotation
- connect timeout retry with exponential backoff
### Installation
`pip install instadb`
### Basic Usage
```python
import instadb
db = instadb.Connection(url=database_url)
df = db.dataframe("select * from users limit 10")
```
If you have env variables that match the pattern `<key>_DATABASE_URL` then you can directly do:
```python
import instadb
df = instadb.key.dataframe("select * from users limit 10")
```
### Query from file
```python
df = instadb.key.dataframe(filename='./users.sql')
```
### Query from file with arguments
users.sql
```
select * from users where limit={limit}
```
```python
df = instadb.key.dataframe(filename='./users.sql', limit=100)
```
## TODO
- [ ] load data to list
- [ ] insert and update queries
- [ ] caching
A simple a light DB python package
## Features
- query from postgres and reshift
- load data into pandas dataframe
- query from sql or filename
- automatically setup connections from env variables
- automatic query annotation
- connect timeout retry with exponential backoff
### Installation
`pip install instadb`
### Basic Usage
```python
import instadb
db = instadb.Connection(url=database_url)
df = db.dataframe("select * from users limit 10")
```
If you have env variables that match the pattern `<key>_DATABASE_URL` then you can directly do:
```python
import instadb
df = instadb.key.dataframe("select * from users limit 10")
```
### Query from file
```python
df = instadb.key.dataframe(filename='./users.sql')
```
### Query from file with arguments
users.sql
```
select * from users where limit={limit}
```
```python
df = instadb.key.dataframe(filename='./users.sql', limit=100)
```
## TODO
- [ ] load data to list
- [ ] insert and update queries
- [ ] caching
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
instadb-0.4.1.tar.gz
(3.3 kB
view details)
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 instadb-0.4.1.tar.gz.
File metadata
- Download URL: instadb-0.4.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61d8b8bdacbfd17448e4a2f54104ad0341a05d43c72545a1dc42129de28adb82
|
|
| MD5 |
fe9e222b19471c3a5bf5ba75eba1e7df
|
|
| BLAKE2b-256 |
4841b9d0112d742afe751cdd8a908eec3f6d86cd89a206bf105a446b72926c08
|
File details
Details for the file instadb-0.4.1-py2.py3-none-any.whl.
File metadata
- Download URL: instadb-0.4.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de270d3965a2fb0dfd3d74a97580cb436879e873ba274255a4cb14e7f7aa26b1
|
|
| MD5 |
c4be42400fe94f81c92b8be1426d02fa
|
|
| BLAKE2b-256 |
98e0b105bf09b64987689dffa22ed3e75341afbd7ca8819b9d61b8b687d98815
|