Skip to main content

A FastAPI-like framework for building interactive shell applications with auto-completion and type safety

Reason this release was yanked:

This stable version is unstable through. Use 1.0.0a3 instead.

Project description

FastShell

A FastAPI-like framework for building interactive shell applications with automatic completion, type conversion, and subcommands.

🚀 Quick Start

pip install fastshell
from fastshell import FastShell

app = FastShell(use_pydantic=True)

@app.command()
def hello(name: str = "World", count: int = 1):
    """Say hello to someone."""
    for _ in range(count):
        print(f"Hello, {name}!")

if __name__ == "__main__":
    app.run()

✨ 主要特性

  • 🚀 FastAPI风格装饰器 - 简单直观的API设计
  • 🛡️ Pydantic验证 - 增强的类型验证和错误处理
  • 🔧 自动补全 - 命令和参数的智能补全
  • 📊 自动格式化 - 智能识别数据类型,自动选择最佳显示格式
  • 🌳 子命令支持 - 嵌套命令结构
  • 🖥️ 跨平台 - 支持Windows、macOS和Linux

🎯 示例

格式化输出示例

查看 examples/ 目录中的示例代码

🧪 测试

# 运行所有测试
python -m pytest tests/

🤝 贡献

欢迎提交Issue和Pull Request!

📄 许可证

本项目采用 GNU General Public License v3.0 许可证 - 查看 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

fastshell-0.1.3.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

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

fastshell-0.1.3-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file fastshell-0.1.3.tar.gz.

File metadata

  • Download URL: fastshell-0.1.3.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for fastshell-0.1.3.tar.gz
Algorithm Hash digest
SHA256 68c8f0c9907cc37ff687bab4d0056f2285423e083dfdc08294f48181a36f8209
MD5 bbba756c79f19ee3dc29f899b46581f8
BLAKE2b-256 3a185956b2840f6eba62e01d60717f026c98607e69a57bde0637c74e654bbaa2

See more details on using hashes here.

File details

Details for the file fastshell-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fastshell-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for fastshell-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 393eb9e890d640a8c362402a6e1d21c9cad059aa1f23c8bc715b54bcbd38c078
MD5 b8d6eea6a6e8fd7a54abed9416452edd
BLAKE2b-256 54ea5c48abc67a28e7bb124edb185849d5d41b67667987143d60c9228ff852f7

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