DevScript
Документация на русском
DevScript is a simple utility for managing custom development scripts. It allows you to define commands in pyproject.toml file and execute them through a single interface.
Installation
Python version
pip install devscript
Or install from source:
git clone https://github.com/MagIlyasDOMA/devscript.git
cd devscript
pip install -e .
Configuration format
[tool.devscript]
build = "python -m build"
test = "pytest tests/"
lint = "flake8 src/"
dev = "python -m app --debug"
Running commands
The package provides four CLI commands:
devscript— full namedevscr— abbreviationdevs— shortdvs— shortest
All of them work the same:
# Show the list of available commands
devscript --help
# Run a command
devscript build
devscr dev
devs test
dvs lint
# Pass arguments to a command
devscript dev --port 8000 --reload
Examples
Example 1: Basic usage
# pyproject.toml
[tool.devscript]
start = "uvicorn main:app --reload"
migrate = "alembic upgrade head"
shell = "ipython"
devs start # Starts the uvicorn server
devs migrate # Applies migrations
devs shell # Starts IPython
Example 2: Passing arguments
[tool.devscript]
test = "pytest"
cov = "pytest --cov=src"
devs test tests/test_api.py -v # pytest tests/test_api.py -v
devs cov --cov-report=html # pytest --cov=src --cov-report=html
Development
Python version
# Clone the repository
git clone https://github.com/MagIlyasDOMA/devscript.git
cd devscript
# Install in development mode
pip install -e .
# Run tests
devs test
# Run linter
devs lint
Project structure
devscript/
├── devscript.py # Python implementation
├── pyproject.toml
├── README.md
├── schema.json # JSON Schema for autocompletion
└── LICENSE
JSON Schema
For autocompletion and validation in code editors, use the schema:
{
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json"
}
API
Using in code
Python
from devscript import DevScriptCore
core = DevScriptCore()
print("Available commands:", core.commands_list())
core.run("build", ["--verbose"])
Requirements
Python version
- Python 3.11 or higher
- No external dependencies (uses the standard library)
License
GPL-3.0-only
Author
Mag Ilyas DOMA (MagIlyasDOMA)
- GitHub: @MagIlyasDOMA
- Project: devscript
Contribution
- Fork the repository
- Create a branch for the feature (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
DevScript
Documentation in English
DevScript — это простая утилита для управления пользовательскими скриптами разработки. Она позволяет определять команды в файле pyproject.toml и запускать их через единый интерфейс.
Установка
Python версия
pip install devscript
Или установка из исходного кода:
git clone https://github.com/MagIlyasDOMA/devscript.git
cd devscript
pip install -e .
Формат конфигурации
[tool.devscript]
build = "python -m build"
test = "pytest tests/"
lint = "flake8 src/"
dev = "python -m app --debug"
Запуск команд
Пакет предоставляет четыре CLI-команды:
devscript— полное имяdevscr— сокращениеdevs— короткоеdvs— самое короткое
Все они работают одинаково:
# Показать список доступных команд
devscript --help
# Запустить команду
devscript build
devscr dev
devs test
dvs lint
# Передать аргументы команде
devscript dev --port 8000 --reload
Примеры
Пример 1: Базовое использование
# pyproject.toml
[tool.devscript]
start = "uvicorn main:app --reload"
migrate = "alembic upgrade head"
shell = "ipython"
devs start # Запускает uvicorn сервер
devs migrate # Применяет миграции
devs shell # Запускает IPython
Пример 2: Передача аргументов
[tool.devscript]
test = "pytest"
cov = "pytest --cov=src"
devs test tests/test_api.py -v # pytest tests/test_api.py -v
devs cov --cov-report=html # pytest --cov=src --cov-report=html
Разработка
Python версия
# Клонировать репозиторий
git clone https://github.com/MagIlyasDOMA/devscript.git
cd devscript
# Установить в режиме разработки
pip install -e .
# Запустить тесты
devs test
# Запустить линтер
devs lint
Структура проекта
devscript/
├── devscript.py # Python-реализация
├── pyproject.toml
├── README.md
├── schema.json # JSON Schema для автодополнения
└── LICENSE
JSON Schema
Для автодополнения и валидации в редакторах кода используйте схему:
{
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json"
}
API
Использование в коде
Python
from devscript import DevScriptCore
core = DevScriptCore()
print("Доступные команды:", core.commands_list())
core.run("build", ["--verbose"])
Требования
Python версия
- Python 3.11 или выше
- Нет внешних зависимостей (использует стандартную библиотеку)
Лицензия
GPL-3.0-only
Автор
Маг Ильяс DOMA (MagIlyasDOMA)
- GitHub: @MagIlyasDOMA
- Проект: devscript
Вклад в разработку
- Форкните репозиторий
- Создайте ветку для фичи (
git checkout -b feature/amazing-feature) - Закоммитьте изменения (
git commit -m 'Add some amazing feature') - Запушьте в ветку (
git push origin feature/amazing-feature) - Откройте Pull Request
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 devscript-0.2.1.tar.gz.
File metadata
- Download URL: devscript-0.2.1.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5937b170e9c24a393664d458367d50dc2e9f4c256c2a7b679d375e60a7dffa5c
|
|
| MD5 |
fcfab2ac3e626c4f43fa7c53e2e5db2e
|
|
| BLAKE2b-256 |
d27f4415df0e891a8777e12c439f6442d95672ba63000dca4d2b7cb6d2844154
|
File details
Details for the file devscript-0.2.1-py3-none-any.whl.
File metadata
- Download URL: devscript-0.2.1-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c61d54685101afa5ffcbba5efbbf6b298e0aa3ad51a7aac48274c2b3a8b866b3
|
|
| MD5 |
8a1a35c38c4e93482110bde3d86c7c8d
|
|
| BLAKE2b-256 |
7e8b642652cd4343dccff38c482c4e29e22b39afb8d25488aa2cfb06b377bbf4
|