Skip to main content

Simple MongoDb dependency for nameko (microservices framework). Based on https://github.com/saiqi/nameko-mongodb

Project description

Overview

Build Status

This is DependencyProvider for Nameko microservices framework which enables users to work with MongoDb.

First of all I should say that this package based on https://github.com/saiqi/nameko-mongodb . Thank you @saiqi :)

What has been changed:

  • Automatic uploading to PyPI by Travis-CI (it was a primary purpose for building of my pet projects)
  • Disabled by default results logging
  • Some fixes to make this stuff work with new Nameko

Requirements

  • Python 2.7 / 3.4 / 3.5 / 3.6 / 3.7
  • Nameko 3.11+
  • MongoDb :)

Installation

The same as you guessing: pip install nameko-mongodb

How to use

There are some configuration options to use this package (required are in bold):

  • MONGODB_CONNECTION_URL - connection URL
  • MONGODB_DB_NAME - database name. Default is your service name
  • MONGODB_USER - if you need to be authenticated, provide username
  • MONGODB_PASSWORD
  • MONGODB_AUTHENTICATION_BASE - a source to authenticate. See more information in PyMongo documentation
  • MONGODB_AUTH_MECHANISM - see more information in PyMongo documentation

You can use the connection following way:

from nameko.rpc import rpc
import MongoDatabase from nameko_mongodb


class YourService(object):
    name = 'your_service'

    database = MongoDatabase()

    @rpc
    def find_item(self):
        return self.database.your_collection.find_one()

Also this package can log all executions to logging collection. If you want to use it:

from nameko.rpc import rpc
import MongoDatabase from nameko_mongodb


class YourService(object):
    name = 'your_service'

    database = MongoDatabase(result_backend=True)

    @rpc
    def find_item(self):
        return self.database.your_collection.find_one()

Contribution

I'd be glad to see your pull requests

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

nameko-mongodb-1.0.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distributions

nameko_mongodb-1.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

nameko_mongodb-1.0.0-py2-none-any.whl (7.5 kB view details)

Uploaded Python 2

File details

Details for the file nameko-mongodb-1.0.0.tar.gz.

File metadata

  • Download URL: nameko-mongodb-1.0.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for nameko-mongodb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8149d8814cae06fc261f078b28b5971349a50c1fb1e361b5da7a4c0c55960416
MD5 9932b34a1ece89000621891b5e101b8b
BLAKE2b-256 9a9c596dc6155ecdf9c7d1766f630429db6f1ac49be85dd5a5c092d9dfe77923

See more details on using hashes here.

File details

Details for the file nameko_mongodb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: nameko_mongodb-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.4.8

File hashes

Hashes for nameko_mongodb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9f41541eb22ab5616f1366f25777430476640112c04f6f867700a61917fa4aa
MD5 0d7195d08eeb08767bc9ddb4e9c6327a
BLAKE2b-256 c4b6242676f80bd9c60cc2eab5729bef9f3c29edfc71b3cd8968e5efec5b1831

See more details on using hashes here.

File details

Details for the file nameko_mongodb-1.0.0-py2-none-any.whl.

File metadata

  • Download URL: nameko_mongodb-1.0.0-py2-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for nameko_mongodb-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 a7d702069ec653d0dc069ca20d276abfeca2ca44e9a51a13b2b95eef40bfb977
MD5 9935b1c9bed7a1a7527dc4976419768f
BLAKE2b-256 eaa1ec0f633a8bfb0ad394e923230f068c4b5b45f3ab49ad84c93a37c2414b8d

See more details on using hashes here.

Supported by

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