Daisy framework development tools - Python code style checking and formatting utilities
Project description
DaisyTools - Daisy Framework Development Tools
Overview
DaisyTools is a comprehensive toolset for Python code style checking and formatting in Daisy framework projects. It provides automated code quality tools to help developers maintain consistent code style across Daisy software.
Features
- Code Style Checking: Check Python code for formatting issues
- Code Style Fixing: Automatically fix formatting and import sorting
- Python Environment Management: Python interpreter wrapper
- Recursive Directory Scanning: Automatically finds all Python files
- Import File Detection: Skips files marked as imported
- Multiple Output Formats: Check mode, fix mode, and flake8 reporting
Installation
From PyPI (Recommended)
pip install daisytools
From Source
git clone https://github.com/huy/daisytools.git
cd daisytools
pip install .
Development Installation
git clone https://github.com/huy/daisytools.git
cd daisytools
pip install -e .
Usage
Code Style Checking
# Check all Python files in current directory
daisy-code-style-check
# Check specific files
daisy-code-style-check file1.py file2.py
# Check with flake8 output
daisy-code-style-check -p
Code Style Fixing
# Fix all Python files in current directory
daisy-code-style-fix
# Fix specific files
daisy-code-style-fix file1.py file2.py
# Preview changes without applying them
daisy-code-style-fix -n
# Preview changes with flake8 output
daisy-code-style-fix -n -p
Python Wrapper
# Use the best available Python interpreter
daisypython script.py
Configuration
The tools automatically look for configuration files in your project:
.flake8pyproject.toml
If these files are not found, default configurations are used:
- Black: Line length 88, Python 3.6+ compatibility
- isort: Black profile for import sorting
- flake8: Max line length 88, ignores E203 and W503
Command Line Options
daisy-code-style-check
files: Python files to check (optional, defaults to all Python files in current directory)-p, --flake8: Show flake8 output instead of code changes
daisy-code-style-fix
files: Python files to fix (optional, defaults to all Python files in current directory)-n, --check: Only show what would be changed without applying fixes-p, --flake8: Show flake8 output (only with -n option)
Development
Running Tests
python -m pytest tests/
Building the Package
python -m build
Publishing to PyPI
python -m twine upload dist/*
License
MIT License - see LICENSE file for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file daisytools-1.0.1.tar.gz.
File metadata
- Download URL: daisytools-1.0.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da3c4ca46485cc47752ca9232765a5eea36e9676676cd00c52802a0af14bee6a
|
|
| MD5 |
66c8974aca5c03e7ec0323faaaab07c3
|
|
| BLAKE2b-256 |
941f45aac1396e4bbc891c683cae2c15c535deed98c167291f6902f9e003661c
|
File details
Details for the file daisytools-1.0.1-py3-none-any.whl.
File metadata
- Download URL: daisytools-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47f786547b198319cf56960097fcbfc2d304e66739ea7e361bdf47bb19b4f0c9
|
|
| MD5 |
3f947deba844c63a64599e668074c4e7
|
|
| BLAKE2b-256 |
282baef95728cc0fbe5fd4ddf9ce1790f8628d982a5f0e32ecc5add2ddbc2b47
|