Using pandas as db in python
Project description
Using Pandas as database in python
Using Pandas (Parquet) as database in python
Method
- set_owner
- set_debug
- cols
- filter
- update
- insert
- upsert
- save
- load
Sample
Table
class User(pddb.pdtbl):
def init_obj(self) -> dict:
path = "./data/users.parquet"
obj = {"uid": {"type": str, "uuid": True, "ignupd": True},
"usr_cde": {"type": str, "key": True},
"usr_name": {"type": str}}
return (obj, path)
class Password(pddb.pdtbl):
def init_obj(self) -> dict:
path = "./data/passwords.parquet"
obj = {"uid": {"type": str, "uuid": True, "key": True, "ignupd": True},
"password": {"type": str, "require": True, "md5": True}}
return (obj, path)
View
class VW_User_Password(pddb.pdvw):
def init_obj(self) -> dict:
usr = User()
pwd = Password()
cfg = {"source": [{"name": "usr", "tbl": usr}, {"name": "pwd", "tbl": pwd, "join": ["uid"]}],
"cols": [{"tbl": "usr", "col": "uid"}, {"tbl": "usr", "col": "usr_cde"}, {"tbl": "pwd", "col": "password"}]}
return cfg
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
pddb-genwch-0.0.2.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for pddb_genwch-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab395755a5af681904cce17cc8302dc28c91123a917f388b42d4fd55c3ab3aa6 |
|
MD5 | 1e8b585b9f758cd2768b5d2e4ce53932 |
|
BLAKE2b-256 | 88ae43e48252bb3fca3c6c05ad88d9afc3f9f341025ae40415eacaf8030b7198 |