semvec/pypi-packages huggingface dataset:
mergedict 1.0.0
A Python `dict` with a merge() method.
License: MIT
Requires Python: >=3.4
Keywords: dict,singledispatch,config

mergedict - A Python `dict` with a merge() method
===================================================

.. display some badges

.. image:: https://travis-ci.org/schettino72/mergedict.png?branch=master
  :target: https://travis-ci.org/schettino72/mergedict

.. image:: https://coveralls.io/repos/schettino72/mergedict/badge.png
        :target: https://coveralls.io/r/schettino72/mergedict


A MergeDict is a `dict` with a `merge()` method.
`merge()` is like `dict.update()`...

::

    from mergedict import MergeDict

    d1 = MergeDict({'a': 1, 'b': 'one'})
    d1.merge({'a':2, 'c': [2]})

    assert d1 == {'a': 2, 'c': [2], 'b': 'one'}


A MergeDict can be subclassed to create custom "merge" operations
based on the type of an item value.


::

    from mergedict import MergeDict

    class SumDict(MergeDict):
          @MergeDict.dispatch(int)
          def merge_int(this, other):
              return this + other

    d2 = SumDict({'a': 1, 'b': 'one'})
    d2.merge({'a':2, 'b': 'two'})

    assert d2 == {'a': 3, 'b': 'two'}


`mergedict` module comes with a `ConfigDict` that will
extend/update lists/sets/dicts.

::

    from mergedict import ConfigDict

    d3 = ConfigDict({'a': 1, 'my_list': [1, 2]})
    d3.merge({'a':2, 'my_list': [3, 4]})

    assert d3 == {'a': 2, 'my_list': [1, 2, 3, 4]}




Project Details
===============

- Project management on github - https://github.com/schettino72/mergedict/


license
=======

The MIT License
Copyright (c) 2013 Eduardo Naufel Schettino

see LICENSE file


developers / contributors
==========================

- Eduardo Naufel Schettino — main author

- Sebastian Pipping — build system fixes


install
=======

::

 $ pip install mergedict

or download and::

 $ python setup.py install


tests
=======

To run the tests::

  $ py.test
prepull-singularity 0.2.0
A tool for pulling singularity images in HPC environments.
License: MIT
Requires Python: >=3.5
Keywords: singularity pull prepull hpc image container

prepull-singularity
===================
Application to populate the singularity cache. Useful for HPC clusters where
multiple nodes may pull to the same cache at the same time if images are not
yet present.

Installation
-------------
prepull-singularity is tested on python 3.5, 3.6, 3.7 and 3.8. It can be
installed with:

``pip install prepull-singularity``

How to run
----------

1. Make a YAML file listing the images to be pulled.

.. code-block:: yaml

    alpine: "alpine:latest"
    debian: "debian:stretch-slim"

2. Run the program ``prepull-singularity images.yml``

Usage
-----

.. code-block:: text

    usage: prepull-singularity [-h] [-a MAX_ATTEMPTS] [-p PREFIX]
                               [--stop-on-failure] [--show-output-on-failure]
                               [--show-output-on-success]
                               [--singularity-exe SINGULARITY_EXE] [--use-digest]
                               input

    Pull images from listed in a YAML file, so they get cached and can be run
    without pulling later.

    positional arguments:
      input                 A YAML file listing the images to be pulled, either as
                            a map or list.

    optional arguments:
      -h, --help            show this help message and exit
      -a MAX_ATTEMPTS, --max-attempts MAX_ATTEMPTS
                            Maximum number of times to attempt pulling each image;
                            defaults to 3.
      -p PREFIX, --prefix PREFIX
                            Prefix for the image url; defaults to 'docker://'.
      --stop-on-failure     Stop when pulling an image fails; by default all
                            images will be attempted to be pull even if one fails.
      --show-output-on-failure
                            Print the stderr and stdout when pulling an image
                            fails.
      --show-output-on-success
                            Print the stderr and stdout when pulling an image
                            succeeds.
      --singularity-exe SINGULARITY_EXE
                            The command for running singularity; defaults to
                            'singularity'
      --use-digest          Retrieve the image digestes from dockerhub or quay.io
                            and use those (instead of the tags) to pull the
                            images. Only usable with docker images.