Skip to main content

Minimalistic Python client for pastes.dev

Project description

Pastes

PyPI Python License StandWithUkraine

Minimalistic Python client for 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 required

📦 Installation

pip install pastes

⚡ Usage

🔹 Sync

from pastes import paste

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

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

🔹 Async

from pastes import apaste
import asyncio

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():
    url = await apaste(code)
    print(url)  # https://pastes.dev/UUHlliP7SF

asyncio.run(main())

👨‍💻 Author

Made with ❤️ by @RimMirK

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pastes-1.3.1.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pastes-1.3.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file pastes-1.3.1.tar.gz.

File metadata

  • Download URL: pastes-1.3.1.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pastes-1.3.1.tar.gz
Algorithm Hash digest
SHA256 b724376c2f2d471f736ba9325ced7c5d3ca5918dd4d96848de2db042f5d0d6d6
MD5 e32204d8db9fa4dab871bccc56dcdfd6
BLAKE2b-256 6b2edb1a5c3bc77c4d6571497b1befab21d273d3aa86a1468d75ad5e96ecde1a

See more details on using hashes here.

File details

Details for the file pastes-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: pastes-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pastes-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d06aa2fc94a861d41d4b6b3b002469fb90f518bbdba1ae2665bc4cfafe12433
MD5 b71200f04a4d58573bde8f520f10d0ca
BLAKE2b-256 9f2c2fb4282161dd1d39d0b88af8a319a138be893a5921062b6834d7ca958846

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page