Skip to main content

A NOSQL DB Library for Python

Project description

PyNOSQL Library for Python

Build Status

Summary

PyNOSQL is a simple library that wraps two popular NOSQL databases DynamoDB|MongoDB and provides the concept of a model for maintaining, expanding, and reducing data structures stored in NOSQL tables. Extend model.Model and pass to various Dynamo operations to benefit from default values, adding/removing elements, and simplifying use of boto3 with DynamoDB.

Versions

0.0.1 - Support for basic CRUD operations in DynamoDB 0.0.2 - Support for basic update of model with GET|PUT 0.0.3 - Support for NotFound on single record and empty list for multiple records

Getting Started

  1. Instantiate a client and pass to the desired provider:

    
    from pynosql.credentials.aws import AWSCredentials
    from pynosql.clients.aws import AWSClient
    from pynosql.providers.dynamo import DynamoDBProvider
    
    credentials = AWSCredentials(
        'AKIAIOSFODNN7EXAMPLE',
        'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
    )
    
    dynamo = DynamoDBProvider(
        AWSClient(self.credentials, 'us-west-2')
    )
    
    
  2. Extend base.model.Model to create the desired data structure to be stored in your NOSQL DB:

    
    from pynosql.base.model import Model
    
    class TestModel(Model):
    
        BASE = {
            'test1': None,
            'test2': None,
            'test3': None,
            'test4': None
        }
    
        def __init__(self):
            super(TestModel, self).__init__(self.BASE)
    
    
  3. Pass the model with the appropriate call to DynamoDB:

    
    key = {
        'test1': 'value1',
        'test2': 'value2'
    }
    
    response = dynamo.get_record(TestModel(), 'TestTable', Key=key)
    
    
  4. For paginating all results into the model, just keep passing the model instance into your DynamoDB calls. The new records will be appended to the list within the model.

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

pynosql-0.0.4.tar.gz (8.7 kB view details)

Uploaded Source

Built Distributions

pynosql-0.0.4-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

pynosql-0.0.4-py2.7.egg (34.2 kB view details)

Uploaded Egg

pynosql-0.0.4-py2-none-any.whl (15.5 kB view details)

Uploaded Python 2

File details

Details for the file pynosql-0.0.4.tar.gz.

File metadata

  • Download URL: pynosql-0.0.4.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for pynosql-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a1108584211610f4026530f482b10ccf1870d71c0754324fb4276788f59108ab
MD5 7b215302edf866bb872feb3402367a1c
BLAKE2b-256 25da5e77e07d6515af28a79caf2b64e9e6cecd7b4e6177f3c92a4a41811b1dbe

See more details on using hashes here.

File details

Details for the file pynosql-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pynosql-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for pynosql-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5de624de12d084ff0bfb3c85be47209e131bb966d74992ef04c438a00476490f
MD5 6f49def807346b6e8890e7aae9b3a525
BLAKE2b-256 d6817f25529c9dc5b43f60abcebf00e94b58e5af3f6e0532c7e9c6d03f6f0e1a

See more details on using hashes here.

File details

Details for the file pynosql-0.0.4-py2.7.egg.

File metadata

  • Download URL: pynosql-0.0.4-py2.7.egg
  • Upload date:
  • Size: 34.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for pynosql-0.0.4-py2.7.egg
Algorithm Hash digest
SHA256 5dade84ddf66b1c4024df73e726e4c781c221a4b4fe6123e99959572998df751
MD5 faafd9b7bac8a6f1642f61b5adb185c3
BLAKE2b-256 7ce24c93b3f82bdd8be6999572c33284eabbcaf88bf46fe06ac13b7e2b377246

See more details on using hashes here.

File details

Details for the file pynosql-0.0.4-py2-none-any.whl.

File metadata

  • Download URL: pynosql-0.0.4-py2-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for pynosql-0.0.4-py2-none-any.whl
Algorithm Hash digest
SHA256 0de3f09638b961357b2360595f19fd39d44afb5dc89cf562e72962560822606e
MD5 6bb7cf31a514ed857e7e1fd32c5ca738
BLAKE2b-256 d688cee84b093d65254a0a33ce626052825a3f0e7740790eb1c5811eb616fc38

See more details on using hashes here.

Supported by

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