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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pastebin_replace-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f171c86a1a87acb04bbf5f2ccc108b15b67a2c4c3121597a5c773ac4e845e17 |
|
MD5 | a49b4e0b4a74baf563e12a3a817b5237 |
|
BLAKE2b-256 | 2c0586e0eda3897c59f1c3ba155cca0dd7c89e63fcc32cfbb5ddb4e3b9404ef5 |