semvec/pypi-packages huggingface dataset:
MailTMClient 0.0.5
A Client to easily interact with the MailTM API
Requires Python: >=3.6


# MailTMClient
I would like to bring to your attention the user-friendly MailTMClient package, specifically designed to facilitate seamless communication with the mail.tm API. With its comprehensive set of functions, it emerges as the only Python-based solution out there that fully embraces all the API's offerings. We hope this information will prove useful to you.
My mail.tm console client is based on the MailTMClient and in the [source code of its main.py](https://github.com/RPwnage/binify/blob/main/main.py) file you can see the ease of use of MailTMclient from an example.

## Registering a new Account and logging in

Using the code below, a new account can be created. 

    from MailTMClient import MailTMClient
    (responseCode, response) = MailTMClient().register(args.address, args.password)
        if responseCode == 0:
            print("[i] Successfully created an MailTM Account!")
            saveTokenToFile(response)
        if responseCode != 0:
            print("[!] Failed to create an MailTM Account! (" + str(response) + ")")

Following a successful account creation, the response variable will contain the tokens required for future application access. In order to log in to an existing account, please proceed accordingly.

    (responseCode, response) =  MailTMClient().login(args.address, args.password)
pyfetch-wrapper 0.0.1
Wrapper for pyodide.http.pyfetch to enable one set of http calls for both local and pyodide executions.

# py-shinylive-alt-fetch
- Ultimate goal:

- Develope like this:
```python
# from pyodide import http
from pyodide_local import http

async api_call():
    r = await http.pyfectch(
        url: "http://localhost:8000/get-string",
        headers: {"Content-Type": "application/text"}
    )
    print(r.string())
```

- When deploying to Shinylive, just switch the commented imports
```python
from pyodide import http
# from pyodide_local import http
```

## How to use wrapper
- requirements: see `pyproject.toml`; the goal is for shiny/shinylive to be the only requirements

## pyfetch examples

```python
# Download, save extracted file to local virtual fs
from pyodide.http import pyfetch
response = await pyfetch("https://some_url/myfiles.zip")
await response.unpack_archive()
```

```python
# Download text file to local virtual fs, load into pandas
from pyodide.http import pyfetch

response = await pyodide.http.pyfetch(url())

with open("test.json", mode="wb") as file:
    file.write(await response.bytes())

df = pd.read_json("test.json")
```

```python
# Download text file into BytesIO memory buffer, load into pandas
from io import BytesIO
from pyodide.http import pyfetch

response = await pyodide.http.pyfetch(url())
buf = BytesIO(await response_c.bytes())

df = pd.read_json(buf)
```

## Install Test Dependencies
- `pip install -e '.[tests]'`

### Run regular tests
- activate venv: `source venv/bin/activate`
- start fastapi app: `python3 src_test_webserver/main.py`
- run pytest: `pytest -vv -x test`

### Run pyodide tests with pyfetch calls written identical to wrapper
- activate venv and start fastapi like above
- export shinylive app: `shinylive export ./test/tests_shinylive ./src_test_webserver/shinyapps`
- open shinylive app in edit mode: `http://localhost8000/apps/edit/`
- Click "Run tests"
- If all function names at the bottom are followed by "passed", then everything should be ok