DEVPY
Devpy is a set of tools to ease Python development.
Install
pip install devpy
Quick demo
Devpy provide a quick dev setup for logging that you can replace later by a more robust solution:
import devpy.develop as log
log.info('This is an info')
log.warning('This is a warning')
log.error('This is an error')
log.critical('This is a critical error')
log.info('Now let me crash the program. This stack trace is automatically in the log file:')
import codecs
codecs.open('/thisdoesnotexist')
This gives:
Autolog
Setuping proper loging is tedious, so you may want to do it later, but you wish you could get basic logging right now:
import devpy
# Get a logger that automatically log to console and a rotating file
# The rotating file is setup in the temp directory of your system, in
# a subdir named after your script name.
# Logs are colored in the console according their level.
# The file path is printed at the begining of the program.
log = devpy.autolog() # log is a regular stdlib logger object
# start logging:
log.info('Yes')
Once you have time to setup logging seriously, you can just replace the autolog with a regular custom Python logger, and all your logs will still work.
Setting the environment variable DEVPY_LOG_LEVEL to an integer or a level name (debug, info, error, warning, critical…) will set the autolog log to it.
Setting the environment variable DEVPY_COLOR_LOG to 0 disable the color in the log.
autolog parameters:
level (default=-1): the general log level
name (defaul=name of the root module): the name of the log file
path (default=OS temp dir + name): path to the log file
log_on_crash (default=True): add a hook to log the stack trace in case of a crash
log_filename (default=True): log log file pat at the program start
color_log (default=True): add colors to the log
Stacktrace helper
Format the stack trace so that:
it separates the various logicial blocs
it emphasis the lines of your program and not the stdlb
lines of your program are syntax highlighted
Just do:
import devpy
devpy.color_traceback()
All helpers at once
Two ways:
import devpy
log = devpy.dev_mode() # can set color_traceback=True, autolog=True
# or just
# import devpy.develop as log
# for a one liner to activate it all
Metadata
Release files for devpy 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| devpy-0.1.7.tar.gz | 5.0 kB | Without provenance | Details for devpy-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| devpy-0.1.7-py2-none-any.whl | Python 2 | none | any | Details for devpy-0.1.7-py2-none-any.whl |
Total release size: 12.0 kB
Release files / devpy-0.1.7.tar.gz
| Download URL | devpy-0.1.7.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e508da161fd520c811d87ae92991be3a0f05c38ae2ebdde84137692c91b1fe7
|
|
BLAKE2b-256 checksum How to use checksums |
534bf1491ef00e0039dd4f688bbac1ff70ad98ee6a01d6a7b27c90c0944af31c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / devpy-0.1.7-py2-none-any.whl
| Download URL | devpy-0.1.7-py2-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
e10978fb763fd89ba3e373eceac81893ccb2d0765874e80ddeecb0dec59d3f53
|
|
BLAKE2b-256 checksum How to use checksums |
915e9e7a174afda66f8cef2675ec88513fe4965ff8254bc84a574fb7665e1361
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for devpy 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.