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

Uploaded Source

Built Distributions

pynosql-0.0.2-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

pynosql-0.0.2-py2-none-any.whl (14.9 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: pynosql-0.0.2.tar.gz
  • Upload date:
  • Size: 8.3 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.2.tar.gz
Algorithm Hash digest
SHA256 e3419eaf0a745e9c97637171fde6c59f5c5ec784b50827729197cd09f12d3bcf
MD5 69892998beac5a3a108a178fd89610f6
BLAKE2b-256 652b08e07400dd30b7b7bab644b726a36ee0e3d07fabfeac0af81b3cb8b4fcea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pynosql-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9150144e0d7db209cf867bd63ea61dacd37ccc7d16d2ce1bd6b6de4e53841f2a
MD5 efbab3d3f002b26c22b2fe944335fa40
BLAKE2b-256 2721c3f10f8f644837b9eca6b89d609d6032044f8812db49966fa444796e802e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pynosql-0.0.2-py2-none-any.whl
  • Upload date:
  • Size: 14.9 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.2-py2-none-any.whl
Algorithm Hash digest
SHA256 08a295d3cb798270df7e2a1ea6c9d550a6c12165a95451d5665427054be9750e
MD5 6d24af4163f0727f1a5b852abedd3db5
BLAKE2b-256 f1f3f86ac96bec6a81af6225a46f8cdf93b8d42cff9ef2c4423b3eb8f9a5bc57

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