mystbin-py


Namemystbin-py JSON
Version 6.1.0 PyPI version JSON
download
home_pagehttps://github.com/PythonistaGuild/mystbin.py
SummaryA small simple wrapper around the mystb.in API.
upload_time2024-01-11 17:46:47
maintainer
docs_urlNone
authorAbstractUmbra
requires_python>=3.8,<4.0
licenseMIT
keywords mystbin paste
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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/PythonistaGuild/mystbin.py/actions/workflows/coverage_and_lint.yaml'>
        <img src='https://github.com/PythonistaGuild/mystbin.py/workflows/Type%20Coverage%20and%20Linting/badge.svg?branch=main' alt='Linting status' />
    </a>
    <a href='https://github.com/PythonistaGuild/mystbin.py/actions/workflows/build.yaml'>
        <img src='https://github.com/PythonistaGuild/mystbin.py/workflows/Build/badge.svg' alt='Build status' />
    </a>
</div>
<br>

A small simple wrapper around the [Mystb.in](https://mystb.in/) API. API docs can be found [here](https://api.mystb.in/docs).

Documentation for this wrapper can be found [here](https://mystbinpy.readthedocs.io/en/stable/).
If you want the docs for the `main` branch, those can be found [here](https://mystbinpy.readthedocs.io/en/latest/).

----------
### Features

- [x] - Creating pastes.
  - [ ] Supporting attachments.
- [ ] - Editing pastes.
    - Pending design work.
- [x] - Deleting pastes.
- [x] - Getting pastes.
- [ ] - User endpoints.
- [ ] - Sync client.
  - This one will take some time as I have no motivation to do it, but PRs are welcome if others want to do it.

### 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
```

Installing from source:
```shell
python -m pip install git+https://github.com/PythonistaGuild/mystbin.py.git
```

### Usage examples

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

client = mystbin.Client()

paste = await client.create_paste(filename="Hello.txt", content="Hello there!")
# we also support passing a mystbin.File directly to the `file=` kwarg!

str(paste)
>>> 'https://mystb.in/<your generated ID>'

get_paste = await client.get_paste("<your generated ID>")
get_paste.files[0].content
>>> "Hello there!"

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

Or if you want to create a paste with multiple files...
```py
import mystbin

file = mystbin.File(filename="File1.txt", content="Hello there!")
file2 = mystbin.File(filename="test.py", content="print('hello!')")

paste = await client.create_paste(files=[file, file2])

for file in paste.files:
    print(file.content)

>>> "Hello there!"
>>> "print('hello!')"
```

If you have any question please feel free to join the Pythonista Discord server:
<div align="left">
    <a href="https://discord.gg/RAKc3HF">
        <img src="https://discordapp.com/api/guilds/490948346773635102/widget.png?style=banner2" alt="Discord Server"/>
    </a>
</div>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PythonistaGuild/mystbin.py",
    "name": "mystbin-py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "mystbin,paste",
    "author": "AbstractUmbra",
    "author_email": "umbra@abstractumbra.dev",
    "download_url": "https://files.pythonhosted.org/packages/38/70/d8de5f20fd4584a5a1790e4d16b6026c35b50cdad2048946a49b4a1d1a28/mystbin_py-6.1.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n    <h1>Mystbin.py!</h1>\n    <a href='https://mystbinpy.readthedocs.io/en/latest/?badge=latest'>\n        <img src='https://readthedocs.org/projects/mystbinpy/badge/?version=latest' alt='Documentation Status' />\n    </a>\n    <a href='https://github.com/PythonistaGuild/mystbin.py/actions/workflows/coverage_and_lint.yaml'>\n        <img src='https://github.com/PythonistaGuild/mystbin.py/workflows/Type%20Coverage%20and%20Linting/badge.svg?branch=main' alt='Linting status' />\n    </a>\n    <a href='https://github.com/PythonistaGuild/mystbin.py/actions/workflows/build.yaml'>\n        <img src='https://github.com/PythonistaGuild/mystbin.py/workflows/Build/badge.svg' alt='Build status' />\n    </a>\n</div>\n<br>\n\nA small simple wrapper around the [Mystb.in](https://mystb.in/) API. API docs can be found [here](https://api.mystb.in/docs).\n\nDocumentation for this wrapper can be found [here](https://mystbinpy.readthedocs.io/en/stable/).\nIf you want the docs for the `main` branch, those can be found [here](https://mystbinpy.readthedocs.io/en/latest/).\n\n----------\n### Features\n\n- [x] - Creating pastes.\n  - [ ] Supporting attachments.\n- [ ] - Editing pastes.\n    - Pending design work.\n- [x] - Deleting pastes.\n- [x] - Getting pastes.\n- [ ] - User endpoints.\n- [ ] - Sync client.\n  - This one will take some time as I have no motivation to do it, but PRs are welcome if others want to do it.\n\n### Installation\nThis project will be on [PyPI](https://pypi.org/project/mystbin.py/) as a stable release, you can always find that there.\n\nInstalling via `pip`:\n```shell\npython -m pip install -U mystbin.py\n```\n\nInstalling from source:\n```shell\npython -m pip install git+https://github.com/PythonistaGuild/mystbin.py.git\n```\n\n### Usage examples\n\n```py\n# async example - it will default to async\nimport mystbin\n\nclient = mystbin.Client()\n\npaste = await client.create_paste(filename=\"Hello.txt\", content=\"Hello there!\")\n# we also support passing a mystbin.File directly to the `file=` kwarg!\n\nstr(paste)\n>>> 'https://mystb.in/<your generated ID>'\n\nget_paste = await client.get_paste(\"<your generated ID>\")\nget_paste.files[0].content\n>>> \"Hello there!\"\n\nget_paste.created_at\n>>> datetime.datetime(2020, 10, 6, 10, 53, 57, 556741)\n```\n\nOr if you want to create a paste with multiple files...\n```py\nimport mystbin\n\nfile = mystbin.File(filename=\"File1.txt\", content=\"Hello there!\")\nfile2 = mystbin.File(filename=\"test.py\", content=\"print('hello!')\")\n\npaste = await client.create_paste(files=[file, file2])\n\nfor file in paste.files:\n    print(file.content)\n\n>>> \"Hello there!\"\n>>> \"print('hello!')\"\n```\n\nIf you have any question please feel free to join the Pythonista Discord server:\n<div align=\"left\">\n    <a href=\"https://discord.gg/RAKc3HF\">\n        <img src=\"https://discordapp.com/api/guilds/490948346773635102/widget.png?style=banner2\" alt=\"Discord Server\"/>\n    </a>\n</div>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A small simple wrapper around the mystb.in API.",
    "version": "6.1.0",
    "project_urls": {
        "Homepage": "https://github.com/PythonistaGuild/mystbin.py",
        "Issue Tracker": "https://github.com/PythonistaGuild/mystbin.py/issues",
        "Repository": "https://github.com/PythonistaGuild/mystbin.py"
    },
    "split_keywords": [
        "mystbin",
        "paste"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e71030e43553ab31c4468022bb4a85849d9d1bc2644f77e1b46b62859b45c102",
                "md5": "47722f7dfc060467bd4f0ad479c4f276",
                "sha256": "747c90be69b766b5e1b96a77a37ade6eec9e3b1ae83a9209193215b977f7fdcd"
            },
            "downloads": -1,
            "filename": "mystbin_py-6.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "47722f7dfc060467bd4f0ad479c4f276",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 17489,
            "upload_time": "2024-01-11T17:46:45",
            "upload_time_iso_8601": "2024-01-11T17:46:45.988532Z",
            "url": "https://files.pythonhosted.org/packages/e7/10/30e43553ab31c4468022bb4a85849d9d1bc2644f77e1b46b62859b45c102/mystbin_py-6.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3870d8de5f20fd4584a5a1790e4d16b6026c35b50cdad2048946a49b4a1d1a28",
                "md5": "56bb837f77d054c2b56acdc3986a72c0",
                "sha256": "6a8a7ef5846a0fb718010371f768004eec815c4b9241c10f1a043cb9f2ce26e8"
            },
            "downloads": -1,
            "filename": "mystbin_py-6.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "56bb837f77d054c2b56acdc3986a72c0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 10923,
            "upload_time": "2024-01-11T17:46:47",
            "upload_time_iso_8601": "2024-01-11T17:46:47.858295Z",
            "url": "https://files.pythonhosted.org/packages/38/70/d8de5f20fd4584a5a1790e4d16b6026c35b50cdad2048946a49b4a1d1a28/mystbin_py-6.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-11 17:46:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PythonistaGuild",
    "github_project": "mystbin.py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mystbin-py"
}
        
Elapsed time: 0.16490s