hoshi
¶
Hoshi ☄️ (:mod:`qurry.capsule.hoshi)
hoshi
¶
Hoshi - A process content printer ?
Before:
>>> print(" ### Qiskit version outdated warning")
>>> print("Please keep mind on your qiskit version,
an very outdated version may cause some problems.")
>>> print(" - Local Qiskit version ".ljust(40, '-')+f" {__qiskit_version__['qiskit']}")
>>> print(" - Latest Qiskit version ".ljust(40, '-')+f" {latest_version}")
```
### Qiskit version outdated warning
Please keep mind on your qiskit version, an very outdated version may cause some problems.
- Local Qiskit version ---------------- 0.39.0
- Latest Qiskit version --------------- 0.39.0
```
After:
>>> check_msg = Hoshi(
[
("divider", 60),
("h3", "Qiskit version outdated warning"),
(
"txt",
"Please keep mind on your qiskit version,"
+ " an very outdated version may cause some problems.",
),
("itemize", "Local Qiskit version", 3),
{
"type": "itemize",
"description": "Latest Qiskit version",
"value": 3,
},
],
ljust_description_len=40,
)
>>> print(check_msg)
Local Qiskit version ——————- 0.39.0
Latest Qiskit version —————— 0.39.0
Hoshi - A process content printer ?
- ## Why this name?
I made it when I was listening the songs made by Hoshimachi Suisei, a VTuber in Hololive. I was inspired by her songs, and I made this tool. I named it Hoshi, which means star in Japanese. I hope this tool can help you to make your code more beautiful.
(Hint: The last sentence is auto-complete by Github Copilot from ‘Hoshimachi’ to the end. That’s meaning that Github Copilot knows VTuber, Hololive, even Suisei, who trains it with such content and how. “Does Skynet subscribe to Virtual Youtuber?”)
- class qurry.capsule.hoshi.hoshi.Hoshi(raw: list[tuple[Any, ...] | dict[str, Any]] | None = None, name: str = 'Hoshi', **kwargs)[source]¶
Hoshi - A process content printer ?
- class ConfigContainer(listing_level: int = 1, listing_itemize: str = '-', ljust_description_len: int = 0, ljust_description_filler: str = '-', ljust_value_len: int = 40, ljust_value_filler: str = '.', ljust_value_max_len: int = 40, max_value_len: int = 2000, hint_itemize: str = '#', divider_length: int = 60)[source]¶
Config container for Hoshi.
- divider(length: int = 60)[source]¶
Add a divider.
- Parameters:
length (int, optional) – Length of the divider. Defaults to 60.
- itemize(description: str, value: str | None = None, hint: str | None = None, listing_level: int = 1)[source]¶
Add a listing item.
- qurry.capsule.hoshi.hoshi.divider(length: int = 60, raw_input=False) str | dict[str, Any] [source]¶
Print a divider.
- qurry.capsule.hoshi.hoshi.hnprint(title, heading=3, raw_input=False) str | dict[str, Any] [source]¶
Print a title.
- qurry.capsule.hoshi.hoshi.itemize(description: str, *, export_len: Literal[True]) tuple[str, int, int] [source]¶
- qurry.capsule.hoshi.hoshi.itemize(description: str, *, independent_newline: Literal[True]) tuple[str, str] | str
- qurry.capsule.hoshi.hoshi.itemize(description: str, *, export_len: bool, independent_newline: bool) str
Print a listing item.
repr_modify
¶
Representation modification for Hoshi CapSule (qurry.capsule.hoshi.repr_modify
)
I write this class just for having better representation for the functions
internet_is_fxxking_awesome()
. :3
- qurry.capsule.hoshi.repr_modify.easy_repr_modify_wrapper(repr_content: str | Callable[[...], str] | None) Callable[[...], Any] [source]¶
Wrapper for easy representation modification.
- Parameters:
repr_content (Optional[Union[str, Callable[..., str]]]) – The content of the representation. If it is a string, it will be the representation. If it is a function, it will be the representation function.
- Returns:
The wrapper function for the representation modification.
- Return type:
Callable[…, Any]