Skip to main content

Replace local files with code from a pastebin link

Project description

pastebin-replace

Small, simple python package to replace a file with raw code from Pastebin.

Installation

From Source

pip install .

With pip (PyPI)

pip install pastebin-replace

Usage

Within Python Script

pbreplace(path, link)

Terminal

pbreplace <path> <link>

Example

Suppose you have an empty file named test.txt located in C:\Users\Yourname\Downloads\test.txt. And you know a public Pastebin https://pastebin.com/hcv2WRnX containing some text. You want the content of test.txt to be like the text on the Pastebin link.

You can write this with Python:

from pastebin_replace import pbreplace

pbreplace(r"C:\Users\Yourname\Downloads\test.txt", "https://pastebin.com/hcv2WRnX")

Or directly from terminal:

pbreplace C:\Users\Yourname\Downloads\test.txt https://pastebin.com/hcv2WRnX

Note

Replaced file can't be recovered. Be careful on the path you provided.

Background

Why did I make this? I need this package for a specific usage in my Google Colab workflow.

Special Thanks

pastebin-as-file repo for the PyPI directory format. I'm a noob and just learned about Python package stuff tonight :D Also gdown for pyproject.toml and __main__.py reference.

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

pastebin_replace-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

pastebin_replace-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file pastebin_replace-0.1.1.tar.gz.

File metadata

  • Download URL: pastebin_replace-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pastebin_replace-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b4d06e024fd81ea904987efe760866d293143f5fa1c54482818006b467a0febb
MD5 92d4907e1dbe5340420451189d86da2a
BLAKE2b-256 8b5da3291ffb6f1398d89e982512116b428ad01317e8b980fac9cb4933b3bce8

See more details on using hashes here.

File details

Details for the file pastebin_replace-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pastebin_replace-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f171c86a1a87acb04bbf5f2ccc108b15b67a2c4c3121597a5c773ac4e845e17
MD5 a49b4e0b4a74baf563e12a3a817b5237
BLAKE2b-256 2c0586e0eda3897c59f1c3ba155cca0dd7c89e63fcc32cfbb5ddb4e3b9404ef5

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