Skip to main content

Client for EasyEasy.io cloud database

Project description

easyeasy.client

How to use

Install

pip install easyeasy

Initialize

from easyeasy.client import Client

client = Client("bc420813-17d9-47fa-9d29-8bd6a1207f8a")

Examples

class Cat:
    def __init__(self):
        self.id = None
        self.name = None
        self.interests = []
        self.age = None

cat = Cat()
cat.name = "Sam"
cat.age = 1.5
cat.interests = ["play", "eat", "discover"]

# add object. entity name will be inferred from class name
id = client.add(cat)

# or specify entity name explicitly
id = client.add(cat, "cat")

# get one object by id. Specify entity type. Entity name will be inferred
cat = client.get_one(id, Cat)

# or specify entity name explicitly
cat = client.get_one(id, Cat, "cat")
# at least one should be specified(entity_class or entity_name). In case entity_class not specified, dict object will be returned


# update object
cat.age = 2.0
cat.interests = ["eat", "sleep", "play"]

# object must have id property to distinguish which object is being updated. entity_name can be specified explicitly
client.update(cat)

# get all objects. entity_name can be specified explicitly
cats_collection = client.get(Cat)

# filtering
cats_collection = client.get(Cat, filters={'age': 1.5})  # get 1.5 years old cats
cats_collection = client.get(Cat, filters={'age_gt': 1.0})  # cats older than 1 year
cats_collection = client.get(Cat, filters={"name_like": "Sa*"})  # wildcard

# paging
cats_collection = client.get(Cat, filters={"_start": "10", "_count": 10})  # wildcard

# learn more about filtering operators at: http://easyeasy.io/docs#/operators

# delete object by id
client.delete(cat.id, Cat)

Licence

ISC

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

easyeasy-1.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easyeasy-1.0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file easyeasy-1.0.1.tar.gz.

File metadata

  • Download URL: easyeasy-1.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for easyeasy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8583461943bb8a95bb81c6c45a94979e95ef0665e80430e7435cebbaa330ae50
MD5 660a08d6236182260281bfb98abbdd12
BLAKE2b-256 50970949272c1f22caa4b33ca1876a66e1d04408c10e47c28683a26c1271a84a

See more details on using hashes here.

File details

Details for the file easyeasy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: easyeasy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for easyeasy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f640a78dbd2b72957e6c3962a99115658453b56a2bd9a30298dffa38432b95af
MD5 984ed18cf7e5dadb85d7a01ad0bcf1b4
BLAKE2b-256 233403ca73f8688510dccfc66f456b937049eb60d13439d42a7d6b74540e6c2b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page