Skip to main content

A MongoDB, Sacred, and Omniboard helper.

Project description

mdbh - A MongoDB helper collection to use with Sacred and Omniboard.

This repository holds mostly two purposes:

First, it provides a Python module together with some CLI scripts to ease the usage of MongoDB together with Sacred and Omniboard, filling a low-level gap. Whereas Omniboard is well suited to quickly explore data and compare Sacred experiments, it is not meant for more complex data visualization and low-level database access. This can for example be useful when preparing print-quality plots.

Second, it provides a Wiki to collect guidelines on how to use Sacred with MongoDB, Omniboard and mdbh. In particular, a multi-user, multi-database setup with password restriction and controlled read/write access to multiple databases is provided. This Wiki is not meant to be exhaustive, but shall get you started with your own setup.

Note: This is still somewhat under development.

[[TOC]]

Installation

Install via PyPi using pip

pip install mdbh

Setup

The MongoDB instance configuration is done using one (or multiple) configuration files which simply store the server IP, port and possible the username, password and authentication methods and database names. See the examples folder for an example.

By default, it is assumed the this configuration file can be found under

~/.mongo.conf

This config file is central to the use of mdbh. As this config file might contain userdata, make sure only the current user has read access to it, e.g. run

chmod 400 .mongo.conf

Use Cases

Some use cases of mdbh are as follows:

MongoDB URI creation

Often times, services or modules (such as the MongoObserver in Sacred) need a URI to connect to the MongoDB following the official format specification. However, this often results in boilerplate code and, in the case of user authentification, security risks as the username and/or password have to be specified in the corresponding code.

To this end, mdbh provides the get_uri function which creates the connection URI based on the .mongo.conf file and a specific database name.

Sacred Experiment query

To query and manipulate data that has been logged to the MongoDB instance via Sacred, mdbh provides several functions, the most comprehensive one being get_df_full which returns a Pandas DataFrame object created from the specified Sacred database. It convenently combines configuration information as well as logged metrics of all experiments in the specified database. Using the DataFrame, complex data aggregation and/or plotting (e.g. via Seaborn) is quite comfortable.

MongoDB Setup and Omniboard

See the corresponding Omniboard Wiki entry to see how mbdh can ease the use with Omniboard.

See the corresponding MongoDB Wiki entry to see how to properly setup a MobgoDB instance.

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

mdbh-0.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

mdbh-0.2-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file mdbh-0.2.tar.gz.

File metadata

  • Download URL: mdbh-0.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for mdbh-0.2.tar.gz
Algorithm Hash digest
SHA256 920e7ce079077f5848feb050048c3a95221c974a39b8f87b8422f758110d3439
MD5 35bde58bda5b8b349a037ec4e7cb6552
BLAKE2b-256 f52e2f09ebb3d31414f1bc97ecc2f4c1bedaea7b14549b747af77993d5ccba2e

See more details on using hashes here.

File details

Details for the file mdbh-0.2-py3-none-any.whl.

File metadata

  • Download URL: mdbh-0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for mdbh-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f509991cef55587a2a32bfb6eaecd1ac5b64d85faff6034ea23431fe25cb955
MD5 7c19ca8e2d2e86b8c076f1fe8b1d2750
BLAKE2b-256 f7c8c2bca9834abf3ff275c87ff794d91cbe9d23376b8156f678591031fba1f7

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