Metadata-Version: 2.1
Name: mystbin.py
Version: 4.0.2
Summary: A small simple wrapper around the mystb.in API.
Home-page: https://github.com/AbstractUmbra/mystbin-py
License: MIT
Keywords: mystbin,paste
Author: AbstractUmbra
Author-email: Umbra@AbstractUmbra.xyz
Requires-Python: >=3.9,<4.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Internet
Classifier: Typing :: Typed
Provides-Extra: docs
Provides-Extra: requests
Requires-Dist: aiohttp (>=3.7.4,<4.0.0)
Requires-Dist: furo; extra == "docs"
Requires-Dist: requests (>=2.24.0,<3.0.0); extra == "requests"
Requires-Dist: sphinx (>=4.0.0,<5.0.0); extra == "docs"
Requires-Dist: sphinxcontrib-trio; extra == "docs"
Project-URL: Issue Tracker, https://github.com/AbstractUmbra/mystbin.py/issues
Project-URL: Repository, https://github.com/AbstractUmbra/mystbin-py
Description-Content-Type: text/markdown

<div align="center">
    <h1>Mystbin.py!</h1>
    <a href='https://mystbinpy.readthedocs.io/en/latest/?badge=latest'>
        <img src='https://readthedocs.org/projects/mystbinpy/badge/?version=latest' alt='Documentation Status' />
    </a>
    <a href='https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Linting'>
        <img src='https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Linting/badge.svg?branch=main' alt='Linting status' />
    </a>
    <a href='https://github.com/AbstractUmbra/mystbin.py/workflows/Build'>
        <img src='https://github.com/AbstractUmbra/mystbin.py/workflows/Build/badge.svg' alt='Build status' />
    </a>
</div>
<br>

A small simple wrapper around the [MystB.in](https://mystb.in/) API.
----------
### Features

- [x] - `POST`ing to the API, which will return the provided url.
- [x] - `GET`ting from the API, provided you know the URL or paste ID.
- [ ] - `DELETE`ing from the API, provided the paste is attached to your account.
- [ ] - `PATCH`ing to the API, provided the paste is attached to your account.
- [x] - Ability to pass in a sync or async session / parameter so it is flexible.
- [x] - Write a real underlying Client for this, it will be required for...
- [ ] - ... Authorization. Awaiting the API making this public as it is still WIP.

### Installation
This project will be on [PyPI](https://pypi.org/project/mystbin.py/) as a stable release, you can always find that there.

Installing via `pip`:
```shell
python -m pip install -U mystbin.py
# or for optional sync addon...
python -m pip install -U mystbin.py[requests]
```

Installing from source:
```shell
python -m pip install git+https://github.com/AbstractUmbra/mystbin-py.git #[requests] for sync addon
```

### Usage examples
Since the project is considered multi-sync, it will work in a sync/async environment, see the optional dependency of `requests` below.

```py
# async example - it will default to async
import mystbin

mystbin_client = mystbin.Client()

paste = await mystbin_client.post("Hello from MystBin!", syntax="python")
str(paste)
>>> 'https://mystb.in/<your generated ID>.python'

paste.url
>>> 'https://mystb.in/<your generated ID>.python'

get_paste = await mystbin_client.get("https://mystb.in/<your generated ID>")
str(get_paste)
>>> "Hello from MystBin!"

paste.created_at
>>> datetime.datetime(2020, 10, 6, 10, 53, 57, 556741)
```

```py
import mystbin

mystbin_client = mystbin.SyncClient()

paste = mystbin_client.post("Hello from sync Mystb.in!", syntax="text")
str(paste)
>>> 'https://mystb.in/<your generated ID>.text'
```

NOTE: There is a timeout of 15s for each operation.

