Using Pastebin pastes as if they were files
Project description
Pastebin.com as a python file object
A small python library with little dependencies to use pastebin.com as file like objects Don't take it serious it's just a project to have some fun
TODO
- Add support for none buffered files
- Add encoding options
- Add missing tests
install
git
pip install .
pypi
pip install pastebinfs
Example
user_key = pastebinfs.sync.pastebin_auth(api_key, username, password)
with pastebinfs.sync.pastebin_open("test.txt", "w", api_key, user_key) as f:
f.write("hello pastebin this is a test")
with pastebinfs.sync.pastebin_open("test.txt", "r", api_key, user_key) as f:
print(f.read()) # yields "hello pastebin this is a test"
print(pastebinfs.os.stat("test.txt", api_key, user_key))
# st_birthtime == 1297953260 # last update time
# st_key == '0b42rwhf' # paste key (this changes on every write)
# st_mode == 1 # paste visibility mode (unlisted)
# st_size == 29 # paste size (note in binary mode the size will be len(base64(input)))
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
pastebinfs-0.4.tar.gz
(8.8 kB
view details)
File details
Details for the file pastebinfs-0.4.tar.gz
.
File metadata
- Download URL: pastebinfs-0.4.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99746d38676d069c2253827b83b2658bb5ee7cf633e316824c68e50c0d653cec |
|
MD5 | f9a7671657e656008a3b316ba895f5ae |
|
BLAKE2b-256 | 9dc6f374ea03729a5a36edb88c6ac5abcc46df8c77496f6f166d87e4de2f8199 |