项目作者: aiselis

项目描述 :
Lightweight library for using Postgres as nosql database
高级语言: Python
项目地址: git://github.com/aiselis/tispost.git
创建时间: 2020-05-29T19:40:55Z
项目社区:https://github.com/aiselis/tispost

开源协议:Apache License 2.0

下载


Tispost

Latest PyPI package version

Key Features

  • Supports asyncio.

Getting started

tispost allows you to quickly use postgres as a nosql database.

Example

  1. # import
  2. from tispost import Server, Collection, Session
  3. # create connection
  4. server = Server(dbname=database, user=postgres, password=postgres, host=dlnxiot001)
  5. # connect
  6. server.connect()
  7. # get session
  8. session = await server.session()
  9. # create new collection
  10. session.create("collection")
  11. # delete a collection
  12. session.delete("collection")
  13. # get a collection
  14. collection = session.collection("collection")
  15. # insert document into a collection:
  16. collection.save({'item':'value'...})
  17. # get document from collection with id
  18. collection.get(id="930f43ed-7bb5-46b9-a6d2-45c345ec959e")
  19. # query items
  20. collection.query(filter={'key':'value'}, offset=0, limit=50)

Installation

It’s very simple to install tispost:

  1. pip install tispost

Notes

  • The db user must have the create/drop table permission

Requirements

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