Easydev
Easydev (v0.14.0) is a Python library offering a collection of common utilities to streamline the development of Python packages. It includes tools for shell interaction, system path management, console output, and decorators. The library is actively maintained with releases addressing Python version compatibility and dependency updates, typically on an irregular but consistent basis.
Common errors
-
AttributeError: module 'easydev.tools' has no attribute 'get_platform'
cause The `get_platform` function was deprecated and removed in Easydev v0.12.0.fixReplace calls to `easydev.tools.get_platform()` with `easydev.get_home()` for the user's home directory, or use functions from the standard `platform` module or `platformdirs` library for other platform-specific information. -
ImportError: cannot import name 'AppDirs' from 'easydev.tools.appdirs'
cause The internal `appdirs` dependency was replaced by `platformdirs` in Easydev v0.12.2, removing direct exposure of `appdirs` components.fixUpdate `easydev` to v0.12.2 or newer. Instead of trying to import `AppDirs`, use `easydev.get_home()`, `easydev.get_user_cache_dir()`, or import and use `platformdirs` directly if more advanced path management is needed. -
The Poetry backend doesn't support version 2.0
cause You are using an older version of `easydev` (prior to v0.13.3) with a newer Poetry project that relies on `poetry-core` version 2.0 or higher.fixUpgrade `easydev` to version 0.13.3 or newer: `pip install --upgrade easydev`.
Warnings
- breaking The internal dependency `appdirs` was replaced by `platformdirs`. If your code directly relied on attributes or specific behaviors exposed through `easydev`'s integration of `appdirs` (e.g., `easydev.tools.appdirs`), it might break.
- deprecated The `get_platform()` function from `easydev.tools` has been deprecated and subsequently removed.
- gotcha Older versions of `easydev` may have compatibility issues when building projects with newer Poetry versions that use `poetry-core` 2.0 or higher.
- gotcha There were fixes related to multicore tests on Python 3.14, suggesting potential issues with multicore operations on newer Python versions if not updated.
Install
-
pip install easydev
Imports
- Shell
from easydev.tools import Shell
- get_home
from easydev import get_home
- mkdir
from easydev.misc import mkdir
- deprecate
from easydev.tools import get_platform
from easydev.decorators import deprecate
Quickstart
from easydev.tools import Shell
from easydev import get_home
from easydev.console import purple
from easydev.misc import mkdir
import os
s = Shell()
print(f"Current directory: {s.pwd().strip()}")
home_dir = get_home()
print(f"Home directory using easydev: {home_dir}")
# Create a temporary directory
temp_dir = os.path.join(home_dir, 'easydev_temp_test')
mkdir(temp_dir)
print(f"Created directory: {temp_dir}")
os.rmdir(temp_dir) # Clean up
purple("Hello from Easydev!")