Skip to main content

All of my macros in one place!

Project description

pip install macrolibs

Macros for type conversions, recursive search, file handling, etc...


typemacros

import macrolibs.typemacros

Includes:

  • standardization of unions, intersections, and compliments for all base iterables
  • replace_value_nested recursive find and replace for all nested data structures
  • maybe_arg automatic function argument reduction (reductive polymorphism)
  • copy_type functor with name cache for creating new types (also maps reflexive methods to new type)
  • maybe_type attempts to apply type constructor
  • wrap_types attempts to apply type constructor for specified types

And more!


filemacros

import macrolibs.filemacros

Includes:

  • get_script_dir function to return the directory of the call location

(this is different from os.getcwd as it will retun the location of the file making the function call)

  • full_walk returning full paths from os.walk

  • open_json and save_json with default format option


misc

import macrolibs.misc

Includes:

  • profile_run A custom profiling function similar to cProfile.run() with enhanced formatting options.

Project details


Download files

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

Source Distribution

macrolibs-0.0.6.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

macrolibs-0.0.6-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file macrolibs-0.0.6.tar.gz.

File metadata

  • Download URL: macrolibs-0.0.6.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for macrolibs-0.0.6.tar.gz
Algorithm Hash digest
SHA256 91d0d0cb6f4b9b5d4b66a01ffa876805e146fc3cc7ad8b4a7831d6d95d314df6
MD5 00eaa31a96047bc80d068ccc7f5a0da8
BLAKE2b-256 f055c7ad49886784ec64f7624007fe7cc245cd4908adcbb01d429c42347b49fe

See more details on using hashes here.

File details

Details for the file macrolibs-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: macrolibs-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for macrolibs-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 aaccc30e69dac6229363eea81676a64a81c9decc3dfd95655740cd5c6c2827b5
MD5 9e2d9afba3a25bf868346cc44494c0f2
BLAKE2b-256 c3b40d469df02f5b625c4804f3438a6a113849274d0758959d12e29759193d72

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