Tools#
MACPie aims to standardize a set of Python tools useful for programmers at the MAC in particular, and the data science community in general. The tools are divided into the following various modules:
datetimetools#
Utility functions related to dates and times.
|
Get the current datetime with second precision with default format |
|
Return milliseconds of the datetime |
|
Reformat a datetime string into specified format. |
itertools#
|
Make an iterator that returns duplicate items from the |
|
Make an iterator that yields items of |
|
Make an iterator from items of |
|
Returns the first true value in the iterable. |
|
Overlay elements from |
lltools#
|
Make an iterator returning successive chunks of size |
|
|
|
Return list of items in |
|
Filter sequence of strings. |
|
Filter pair of sequences of strings. |
|
Check if two lists are disjoint (i.e. have no element in common). ::. |
|
Whether |
|
Whether list of strings in |
|
|
|
Make sequences the same length, filling any shorter lists with |
|
|
|
If |
|
If |
|
Move an item in a list to the just before the position of another item. ::. |
|
Remove duplicates from a sequence while preserving order. |
|
Remove trailing elements from sequence as long as predicate is true. |
|
Remove trailing elements from each sequence as long as predicate is true. |
openpyxltools#
Autoadjust the column widths of a Worksheet |
|
|
|
|
Get column index of the |
|
Get all sheet names from an Excel file. |
|
Highlight row a certain color |
|
Determine if a row is empty. |
|
|
|
Return a Tablib Dataset from an Excel file. |
|
Converts an Excel worksheet to a |
pathtools#
Path utilities
|
Create a new directory with the current datetime appended. |
|
Creates a sub directory with the current date/time appended to the directory name. |
Get all files only from directory |
|
|
Return True if |
|
Return True if |
|
shelltools#
|
Copy a file into the same directory, by default appending "_copy" to filename, unless |
strtools#
|
Add a suffix to a string, optionally specifying a maximum string length and giving priority to the suffix if maximum string length is reached. ::. |
|
Add a list of suffixes to a string, optionally specifying a maximum string length and giving priority to the suffix if maximum string length is reached. |
|
Adds a list of suffixes to a specified base string. |
|
Make sequence of string elements unique by adding a differentiating suffix. |
|
Does sequence contain string. |
|
Are strings equal. |
|
Does string start with a prefix. |
|
Remove a suffix from a string. |
tablibtools#
Tablib is an format-agnostic tabular dataset library. It allows you to import, export, and manipulate tabular data sets. Advanced features include segregation, dynamic columns, tags & filtering, and seamless format import & export.
|
Extend |
|
Tabular representation of basic information using two columns only: a |
|
validatortools#
|
Ensures that argument passed in arg_name is of type bool. |
xlsxwritertools#
|
Completes given worksheet from given Dataset. |
Simulates AutoFit columns in Excel. |