Skip to main content

Lanyora Python Toolkit

Project description

Lanyora

一个用于快速开发 Python 工具的轻量级工具库。

Lanyora 提供了一系列常用工具、装饰器以及 YoraGUI 框架,帮助开发者快速将命令行脚本封装为可视化桌面工具。


安装

pip install lanyora

核心模块

YoraGUI

YoraGUI 是 Lanyora 的核心组件。

它可以将普通 Python 函数快速封装为图形界面,无需编写大量 Tkinter 代码。

适用于:

  • 数据处理工具
  • Excel 自动化工具
  • 测试辅助工具
  • 文件转换工具
  • 个人效率工具

示例:10 行代码创建 GUI

from lanyora.yoragui import YoraGUI

gui = YoraGUI(title="Hello YoraGUI")

@gui.button("点击我")
def hello(app):
    app.alert("Hello World!")

gui.run()

配置管理

gui.define_ctx(
    "username",
    "Lanyu",
    label="用户名"
)

gui.define_ctx(
    "output_dir",
    "",
    label="输出目录",
    value_type=ContextValueType.DIRECTORY
)

自动生成设置界面,无需手动创建表单。


支持功能

  • 按钮自动注册
  • 分组按钮面板
  • 配置管理系统
  • 文件选择器
  • 目录选择器
  • 下拉选择框
  • 日志输出窗口
  • 表格展示
  • 文本展示
  • 异步任务执行
  • UI线程安全调用

其他工具

装饰器

from lanyora import timer

@timer
def my_function():
    pass

支持:

  • timer
  • retry
  • timeout(规划中)

工具函数

from lanyora import random_password

提供:

  • 随机密码生成
  • 浏览器快速打开
  • 控制台提示工具

项目结构

lanyora
├─ decorators
├─ utils
├─ ev
└─ yoragui

版本历史

[0.4.0] - 2026-06

第二代 YoraGUI 重构版本。

Added

  • ContextManager 重构
  • ButtonPanel 独立组件
  • Widget 模块拆分
  • FILE 类型配置项
  • DIRECTORY 类型配置项
  • 异步任务支持
  • UI事件队列机制
  • 表格组件优化

Changed

  • YoraGUI 从单文件架构升级为模块化架构
  • 配置系统全面重构
  • 示例代码迁移至独立测试文件

[0.3.0] - 2026-05

Added

  • 初版 YoraGUI
  • CLI 脚本快速 GUI 化支持

[0.2.0] - 2026-03

Added

  • ev 模块
  • 基础倒排索引实现

许可证

MIT License

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

lanyora-0.4.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

lanyora-0.4.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file lanyora-0.4.0.tar.gz.

File metadata

  • Download URL: lanyora-0.4.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for lanyora-0.4.0.tar.gz
Algorithm Hash digest
SHA256 34f0106ab3dc0daf168c7e36c7ae80da742517bd235049ac1ac96f01276db9e6
MD5 289a68e07aec595ffb709e13172f2b17
BLAKE2b-256 0a380273dd25678740c6a9597d1dd7abe2797c092cd551148c405e03e8f7d405

See more details on using hashes here.

File details

Details for the file lanyora-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: lanyora-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for lanyora-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84e5bb6a8d9f9c3a158efe74c562f9805ee043d8ac0510f2e9329e4f384dbe68
MD5 cdf1263f35800d333bc3cebc6896bd87
BLAKE2b-256 7634014a897f330dea504e6b360647afbf95bd1cb95bc2e0c707ae6199d9789e

See more details on using hashes here.

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