A wrapper for interacting with Polygon DB
Project description
You can download it here https://pypi.org/project/polywrapper/ Welcome to the PolyWrapper wiki!
Here is the basics of using poly wrapper
To install polywrapper run the following command
pip install polywrapper
Here is an example of inserting data into a database
connection = polywrapper.PolyClient("node2.lunes.host:27106", "Better_Password", "ExampleDB")
res = connection.insert("Hello", "World")
print(res)
This will return {"Status": "Success"} if it works.`
You can also input sub level JSON and lists
connection.insert({"users": ["David", "Andrew"]})
connection.insert("meta", {"page": "2"})
To get data from certain key
print(res)
to get all data from database do
res = connection.get()
if the key value system is {"key": "value"} it will return value if it is something like {"key": {"sub": "json"}} it will return {"sub": "json"}
To update a keys value.
connection.update("key", "value2")
once again this can be json or a string
to append data to a list you will need to do
res = connection.insert("users", ["John", "Andrew"]) connection.append("users", "Mia")
To remove certain keys.
connection.remove('key')
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
File details
Details for the file polywrapper-0.1.4.tar.gz
.
File metadata
- Download URL: polywrapper-0.1.4.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5389c9b431ea1b35fc1555c7bc8108fbd93395234fbcd873d6b44d58e009def0 |
|
MD5 | f8c8c19870a080906a5e0bbbc788124d |
|
BLAKE2b-256 | 0857f6a8542e7d5e849ff6081b7398daeed6fe72d694ae8da3918643bf368789 |