semvec/pypi-packages huggingface dataset:
rich-typer 0.1.7
more beautiful Typer
Requires Python: >=3.7,<4.0

# Rich Typer

## 介绍

本项目是将Rich和Typer结合在一起，将CLI打造的更加美观漂亮。

![](images/example.png)

## 安装

```bash
pip install rich_typer
```

或者使用`poetry` 安装

```bash
git clone https://github.com/Elinpf/rich_typer
cd rich_typer
poetry build
pip install dist/<whl_file>
```

## 使用

完全兼容[Typer](https://github.com/tiangolo/typer)语法，具体语法细节参考[Typer官方文档](https://typer.tiangolo.com/)


除此之外增加了如下几个参数：

- `banner`  增加标题
- `banner_justify` 标题位置
- `epilog_blend` 底部信息的渐变色
- `usage` 自定义Usage

## Example

```py
from rich_typer import RichTyper, Argument, Option


app = RichTyper()
banner = f"[b]Rich Typer[/b] [magenta][/] 🤑\n\n[dim]将 Rich 与 Typer 结合起来，使界面更加漂亮。\n"

url = "♥ https://github.com/Elinpf/rich_typer"


@app.command(banner=banner, banner_justify='center', epilog=url)
def main(
    name: str = Argument(...,
                         help="Name of the [green]person to greet[/]."),
    message: str = Option('ms', '-m', '--message',
                                help="The message [red]to[/] display"),
    version: bool = Option(False, '-v', '--version',
                           help="Show the [u]version[/] and exit"),
) -> None:
    """[bold][blue]Rich Typer[/] example."""
    ...


app()
```
anachronos 0.0.7
A testing framework for testing frameworks.

# Anachronos
A testing framework for testing frameworks.

Anachronos is an end-to-end testing framework usable with a wide variety of applications.
To get started, define an `ApplicationRunner` which can be used to start your application. 
Then, write your test classes by inheriting from `anachronos.TestCase`. 

## How it works
The framework provides access to a special `Anachronos` object which is accessible both from the tested application, and from the testing suite.
This object effectively acts as a logger on which assertions can be run afterwards. Anachronos assertions are accessible by using the `self.assertThat` method from within a TestCase.
Below is a simple TestCase example taken from the Jivago framework.

```python
import anachronos
from e2e_test.runner import http
from e2e_test.testing_messages import SIMPLE_GET


class SimpleResourceTest(anachronos.TestCase):

    def test_simple_get(self):
        http.get("/")

        self.assertThat(SIMPLE_GET).is_stored()

    def test_post_dto(self):
        response = http.post("/", json={'name': 'Paul Atreides', 'age': 17}).json()

        self.assertEqual('Paul Atreides', response['name'])


if __name__ == '__main__':
    anachronos.run_tests()

```
With the matching application logic :

```python3
import anachronos
from e2e_test.app.components.dtos.request_dto import RequestDto
from e2e_test.app.components.dtos.response_dto import ResponseDto
from e2e_test.testing_messages import SIMPLE_GET
from jivago.lang.annotations import Inject
from jivago.wsgi.annotations import Resource
from jivago.wsgi.methods import GET, POST


@Resource("/")
class SimpleResource(object):

    def __init__(self):
        self.anachronos = anachronos.get_instance()

    @GET
    def simple_get(self) -> str:
        self.anachronos.store(SIMPLE_GET)
        return "OK"

    @POST
    def post_body(self, request: RequestDto) -> ResponseDto:
        return ResponseDto(request.name, True)

```