pastes


Namepastes JSON
Version 1.5.1 PyPI version JSON
download
home_pageNone
SummaryMinimalistic Python client for pastes.dev
upload_time2025-08-24 15:13:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords paste pastes pastes.dev code pastebin client share send
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![pasters](https://github.com/RimMirK/pastes/blob/main/.github/logo+name_pypi.png)

[![PyPI](https://img.shields.io/pypi/v/pastes?color=blue&label=PyPI)](https://pypi.org/project/pastes/)
[![Python](https://img.shields.io/pypi/pyversions/pastes.svg?logo=python&logoColor=yellow)](https://pypi.org/project/pastes/)
[![License](https://img.shields.io/github/license/RimMirK/pastes?color=green)](LICENSE)
[![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)

Minimalistic Python client for [pastes.dev](https://pastes.dev/)
Share your code in seconds with a simple function call.  

---

## ✨ Features
- 🌀 Both **sync** and **async** APIs  
- ⚡ One-liner usage  
- 📤 Returns instant paste URL  
- 🐍 Pure Python, only requests and httpx are required

---

## 📦 Installation
```sh
pip install pastes
```

---

## ⚡ Usage

### 🔹 Sync

```py
from pastes import paste, get_paste, _set_api_url, _set_user_agent

# set custom API endpoint (optional)
_set_api_url("https://my-api.example.com")

# set custom user agent (optional)
_set_user_agent("My project/1.0.0")

code = """
def fib(n):
    a, b = 0, 1
    while a < n:
        print(a, end=' ')
        a, b = b, a+b
    print()
fib(1000)
"""

# create paste
url = paste(code)
print(url)  # https://pastes.dev/UUHlliP7SF

# fetch paste
print(get_paste(url))  # def fib(n): ...
```

### 🔹 Async

```py
from pastes import apaste, aget_paste, _set_api_url, _set_user_agent
import asyncio

# set custom API endpoint (optional)
_set_api_url("https://my-api.example.com")

# set custom user agent (optional)
_set_user_agent("My project/1.0.0")

code = """
def fib(n):
    a, b = 0, 1
    while a < n:
        print(a, end=' ')
        a, b = b, a+b
    print()
fib(1000)
"""

async def main():
    # create paste
    url = await apaste(code)
    print(url)  # https://pastes.dev/UUHlliP7SF

    # fetch paste
    text = await aget_paste(url)
    print(text) # def fib(n): ...

asyncio.run(main())
```

## 👨‍💻 Author

Made with ❤️ by [@RimMirK](https://t.me/RimMirK)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pastes",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "paste, pastes, pastes.dev, code, pastebin, client, share, send",
    "author": null,
    "author_email": "RimMirK <me@RimMirK.pp.ua>",
    "download_url": "https://files.pythonhosted.org/packages/9d/52/6a5cb93f839eb2cc9cfd255aa7f86bbeb0d12d2ee0676d0ac60b6e17460a/pastes-1.5.1.tar.gz",
    "platform": null,
    "description": "![pasters](https://github.com/RimMirK/pastes/blob/main/.github/logo+name_pypi.png)\n\n[![PyPI](https://img.shields.io/pypi/v/pastes?color=blue&label=PyPI)](https://pypi.org/project/pastes/)\n[![Python](https://img.shields.io/pypi/pyversions/pastes.svg?logo=python&logoColor=yellow)](https://pypi.org/project/pastes/)\n[![License](https://img.shields.io/github/license/RimMirK/pastes?color=green)](LICENSE)\n[![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)\n\nMinimalistic Python client for [pastes.dev](https://pastes.dev/)\nShare your code in seconds with a simple function call.  \n\n---\n\n## \u2728 Features\n- \ud83c\udf00 Both **sync** and **async** APIs  \n- \u26a1 One-liner usage  \n- \ud83d\udce4 Returns instant paste URL  \n- \ud83d\udc0d Pure Python, only requests and httpx are required\n\n---\n\n## \ud83d\udce6 Installation\n```sh\npip install pastes\n```\n\n---\n\n## \u26a1 Usage\n\n### \ud83d\udd39 Sync\n\n```py\nfrom pastes import paste, get_paste, _set_api_url, _set_user_agent\n\n# set custom API endpoint (optional)\n_set_api_url(\"https://my-api.example.com\")\n\n# set custom user agent (optional)\n_set_user_agent(\"My project/1.0.0\")\n\ncode = \"\"\"\ndef fib(n):\n    a, b = 0, 1\n    while a < n:\n        print(a, end=' ')\n        a, b = b, a+b\n    print()\nfib(1000)\n\"\"\"\n\n# create paste\nurl = paste(code)\nprint(url)  # https://pastes.dev/UUHlliP7SF\n\n# fetch paste\nprint(get_paste(url))  # def fib(n): ...\n```\n\n### \ud83d\udd39 Async\n\n```py\nfrom pastes import apaste, aget_paste, _set_api_url, _set_user_agent\nimport asyncio\n\n# set custom API endpoint (optional)\n_set_api_url(\"https://my-api.example.com\")\n\n# set custom user agent (optional)\n_set_user_agent(\"My project/1.0.0\")\n\ncode = \"\"\"\ndef fib(n):\n    a, b = 0, 1\n    while a < n:\n        print(a, end=' ')\n        a, b = b, a+b\n    print()\nfib(1000)\n\"\"\"\n\nasync def main():\n    # create paste\n    url = await apaste(code)\n    print(url)  # https://pastes.dev/UUHlliP7SF\n\n    # fetch paste\n    text = await aget_paste(url)\n    print(text) # def fib(n): ...\n\nasyncio.run(main())\n```\n\n## \ud83d\udc68\u200d\ud83d\udcbb Author\n\nMade with \u2764\ufe0f by [@RimMirK](https://t.me/RimMirK)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Minimalistic Python client for pastes.dev",
    "version": "1.5.1",
    "project_urls": {
        "Repository": "https://github.com/RimMirK/pastes"
    },
    "split_keywords": [
        "paste",
        " pastes",
        " pastes.dev",
        " code",
        " pastebin",
        " client",
        " share",
        " send"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6db0e22e614cef39e9eadd580bc2d141b5d2cb1aa9c939c81139e7dc34520d3a",
                "md5": "75087fd384f2f8f3544a3d3837868a37",
                "sha256": "5270e4eb23a622d6620ff90269c6fe58de1bf2343b193de6218ea9dee6dc6dd0"
            },
            "downloads": -1,
            "filename": "pastes-1.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75087fd384f2f8f3544a3d3837868a37",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 16589,
            "upload_time": "2025-08-24T15:13:19",
            "upload_time_iso_8601": "2025-08-24T15:13:19.841291Z",
            "url": "https://files.pythonhosted.org/packages/6d/b0/e22e614cef39e9eadd580bc2d141b5d2cb1aa9c939c81139e7dc34520d3a/pastes-1.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9d526a5cb93f839eb2cc9cfd255aa7f86bbeb0d12d2ee0676d0ac60b6e17460a",
                "md5": "83c6603441248027523f8fd71173caab",
                "sha256": "8936597d159783e6ac61d5f8d5f6b50cf61a5a7fe25a4c243624b783e1b1f270"
            },
            "downloads": -1,
            "filename": "pastes-1.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "83c6603441248027523f8fd71173caab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 16298,
            "upload_time": "2025-08-24T15:13:20",
            "upload_time_iso_8601": "2025-08-24T15:13:20.641713Z",
            "url": "https://files.pythonhosted.org/packages/9d/52/6a5cb93f839eb2cc9cfd255aa7f86bbeb0d12d2ee0676d0ac60b6e17460a/pastes-1.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-24 15:13:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RimMirK",
    "github_project": "pastes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pastes"
}
        
Elapsed time: 1.38527s