

[](https://pypi.org/project/pastes/)
[](https://pypi.org/project/pastes/)
[](LICENSE)
[](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/5f/4d/a7d3562c3cd24447e3702b736f0c8b5ee6d7180fcacf912e3dbf8b4039ca/pastes-1.5.0.tar.gz",
"platform": null,
"description": "\n\n\n[](https://pypi.org/project/pastes/)\n[](https://pypi.org/project/pastes/)\n[](LICENSE)\n[](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\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Minimalistic Python client for pastes.dev",
"version": "1.5.0",
"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": "d13f2684065b5ee75c28cccc43b3b18a94b6f477138377688520e9fa3e9bf767",
"md5": "52758f7e8f83ccc303bab3f932754cb3",
"sha256": "e19a5be36c4a9ac16b1279dacda463c627085e7ae2a3da0ffe2c8a76a89948e7"
},
"downloads": -1,
"filename": "pastes-1.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "52758f7e8f83ccc303bab3f932754cb3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 16609,
"upload_time": "2025-08-24T11:27:36",
"upload_time_iso_8601": "2025-08-24T11:27:36.481949Z",
"url": "https://files.pythonhosted.org/packages/d1/3f/2684065b5ee75c28cccc43b3b18a94b6f477138377688520e9fa3e9bf767/pastes-1.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5f4da7d3562c3cd24447e3702b736f0c8b5ee6d7180fcacf912e3dbf8b4039ca",
"md5": "82ba7b1b22df5c08f21ddf562cc85292",
"sha256": "7ef2213b3db54be4961b7bf607e40deeb76b5cb3fc685dd71d0a92062a3e7080"
},
"downloads": -1,
"filename": "pastes-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "82ba7b1b22df5c08f21ddf562cc85292",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 16190,
"upload_time": "2025-08-24T11:27:37",
"upload_time_iso_8601": "2025-08-24T11:27:37.545749Z",
"url": "https://files.pythonhosted.org/packages/5f/4d/a7d3562c3cd24447e3702b736f0c8b5ee6d7180fcacf912e3dbf8b4039ca/pastes-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-24 11:27:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "RimMirK",
"github_project": "pastes",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pastes"
}