- documentation:
- contributions:
Please join https://github.com/cokelaer/easydev
- source:
Please use https://github.com/cokelaer/easydev
- issues:
Please use https://github.com/cokelaer/easydev/issues
- Python version supported:
3.9, 3.10, 3.11, 3.12, 3.13, 3.14
Overview
The easydev package provides miscellaneous utility functions and classes that are repeatedly useful during the development of Python packages. The goal is to help developers speed up their work by providing ready-to-use tools for common tasks such as parameter validation, logging, progress bars, configuration files, multiprocessing, and more.
It has been used as an incubator for other packages (e.g., colormap) and is used in projects such as bioservices, sequana, and GDSCTools.
Installation
Install the latest release from PyPI:
pip install easydev
Features
Parameter validation – check_param_in_list, check_range
Dictionary utilities – swapdict, AttrDict (access dict keys as attributes, supports nested dicts)
Logging – coloured logging via Logging class
Progress bar – Progress works in Python, IPython, and Jupyter notebooks
Timer – measure elapsed time with the Timer context manager
Profiling – do_profile decorator using line_profiler
Configuration files – CustomConfig and DynamicConfigParser for INI-style config management
Shell commands – shellcmd and execute wrappers around subprocess/pexpect
File utilities – touch, mkdirs, md5
Multiprocessing – MultiProcessing class for easy parallel job execution
Codecs – to_list, list2string and other conversion helpers
URL utilities – isurl_reachable and related helpers
Sphinx integration – bundled Sphinx theme and copybutton extension
Quick Start
Parameter validation:
from easydev import check_param_in_list, check_range
check_param_in_list("on", ["on", "off"]) # passes silently
check_range(0.5, 0, 1) # passes silently
AttrDict – access nested dictionary keys as attributes:
from easydev import AttrDict
d = AttrDict(**{"server": {"host": "localhost", "port": 8080}})
print(d.server.host) # localhost
d.server.port = 9090
Coloured logging:
from easydev import Logging
logger = Logging("myapp", "WARNING")
logger.warning("something went wrong")
logger.debug("not shown at WARNING level")
logger.level = "DEBUG"
logger.debug("now it is shown")
Progress bar:
from easydev import Progress
pb = Progress(100)
for i in range(100):
# do work here
pb.animate(i + 1)
Timer:
from easydev import Timer
import time
times = []
with Timer(times):
time.sleep(0.1)
print(f"elapsed: {times[0]:.2f}s")
Multiprocessing:
from easydev.multicore import MultiProcessing
def square(n):
return n * n
t = MultiProcessing(maxcpu=4)
for i in range(10):
t.add_job(square, i)
t.run()
print(t.results)
Changelog
Version |
Description |
|---|---|
0.13.3 |
|
0.13.2 |
|
0.13.1 |
|
0.13.0 |
|
0.12.2 |
|
Metadata
Release files for easydev 0.14.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| easydev-0.14.0.tar.gz | 36.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| easydev-0.14.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 94.5 kB
Release files / easydev-0.14.0.tar.gz
| Download URL | easydev-0.14.0.tar.gz |
|---|---|
| Size | 36.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da3c82b89debe71c13d946a6514a85bdc3034fa878aeaf9d361721f07ac42f44
|
|
BLAKE2b-256 checksum How to use checksums |
f8bda73fd1828ab7e152d9c71123396b581c529f3b01f37a1e845339f476e18d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.10.14 Linux/6.14.5-100.fc40.x86_64
|
Release files / easydev-0.14.0-py3-none-any.whl
| Download URL | easydev-0.14.0-py3-none-any.whl |
|---|---|
| Size | 57.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
774cce412ad543ef707fc3f437eff200422bee4ca2b1b7e063fa5ca40b48d942
|
|
BLAKE2b-256 checksum How to use checksums |
0f4d1f697261368745b5d6cdfc952bb91cfa9fb72c74bf1c5d120039571922fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.10.14 Linux/6.14.5-100.fc40.x86_64
|