Small, simple python package to replace a file with raw code from Pastebin.
pip install .
pip install pastebin-replace
pbreplace(path, link)
pbreplace <path> <link>
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
Replaced file can't be recovered. Be careful on the path you provided.
Why did I make this? I need this package for a specific usage in my Google Colab workflow.
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.