Welcome to jade_utils’s documentation!

A set of utilities and helper functions to make the Met Office Informatics Lab Pangeo deployment even more useful.

Quickstart

jade_utils provides helper functions for use on Pangeo.

Installation

Install with the following command:

conda install -c informaticslab jade_utils

Usage

TODO

Utilities

jade_utils.human_tools Tools to make things more human readable.
jade_utils.iris_tools

Human Tools

Tools to make things more human readable.

jade_utils.human_tools.human_bytes(num, suffix='B', use_binary_prefix=True)[source]

Provide a human readable representation of a specified number of bytes.

Convert a number of bytes into a higher order representation such as megabytes or gigabytes to make more human readable. Similar to specifying -h in many command line tools.

Args:

num (int): The number of bytes you wish to represent. suffix (str, optional): The suffix for the representation. Defaults to ‘B’ use_binary_prefix (bool, optional): Use binary prefix, Defaults to True, if False use decimal prefix.

Returns:
str: The human representation of the bytes provided.
Examples:
>>> print(human_bytes(1024))
1.0KiB

Iris Tools