json supported easy debugger for python, in files. can also read.
Project description
filewriter 1.0.4
Hello.
I am an easy debugger which prints into files. I can also read. In case you need me ever.
Simplicity within a certain complexity.
Install
pip install filewriter
Documentation
param: filename
Name of the file. The extension .log
will be added.
Default: debug
ENV name: READABLE_GLOBAL_VARIABLE_NAME
param: debug
If set True, prints what's going on. Default: True
param: json
If set True, it will enable json conversion Default: True
param: callback
If set (a function), the function gets executed with the path of created file. Default: None
Examples
from filewriter import Writer, Reader, FReader, Dict
# creates a file called debug.log and saves into
Writer() << {'allah': 'birdir'}
>>> {"allah": "birdir"}
# reverse operator support: Only for dict
Dict({'allah': 'birdir'}) >> Writer()
>>> {"allah": "birdir"}
# reads from debug.log
test = Reader()
print test
>>> {'allah': 'birdir'}
# formatted reader
FReader() >> f"Output {readable}"
# delete callback
import os
Writer(callback: lambda filename: os.remove(filename)) >> {'test': 'callback'} # deletes the file
API
filewriter.Writer
Env Name: READABLE_GLOBAL_VARIABLE_NAME
Default: readable
Writer(
filename="debug",
debug=True,
json=True,
callback=None,
)
filewriter.Reader
Env Name: READABLE_GLOBAL_VARIABLE_NAME
Default: readable
Reader(
filename="debug",
debug=True,
json=True,
callback=None,
)
filewriter.FReader
Env Name: READABLE_GLOBAL_VARIABLE_NAME
Default: readable
FReader(
filename="debug",
debug=True,
json=True,
callback=None,
)
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
Built Distribution
Hashes for filewriter-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3696496dd749d5222b71e2cbc8c489ca694c76ff3d6f842a8beb5e7f58372a89 |
|
MD5 | 2c5ad3d40231477d6654730c00714d21 |
|
BLAKE2b-256 | 5775b11b5fa3805be78e72c73b94e83f82f341e341f8f1e392eac3120a32d649 |