Skip to main content

A mongodb (portable) "pf" client

Project description

https://badge.fury.io/py/pfmongo.svg https://travis-ci.org/FNNDSC/pfmongo.svg?branch=master https://img.shields.io/badge/python-3.5%2B-blue.svg

Quick Overview

pfmongo is a python client/module (CLI and API) for simplifying the interaction with a MongoDB. The module provides some idiosyncratic abstractions that are nonetheless hoped to be logically straightforward. The repository includes a docker-compose.yml that allows for easy instantiation of the MongoDB infrastructure.

Warning, Will Robinson!

If you wish to use pfmongo on your own computer, you do need to note these prerequisites:

docker and docker-compose

Since pfmongo interacts with a MongoDB, the easiest mechanism to deploy this database is via docker-compose and hence docker. Installation of these is beyond the scope of this document, but should be straightforward enough. Google is your friend in that quest.

Overview

pfmongo provides a somewhat opinionated abstraction for interacting with a MongoDB.

Installation

Using PyPI

The best method of installing this script and all of its dependencies is by fetching it from PyPI using a python virtual environment.

pip3 install pfmongo

Using CLI

Alternatively, from a cloned version of the repository:

pip3 install -r requirements.txt -U ./

or for development purposes

pip3 install -r requirements.txt -e ./

Running

Ecosystem

Assuming you have docker and docker-compose on your system, do

docker-compose up -d

Environment

Several environment variables need to be set prior to using pfmongo:

Linux

export MD_URI=mongodb://localhost:27017 && export MD_USERNAME=admin && export MD_PASSWORD=admin && export MD_SESSIONUSER=rudolph

Windows

$env:MD_USERNAME=admin
$env:MD_PASSWORD=admin
$env:MD_URI=mongodb://localhost:27017
$env:MD_SESSIONUER=rudolph

Command line arguments

pfmongo --help

Examples

alias mdb='pfmongo'
mdb database connect PACSDCM
mdb collection connect MRN
mdb document add --file examples/lld.json --id lld.json

-30-

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

pfmongo-0.9.134.tar.gz (53.2 kB view details)

Uploaded Source

File details

Details for the file pfmongo-0.9.134.tar.gz.

File metadata

  • Download URL: pfmongo-0.9.134.tar.gz
  • Upload date:
  • Size: 53.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for pfmongo-0.9.134.tar.gz
Algorithm Hash digest
SHA256 b4ac63cb3dbe267c342bae070833d0b19e695f22e2472107c9f71a893eee17eb
MD5 bd603f88a4733ff6b539c661c051a6b8
BLAKE2b-256 6c658e0fc6089d5a91511a5062456a46d88131bd76d1795baddf51581d7c55c0

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