Skip to main content

Personal utils package for Python projects

Project description

Personal utils package for Python projects.


Improve Library

If you get an error or need something to improve, write Issues.


Installation

pip install edenpy

Usage

Import

from edenpy import save_json, Logger

(1) File Load and Save

from edenpy import save_json

data = [1, 2, [3, 4], {5: 'a', 6: 'b'}]
path = "./data.json"

save_json(data, path)

data.json

[
	1,
	2,
	[
		3,
		4
	],
	{
		"5": "a",
		"6": "b"
	}
]

(2) Logger

When you run a file using logger like test.py, log is written to log.log. The log records the time, log level, file name, code line, log message.

test.py

from edenpy import Logger

logger = Logger().logger
logger.info("logger info test")
logger.error("logger error test")

log.log

[2020-05-26 09:54:23,182][    INFO][        test.py][   4]	>>	logger info test
[2020-05-26 09:54:23,182][   ERROR][        test.py][   5]	>>	logger error test

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 Distribution

edenpy-0.5.6-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

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