Skip to content

michaelgale/toolbox-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

toolbox-py

python version https://github.com/michaelgale/toolbox-py/blob/master/LICENSE Code style: black

https://travis-ci.org/michaelgale/toolbox-py

A general purpose collection of useful python tools and utility functions.

Functionality

File Utilities

  • FileOps class acts as an abstract agent to access your file system.
  • Utility functions: full_path, split_path, split_filename

Data Utilities

  • Various text and data validation and parsing functions

Parameter Container Class

  • Params class to hold parameters as attributes in a class with dotted access. Can be initialized with an input YAML file with nested hierarchy.
  • apply_params merges object dictionaries and optional local parameters stored in a dictionary called "PARAMS". This allows parameter data for an object to be inheritable, able to be easily passed into instantiation, and be attached as an attribute of the object.

Geometry Classes

  • Vector, Vector2D, Matrix classes for simple linear algebra operations with vectors
  • Point - general purpose 2D point class
  • Rect - general purpose 2D rectangle class and utility functions

Foldercheck utility

Simple command line utility to summarize the contents of a folder tree. Summary includes file count, file size, and grouped categories of files by both extension and category (e.g. images, source code, etc.)

Installation

The toolbox package can be installed directly from the source code:

    $ git clone https://github.com/michaelgale/toolbox-py.git
    $ cd toolbox-py
    $ pip install .

Usage

After installation, the package can imported:

    $ python
    >>> import toolbox
    >>> toolbox.__version__

An example of the package can be seen below

    from toolbox import Params
    tp = Params(yml="test_params.yml")
    print(tp)

Requirements

  • Python 3.6+
  • jinja2
  • metayaml
  • crayons

Authors

toolbox-py was written by Michael Gale

About

A general purpose collection of useful python tools and utility functions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages