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
Metadata
Release files for devscript 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| devscript-0.2.1.tar.gz | 16.9 kB | Without provenance | Details for devscript-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| devscript-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for devscript-0.2.1-py3-none-any.whl |
Total release size: 34.1 kB
Release files / devscript-0.2.1.tar.gz
| Download URL | devscript-0.2.1.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5937b170e9c24a393664d458367d50dc2e9f4c256c2a7b679d375e60a7dffa5c
|
|
BLAKE2b-256 checksum How to use checksums |
d27f4415df0e891a8777e12c439f6442d95672ba63000dca4d2b7cb6d2844154
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / devscript-0.2.1-py3-none-any.whl
| Download URL | devscript-0.2.1-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c61d54685101afa5ffcbba5efbbf6b298e0aa3ad51a7aac48274c2b3a8b866b3
|
|
BLAKE2b-256 checksum How to use checksums |
7e8b642652cd4343dccff38c482c4e29e22b39afb8d25488aa2cfb06b377bbf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for devscript 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.