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.5.0] - 2026-06

Added

  • open_web(url) — 从 GUI 打开浏览器链接(线程安全)
  • set_background(image_path) — 空视图背景图片(支持 Pillow 缩放)
  • 对话框 initialdir 参数

Fixed

  • 异步任务中对话框崩溃(线程安全调度器)
  • PrintCapture 缺少 isatty() 等方法
  • tqdm 改为可选依赖

[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.5.1.tar.gz (21.4 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.5.1-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lanyora-0.5.1.tar.gz
Algorithm Hash digest
SHA256 5f90478c3b1b650186eb56828396c33c62ba2b5c3dfc4a3994779298a8a30bf3
MD5 436518c5135575efa4ded7ca317cd09c
BLAKE2b-256 2f9b6a3657e008b76ab82c25018ee1968273320da3013f8b85bc94f831e23c21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lanyora-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 21.4 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.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 993751da2c21c856eda26b36425e2bfcda8b115159d59c95182aeb85b713e845
MD5 84184e471cc2358f14f3f72b2ec85248
BLAKE2b-256 e744212ee4baa628069eed9b401df528f5cffdd1a80a4e9dc7dfcdd4a75edf72

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