Skip to main content

abstract_utilities is a collection of utility modules providing a variety of functions to aid in tasks such as data comparison, list manipulation, JSON handling, string manipulation, mathematical computations, and time operations.

Project description

Abstract Utilities

Introduction

This Python package is a collection of utility modules providing a variety of functions to aid in tasks such as data comparison, list manipulation, JSON handling, string manipulation, mathematical computations, and time operations. The package includes the following modules:

  • compare_utils.py
  • collator_utils.py
  • class_utils.py
  • type_utils.py
  • list_utils.py
  • string_clean.py
  • json_utils.py
  • read_write_utils.py
  • math_utils.py
  • time_utils.py
  • main.py

Each module includes a suite of functions which are thoroughly documented within their docstrings, including purpose, input parameters, and return values.

Modules Overview

compare_utils.py

This module provides utility functions for comparing strings and objects. It offers functions for calculating string similarity and comparing object lengths.

collator_utils.py

[TODO: Add brief module overview here]

class_utils.py

This module contains utility functions for dealing with classes, objects, and modules. It offers functions to manipulate global variables, fetch and check object types and their membership in a module, inspect function signatures, call functions with supplied arguments, convert layouts to components, and retrieve directory of a module.

type_utils.py

This module provides utility functions for working with data types. It includes a variety of type checking and conversion functions, from simple checks like is_str or is_int, to more specific ones like is_frozenset or is_memoryview.

list_utils.py

This module contains utility functions for operating on lists. It includes functions like get_sort, which sorts a list in ascending order and returns the element at a given index, and combineList, which combines two lists into one.

string_clean.py

This module provides functions for cleaning and manipulating strings. Functions include quoteIt, which quotes specific elements in a string, and eatInner, eatOuter, and eatAll, which remove characters from various parts of a string or list.

json_utils.py

This module provides functions for handling JSON data. It offers functionalities like converting JSON strings to dictionaries, merging dictionaries, updating and removing keys, loading and saving JSON files, retrieving keys, values, and specific items from dictionaries, and recursively displaying values of nested JSON data structures with indentation.

read_write_utils.py

This module provides utility functions for reading and writing to files. Functions include write content to a file, read content from a file, check if a string has a file extension, read from or write to a file depending on the number of arguments, create a file if it does not exist, then read from it, create a json file if it does not exist, then read from it.

math_utils.py

This module contains utility functions related to mathematical operations.

time_utils.py

This module provides utility functions for working with timestamps and time-related operations. It includes functions that return the current timestamp in seconds or milliseconds, the current day of the week, the current time, the current date, and functions to calculate the number of seconds in various time intervals.

Installation

For local use, navigate to the root directory of the project where setup.py resides and install the package locally in editable mode with pip by running:

pip install -e .

Usage

Import the modules and use the functions in your Python scripts:

from abstract_utilities import type_utils

print(type_utils.is_str("hello"))

Please make sure to replace "abstract_utilities" and "type_utils" with the actual names of your package and module. Changes to the modules will be reflected the next time you import them, without needing to reinstall the package.

License

This project is licensed under the terms of

the MIT license.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstract_utilities-0.0.1512.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abstract_utilities-0.0.1512-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file abstract_utilities-0.0.1512.tar.gz.

File metadata

  • Download URL: abstract_utilities-0.0.1512.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for abstract_utilities-0.0.1512.tar.gz
Algorithm Hash digest
SHA256 0b7a5467dee2c517be3e222d106095d2e3439cac5caf2d8f7122129c6a79ac64
MD5 29a24eb867ab73252a62fbf7c164b632
BLAKE2b-256 328ed528822cbdefbc942ca9f14b204b1821f64cd6927181678f5d0aae469840

See more details on using hashes here.

File details

Details for the file abstract_utilities-0.0.1512-py3-none-any.whl.

File metadata

File hashes

Hashes for abstract_utilities-0.0.1512-py3-none-any.whl
Algorithm Hash digest
SHA256 096d7e7efafe39a7dacd7b7515ea27e2383f91716cc7012e977546b79db7de8a
MD5 22627981d9f27ac12c2f79e6a915d96f
BLAKE2b-256 dce018cc5f8d2050b44740669b2bb40da2987c2825ff4feefa02fa5dae5624f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page