Skip to main content

ReFreSH.(Py)MobileSuit

PyPI GitHub GitHub last commit GitHub Workflow Status PyPI - Format PyPI - Wheel PyPI - Implementation GitHub repo size GitHub code size

View at PyPI

MobileSuit provides an easy way to build Console App quickly. For python.

This is the python version of ReFreSH.MobileSuit (For .NET).

Setup

pip install PyMobileSuit

Usage

There is a quite simple example:

# [Import and Configure]
from ReFreSH.MobileSuit import *

SuitConfig.LOCALE = 'en'  # 'zh' or 'en' (default if not set)


# [Write Application Class]
class Hello(object):
    def __init__(self):
        pass

    @SuitInfo("hello")
    def instance_func(self):
        print("this is instance function")

    @SuitInfo("async")
    @SuitAlias("async")
    async def async_func(self):
        print("this is async func")

    @SuitInfo("helo <name>")
    @SuitAlias("helo")
    def func_with_arg(self, name: str):
        print(f"this is async func {name}")

    @SuitInfo("helos <names>[]")
    @SuitAlias("helos")
    def func_with_list_arg(self, names: list[str]):
        print(f"this is async func {','.join(names)}")

    @SuitIgnore
    def ignored_func(self):
        print("this is func1")


# [Quick Start App]
Suit.QuickStart4BitPowerLine(Hello)
# Suit.QuickStart
# Suit.QuickStartPowerLine

# > type `help` after the prompt.

And this is the result:

Import and Configure

from ReFreSH.MobileSuit import * is ALL YOU NEED normally.

There are two configurations for PyMobileSuit:

  • LOCALE: en or zh to set language.
  • THROW: To determine whether Exceptions caught from Application methods should be thrown. To debug your application, you may need to set THROW=Ture

Write Application Class

Free to create your application class, write normal or asynchronous methods with or without parameters. Three basic decorators are available for your application methods:

  • @SuitInfo(expr: str, resourceType=None): expr is the description of the command shown in helpcommand's output by default. If you also set resourceType, getattr(resourceType,expr) will be the description.
  • @SuitAlias(alias: str): Add aliases to the command besides the method name
  • @SuitIgnore: Suppose the method is not a command.

Quick Start App

Use Suit.<QuickStartMethod>(<Your Class>) to quickly start the application. There are three built-in QuickStartMethod implementations:

  • Suit.QuickStart: Plain-text IO without powerline.
  • Suit.QuickStartPowerLine: True color Powerline supported IO.
  • Suit.QuickStart4BitPowerLine: ConsoleColor Powerline supported IO.

Normally, you should use Suit.QuickStart or Suit.QuickStart4BitPowerLine.

Notice

Although MobileSuit is easy to use, its features are very comprehensive, so I haven't had the time to write complete documentation.

The current version of PyMobileSuit is migrated from C# using ChatGPT and manual rather than rewritten so that it might be buggy.

Metadata

Release files for PyMobileSuit 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyMobileSuit 0.1.2
File Size Uploaded Provenance Actions
pymobilesuit-0.1.2.tar.gz 32.8 kB Without provenance Details for pymobilesuit-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PyMobileSuit 0.1.2
File Interpreter ABI Platform Actions
pymobilesuit-0.1.2-py3-none-any.whl Python 3 none any Details for pymobilesuit-0.1.2-py3-none-any.whl

Total release size: 81.7 kB

Release files / pymobilesuit-0.1.2.tar.gz

Download URL pymobilesuit-0.1.2.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dcd3329c049dbabbe0ccb098019fbf3937a8498d849feeed26963e9184f0c619
BLAKE2b-256 checksum
How to use checksums
aed2c84b15cfc1d1a9515cd1c2331b37306dc76569e7bf751861863cde30ec17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / pymobilesuit-0.1.2-py3-none-any.whl

Download URL pymobilesuit-0.1.2-py3-none-any.whl
Size 49.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee7c77298d9d80715a4ceabc130fed1ba766988387673236b42c0346881e96a7
BLAKE2b-256 checksum
How to use checksums
2a6e421bc3bddd8bae0f298a5437eb41e64b4904993c9d6238a555c3d851e37b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Security for PyMobileSuit 0.1.2

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.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page