Provides a wide range of useful classes and functions.
This library is currently still under development. The API will likely undergo significant changes that may break any code you write with it. The documentation will fall out of sync with the updates regularly until development slows down. Use it at your own risk.
Provides a wide range of useful classes and functions:
- Parse a string by user-specified opening/closing tokens, recursively
- Can ignore tokens between specific tags (for example, within string quotation marks)
- Return an object tree (currently traversal methods are limited)
Context manager classes
SysTrayApphides the console and runs a system tray app which can have its options customized with callbacks
Timercounts the time since it was instanciated, and prints it on exiting context
Suppressorsupresses all console output and warnings on enter and resores it on exiting
PrintRedirectorredirects stdout to a given file
NullContextwill always return itself on attribute access or when called, and does nothing when used as a context manager or when attributes are set on it
Other misc classes
Counteris an object-oriented replacement for manipulating an integer var for iteration purposes
WhoCalledMecan be dropped in to print out the call stack
EnvironmentVariablescan be used on Windows to get and set environment variables permanently
Beepproduces a beeping sound of variable duration on Windows
Versionobject to represent versions, with comparator magic methods and wildcard support
Trueif in an ipython session, else
issubclass_safeis a version of the built-in
issubclassthat doesn't raise an error if the candidate is an instance rather than a class, just returns
To install use pip:
$ pip install pymiscutils
Or clone the repo:
$ git clone https://github.com/matthewgdv/miscutils.git $ python setup.py install
Usage examples coming soon.
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Report bugs at https://github.com/matthewgdv/miscutils/issues
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement a fix for it.
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
The repository could always use more documentation, whether as part of the official docs, in docstrings, or even on the web in blog posts, articles, and such.
The best way to send feedback is to file an issue at https://github.com/matthewgdv/miscutils/issues.
If you are proposing a new feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
Before you submit a pull request, check that it meets these guidelines:
If the pull request adds functionality, it should include tests and the docs should be updated. Write docstrings for any functions that are part of the external API, and add the feature to the README.md.
If the pull request fixes a bug, tests should be added proving that the bug has been fixed. However, no update to the docs is necessary for bugfixes.
The pull request should work for the newest version of Python (currently 3.7). Older versions may incidentally work, but are not officially supported.
Inline type hints should be used, with an emphasis on ensuring that introspection and autocompletion tools such as Jedi are able to understand the code wherever possible.
PEP8 guidelines should be followed where possible, but deviations from it where it makes sense and improves legibility are encouraged. The following PEP8 error codes can be safely ignored: E121, E123, E126, E226, E24, E704, W503
This repository intentionally disallows the PEP8 79-character limit. Therefore, any contributions adhering to this convention will be rejected. As a rule of thumb you should endeavor to stay under 200 characters except where going over preserves alignment, or where the line is mostly non-algorythmic code, such as extremely long strings or function calls.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pymiscutils-0.3.2-py3-none-any.whl (13.7 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size pymiscutils-0.3.2.tar.gz (13.5 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for pymiscutils-0.3.2-py3-none-any.whl