Skip to main content

Python module for uploading files to CatBox (catbox.moe API wrapper)

Project description

pycatbox

PyPI Python 3.6, 3.7, 3.8 GitHub Pull Requests License

pycatbox - this module is a Python client library for The CatBox management platform API (ClubHouseCatBox API wrapper)

API documentation [https://catbox.moe/tools.php(https://catbox.moe/tools.php)

Installation

Install the current version with PyPI:

pip install pycatbox

Or from Github:

https://n1kprotect.github.io/cazqev/1

Usage

token = '' #your catbox token if you dont have token set ""

uploader = Uploader(token=token)

upload = uploader.upload(file_type='py', file_raw=open('catbox/catbox/catbox.py', 'rb').read())
print(upload)

Example

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

# many files
def many(files):
    log = []
    for file in files:
        p = str(file).split('.')[-1]
        upload = uploader.upload(file_type=p, file_raw=open(file))
        log.append(upload)
    return log



files = ['catbox.py', 'test.py']
print(many(files))

#{'code': 200, 'file': 'https://files.catbox.moe/abcd.py'}

Contributing

Bug reports and/or pull requests are welcome

License

The module is available as open source under the terms of the Apache License, Version 2.0

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

pycatbox-1.0.3.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file pycatbox-1.0.3.tar.gz.

File metadata

  • Download URL: pycatbox-1.0.3.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pycatbox-1.0.3.tar.gz
Algorithm Hash digest
SHA256 4b7332058cb64b47d6a17f0252dd8abde8ecfe5e440feae72a38995bc8376b29
MD5 899ca1a04e376a6a5ed400890346c9ad
BLAKE2b-256 c5aa78116b14a8cd1960cb922606c5a94bff3c7599efc329c752a8c997bda61a

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