Giter Site home page Giter Site logo

mongoutils's Introduction

mongoUtils

A toolcase with utilities for mongoDB based mainly on pymongo useful also as mongoDB example usage and best practices.
This library has been in developement as pymongo_ext until major changes in pymongo version 3 broke backward compatibility, it is now rewrittern from scratch.

Note


Installation:pip install mongoUtils

Dependencies:
  • pymongo (installed automatically by setup)

  • Hellas (installed automatically by setup) a lightweight python utilities library of mine

  • gevent (optional) not a prerequisite but will be used by pyMongo if installed

  • xlrd library (optional used only for importing Excel workbooks into mongo to install it:
    >>> pip install xlrd

Usage:
See documentation of individual modules and classes
All examples require the existance of testing database and collections which are installed during execution of tests.
Also if mongoDB is not running on local host port 27017, testDbConStr connection string in configuration.py should be edited.
Most examples require establishing a connection to testing database.
>>> from pymongo import MongoClient;                        # import MongoClient
>>> from mongoUtils.client import muClient                  # or alternativly this client
>>> from mongoUtils.configuration import testDbConStr       # import conection string
>>> client = muClient(testDbConStr)                         # establish a client connection
>>> db = client.get_default_database()                      # get test database

Tests:
  • to run tests
    python -m mongoUtils.tests.tests -v

mongoutils's People

Contributors

nickmilon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.