semvec/pypi-packages huggingface dataset:
ywpi 0.1.5
Add your description here
Requires Python: >=3.10








Supported annotation variants
```python
import typing
import ywpi

def fn(
    a1: int,
    a2: str,
    a3: float,

    # String as text
    a4: typing.Annotated[str, ywpi.Text],

    # File content
    a5: typing.Annotated[bytes, ywpi.File],

    # File reference
    a6: typing.Annotated[ywpi.Ref, ywpi.File],
):
    pass
```



Referenced JSON

```json
{
    "output_str": {
        "type": "str",
        "value": ""
    },
    "output_int": {
        "type": "int",
        "value": 0
    },
    "output_url": {
        "type": "url",
        "value": "https://python.org/"
    },
    "output_ref": {
        "type": "ref",
        "value": {
            "drive_id": "",
            "preview_href": ""
        }
    }
}
```



#### Multiple level of serialization
1. *Application* - regular python dictionary with python objects
2. *Hub* - serialize dictionary in `StartTaskRequest` model
    - Referencify `bytes` values with *attachments*
3. *gRPC* - serialize `StartTaskRequest` to string via `JSON` string + `attachments` map




### Serialization for model with bytes fields
Ywpi pass additional context to pydantic `model_validate` method.
Context has next format:
```python
{
    "attachments": {
        "attachment_key": b"binary content"
    }
}
```


```python
class Model(pydantic.BaseModel):
    class File(pydantic.BaseModel):
        content: bytes 

        @pydantic.field_validator('content', mode='before')
        def validate(data, info: pydantic.ValidationInfo) -> bytes:
            print("Validate", data, "\n")
            if isinstance(data, dict):
                key = data["$attachment"]
                if key in info.context["attachments"]:
                    return info.context["attachments"][key]
                else:
                    raise ValueError(f'conten with key "{key}" does not present in the attachments')
            return data

    files: list['Model.File'] = []
```
areallyrandomcli-normalperson543 0.0.6
Allows you to view Scratch forums in a command line interface
Requires Python: >=3.9

# AReallyRandomCLI

A TUI (and CLI) you to view Scratch forums in a command line interface. I don't really care much about Scratch nor am I associated with their forums, it was just an excuse to use BeautifulSoup.

## Installation
```
pip install areallyrandomcli_normalperson543
```
## Usage
To go into the TUI home page:
```
areallyrandomcli
```
You'll first see the forums homepage, to go to a forum, type the corresponding ID (like 1) and press enter.

Now, you'll be in a forum page. To go to the first topic, type #1 and press Enter. For the second topic, type #2, etc.

The following shortcuts are available for navigating the TUI:
```
of [forum ID] = Opens a forum
ot [topic ID] = Opens a topic
h = Goes to the homepage
bb = Goes back one parent page
n = Goes to the next forum/topic page
b = Goes back one forum/topic page
o = Opens the current page in the browser
p [number] = Jumps to a specific page in a forum/topic
#[number] = In a forum, goes to the n-th topic  
[number] = Goes to the forum/topic with that ID
```

### Using only the CLI part
Don't want to be stuck in the TUI? can open the homepage, forums and topics using only the terminal, without interacting with the TUI.

Print out the homepage:
```
areallyrandomcli gh
```

Print out a topic:
```
areallyrandomcli gt [topic ID]
```

Print out a forum:
```
areallyrandomcli gf [forum ID]
```


You can also type ``raw`` to get the raw output of any page just after it is parsed. I don't know how you would use that but it exists.