Skip to main content

ToolMan: Python utility functions for R&D

https://img.shields.io/pypi/v/toolman.svg https://travis-ci.com/bohaohuang/toolman.svg?branch=master https://codecov.io/gh/bohaohuang/toolman/branch/master/graph/badge.svg

See the source for this project on our GitHub page

Install

pip install toolman

Modules

mist_utils.py

miscellaneous utility functions including data I/O and processing

  1. Read/write different formats of files in one function:

import toolman as tm
data = tm.misc_utils.load_file(file_name)
tm.misc_utils.save_file(file_name, data)

Currently support extensions including: .npy, .pkl, .txt, .csv, .json and commonly used image formats.

  1. Argument parser, parse nested argument list:

import sys
import argparse
import toolman as tm
parser = argparse.ArgumentParser()
args, extras = parser.parse_known_args(sys.argv[1:])
cfg_dict = tm.misc_utils.parse_args(extras)

vis_utils.py

Matplotlib utility functions for visualization

  1. Display images in side by side with axis linked

import toolman as tm
fig1 = tm.misc_utils.load_file(img_name_1)
fig2 = tm.misc_utils.load_file(img_name_1)
tm.vis_utils.compare_figures([fig1, fig2], (1, 2), fig_size=(12, 5))
  1. Display barplots

import toolman as tm
data = np.random.random((3, 4))
labels = ['group 1', 'group 2', 'group 3']
xticks = ['cluster 1', 'cluster 2', 'cluster 3', 'cluster 4']
tm.vis_utils.compare_bars(data, labels, xticks)

img_utils

image specific utility functions

pytorch_utils

pytorch specific utility functions

process_block

A processing unit that do certain operations only if it has never done before. This is helpful avoid duplicate executing time consuming jobs.

import toolman as tm
def foo(cnt_len):
    cnt = 0
    for i in range(cnt_len):
        cnt += 1
    return cnt

pb = tm.process_block.ProcessBlock(foo, file_dir)
pb.run(force_run=False, cnt_len=100)

Metadata

Release files for toolman 0.1.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for toolman 0.1.18
File Size Uploaded Provenance
toolman-0.1.18.tar.gz 13.0 kB Without provenance Details

Release files / toolman-0.1.18.tar.gz

Download URL toolman-0.1.18.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d6b47bedcca71bb4dc284ecbb7ad17fe78b7d879476b817bd210a25b0b111ac3
BLAKE2b-256 checksum
How to use checksums
53fd25cd5847cd6c7e95a4e48a6bc25d0a034e34682413f68aee21e3b715682d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Security for toolman 0.1.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page