Lightweight library for using postgres as nosql database
Project description
Tispost
Key Features
- Supports asyncio.
Getting started
tispost
allows you to quickly use postgres as a nosql database.
Example
# import
from tispost import Server, Collection, Session
# create connection
server = Server(dbname=database, user=postgres, password=postgres, host=dlnxiot001)
# connect
server.connect()
# get session
session = await server.session()
# create new collection
session.create("collection")
# delete a collection
session.delete("collection")
# get a collection
collection = session.collection("collection")
# insert document into a collection:
collection.save({'item':'value'...})
# get document from collection with id
collection.get(id="930f43ed-7bb5-46b9-a6d2-45c345ec959e")
# query items
collection.query(filter={'key':'value'}, offset=0, limit=50)
Installation
It's very simple to install tispost:
pip install tispost
Notes
- The db user must have the create/drop table permission
Requirements
- Python >= 3.6
- aiopg
License
tispost
is offered under the Apache 2 license.
Source code
The latest developer version is available in a GitHub repository: https://github.com/aiselis/tispost
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tispost-0.1.0.tar.gz
(7.6 kB
view hashes)