Skip to main content

Read and process Python subset

Project description

PLG-SHARED

PLG-SHARED - это общий инфраструктурный слой для всех проектов организации py-love-gmod.

Он предоставляет:

  • Парсер Python с преобразованием в IR (промежуточное представление)
  • Общие утилиты: бинарный дампер, CLI-обёртку, многопоточность
  • Единый формат данных для обмена между компонентами экосистемы

Библиотека не выполняет код, который парсит. Она только анализирует и структурирует его.

Зачем нужен этот модуль?

В экосистеме py-love-gmod многие проекты используют общие механизмы:

  • чтение и анализ Python-кода
  • сериализацию данных
  • построение CLI-интерфейсов
  • параллельную обработку

Вместо того чтобы дублировать код в каждом репозитории, все эти механизмы вынесены в PLG-SHARED.

Поддерживаемые типы файлов

Парсер умеет читать:

Расширение Описание
.py Обычный Python-код
.pyi Файл-описатель (stub)

На выходе - единое IR-дерево, с которым работают все остальные инструменты.


Бинарный дампер

Модуль BinaryRW позволяет безопасно сериализовать и десериализовать стандартные типы Python:

  • None, bool, int, float, str, bytes
  • list, tuple, dict, set

Формат упаковки - бинарный.

CLI-утилита

В состав входит модифицированная версия clii - микро-обёртка над argparse.

Позволяет быстро создавать консольные команды с минимальным кодом. Используется во всех CLI-инструментах экосистемы.

В отличии от самого проекта который лицензирован под GNU Affero General Public License v3.0 (AGPL-3.0), clii лицензирован под MIT

Технический долг

  • Выводить ошибки более человеческим языком
  • Улучшить позиционирование ошибок (аналог Python-трейсбэков)

Установка

pip install plg-shared

Для разработки:

git clone https://github.com/py-love-gmod/plg-shared
cd plg-shared
pip install -e .

Лицензия

Этот проект распространяется под лицензией GNU Affero General Public License v3.0 (AGPL-3.0).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylovegmod_shared-0.1.0.tar.gz (82.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylovegmod_shared-0.1.0-py3-none-any.whl (93.9 kB view details)

Uploaded Python 3

File details

Details for the file pylovegmod_shared-0.1.0.tar.gz.

File metadata

  • Download URL: pylovegmod_shared-0.1.0.tar.gz
  • Upload date:
  • Size: 82.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pylovegmod_shared-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d42a5ab4a90c700bd05a9be0987607e8ab291405f4d8d00590748e7ad0d25fad
MD5 21e1766a2d17b1145b15c383813b7443
BLAKE2b-256 2717f892deff94a0ffcb11afa5ad6f82906dbf065d5728c18e2ef8d07c9ff2a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylovegmod_shared-0.1.0.tar.gz:

Publisher: publish.yml on py-love-gmod/plg-shared

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pylovegmod_shared-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pylovegmod_shared-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d60f56140a90f9add8f8a7c352750d404e04b85a186263b0ffc0675446a224b
MD5 f71b4b0618efeef4ec040c7f537e778c
BLAKE2b-256 3c5aecaec6f52f31b679b3072f7469c91429b77e6fc26453c51d2ee5f26d58eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylovegmod_shared-0.1.0-py3-none-any.whl:

Publisher: publish.yml on py-love-gmod/plg-shared

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page