Async version of pycatbox, a Python API wrapper for catbox.moe.
Reason this release was yanked:
Bug relating to installing from Pypi
Project description
async_pycatbox
A simple Python library for uploading files to catbox.moe, and based off of cazqew's pycatbox, with the only significant change being that it's now supports asynchronous uploading.
API documentation https://catbox.moe/tools.php
Install the current version with PyPI:
pip install async_pycatbox
Or from Github:
https://github.com/challos/async_pycatbox
Usage
token = '' # this is your token, and it will default to an empty string (which is fine for catbox) if not set
uploader = Uploader(token=token)
upload = uploader.upload(file_type='py', file_raw=open('catbox/catbox/catbox.py', 'rb').read())
print(upload)
## Example
```python
from pycatbox import Uploader
uploader = Uploader(token='')
# single file
def single():
upload = uploader.upload(file_type='py', file_raw=open('catbox/catbox/catbox.py', 'rb').read())
return upload
# multiple files
def multiple(files):
log = []
for file in files:
extension = str(file).split('.')[-1]
upload = uploader.upload(file_type=extension, file_raw=open(file))
log.append(upload)
return log
files = ['catbox.py', 'test.py']
print(multiple(files))
#{'code': 200, 'file': 'https://files.catbox.moe/abcd.py'}
Contributing
Bug reports and/or pull requests are welcome. I also copied most of this with minor changes/additions from cazqew's pycatbox (I was unable to make a pull/fork request due to being unable to find his Github page).
License
The module is available as open source under the terms of the Apache License, Version 2.0
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
File details
Details for the file async_pycatbox-1.0.tar.gz
.
File metadata
- Download URL: async_pycatbox-1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84005df6b49d7f6eadc7fbe9d01df6f502a6d3198fa90e91764f299cba49137a |
|
MD5 | a4409a32463e9d61f6c11b016489c506 |
|
BLAKE2b-256 | ac9c919f99ec1c09ed987be9e9ca861a5532fb4212809659c27af9a290c66ef0 |
File details
Details for the file async_pycatbox-1.0-py3-none-any.whl
.
File metadata
- Download URL: async_pycatbox-1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ed4fc7215141ec8bb90fc795982adb17fc4808046a41716b324d83055fef835 |
|
MD5 | 3dfa0ec284ff1099f74b32164f5410b0 |
|
BLAKE2b-256 | b76fb185619f42176e2dd22e1ea42bcb03dbf81d97dc38f8019118fe9be2abcf |