Skip to main content

图床上传工具

Project description

介绍

在上传图片的时候, 经常会用到图床功能.

此工具聚合了一些常用的图床, 以便于快速使用. 免费图床大部分都不支持定义文件名称

说明

因为使用各种免费服务, 稳定性无法保证

若各位在使用过程中碰到问题, 欢迎下列任选一种方式补充:

  1. 提交isuse说明问题
  2. 将问题写到DepotType的对应文档上

如果你有其他优秀的图床推荐, 欢迎提交isusePR

当前支持的所有图床, 可查看文件DepotType

使用

安装:

pip install image-depot
from image_depot import image_depot, DepotType, upload, upload_file, DepotConfig

# 部分图床需要添加配置才能使用
token = ''
DepotConfig.SmMs(token)

# 选择图床对象
d = image_depot(DepotType.CatBox)

# 上传图片. 二进制内容
image_content = ''
image_url = d.upload(image_content)
if not image_url:  # 图片上传失败, 获取失败原因
    print(d.error())
# 上传图片, 使用本地文件路径
file_path = ''
image_url = d.upload_file(file_path)

# 依次尝试所有图床, 返回第一个成功的. 
url, err = upload(image_content)
upload_file(file_path)

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

image_depot-0.7.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

image_depot-0.7.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file image_depot-0.7.2.tar.gz.

File metadata

  • Download URL: image_depot-0.7.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for image_depot-0.7.2.tar.gz
Algorithm Hash digest
SHA256 e77f8353094a3271fc01a6364a968a5069cc1011ecf35d54b449f248470cfe6d
MD5 535e963a3e6624b1b1946d6105f8cee1
BLAKE2b-256 f959cc55b4c37e1879e1df2371cb9255f6a8aa91393d06ed9205b4c67a9f2753

See more details on using hashes here.

File details

Details for the file image_depot-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: image_depot-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for image_depot-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a2fff3d0d2f848c4bbc2dfd8f493caf4b54bd4f7493754a4338ae46165e16af
MD5 7f22af3c059061a4a73d47a65ea48a61
BLAKE2b-256 366c6935c6487d0f8e8b0f3092d6fba2d9f4ddf375cf5ffc99f87964ab981308

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page