Skip to main content

Python tools collection

Project description

pyppin: A toolkit of Python basics

pyppin is a library of "basic components" that can be used in a wide range of contexts -- things that could hypothetically live in a standard library, only there's no particular reason to put them in there. It is essentially a box of tools that are slightly less common than the basics, but are nonetheless damned useful in practice. If the main argument against adding something to the standard library is "why does it need to be in there, as opposed to elsewhere?" and it's not big enough to merit its own standalone package, this is a perfectly reasonable place to put it.

The current catalogue is:

Debugging Tools

  • interact lets you pop open a REPL at any point in your code, with access to all the local and global variables, so you can easily do interactive debugging.

Better class definition

  • @cache and @cachemethod are decorators that allow fancier (but still one-line) caching of function and method results.
  • @lazyinit lets you defer expensive variable initializations like server connnections until and unless you need them.
  • RegisteredClass lets you automatically register, iterate over, and fetch by name all subclasses of an abstract class you define.

Iteration

  • zipper flexibly merges multiple sorted iterators into a single, efficient, parallel iterator.

Scanning directories

  • list_files lets you list all files recursively in a given directory, managing all the subtle corner cases for you.
  • bulk_import lets you (recursively or not) import all the Python files in a given directory, which is especially useful with registered classes.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyppin-1.0.0-py3.10.egg (210.2 kB view hashes)

Uploaded Source

pyppin-1.0.0-py3.10-macosx-12.4-x86_64.egg (171.8 kB view hashes)

Uploaded Source

Supported by

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