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

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.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distributions

pynosql-0.0.1-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

pynosql-0.0.1-py2-none-any.whl (14.8 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: pynosql-0.0.1.tar.gz
  • Upload date:
  • Size: 8.2 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.1.tar.gz
Algorithm Hash digest
SHA256 360f6768f0981a76df216c9c1d400fb092770c9c657cf3918eb80c13bffa18fa
MD5 d6f1602b203ec587bac44f1bef2576ae
BLAKE2b-256 6ef8b66b0cdb7cb0e317a093fab19784e23c01133920f494f13296e7e3cf518a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pynosql-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3cde96b96235098a8f1c6db374d03a557b8d3f7060cc014f7ea0f4b5f2a08179
MD5 e5db9e87f4ff10c6ef54b0749ca21677
BLAKE2b-256 46be5255e788103b4d63fcf6cdf82e6c739b7827acba668777ee57f4f216ecfb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pynosql-0.0.1-py2-none-any.whl
  • Upload date:
  • Size: 14.8 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.1-py2-none-any.whl
Algorithm Hash digest
SHA256 8e6adc62a3431cbde57e941b9fb4633abc28b1538b2cefa5592fdbb052c582ff
MD5 331351ccbb7f0eed0df8235176c6ea32
BLAKE2b-256 c503cf22a55ae733b0dcfa5ed8a63b06a3bd1fcafeb54371d5123f0763f709b6

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