Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

json supported easy debugger for python, in files. can also read.

Project description

filewriter 1.0.9

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, Reverse

# creates a file called debug.log and saves into
Writer() << {'allah': 'birdir'}
>>> {"allah": "birdir"}

# reverse the operator, if that's easier to read
# https://docs.python.org/3/reference/simple_stmts.html#assignment-statements
Reverse({'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,
)

Twitter: @ebsaral

Project details


Download files

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

Files for filewriter, version 1.0.9
Filename, size File type Python version Upload date Hashes
Filename, size filewriter-1.0.9-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size filewriter-1.0.9.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page