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.4.0.tar.gz (15.5 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.4.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pastes-1.4.0.tar.gz
Algorithm Hash digest
SHA256 1c25fe1e7ee22d7b3e96947ead4eac65137719eedef1ff62ded0a40f986dc1ab
MD5 04f19936c05b28ef09b5caaefa7cb304
BLAKE2b-256 1976cc2ef21214de92dfded4f8b28cb65ddb46b524f7a79bd382082a95d6f235

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pastes-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d72a63e79ab198db265685b9f39557f84261925f68d0ba458d8cc94c18abe92f
MD5 0d8b5bbc522abbcd427178e0609b215e
BLAKE2b-256 543c63cee81ee22ab7c52efe1e521af765d4d398f35330ef056713964e492346

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