Skip to content

Python-SDK

安装

bash
pip install fastposter
pip install fastposter

示例代码

token应用中心获取

python
from fastposter import Client

client = Client('1f5aa8d75f2d4bc4')
params = {
    'name': '中文测试'
}
client.buildPoster("ced9b1d5337d494c", params=params).save()
from fastposter import Client

client = Client('1f5aa8d75f2d4bc4')
params = {
    'name': '中文测试'
}
client.buildPoster("ced9b1d5337d494c", params=params).save()
python
from fastposter import Client

client = Client('1f5aa8d75f2d4bc4', 'http://127.0.0.1:5000')
params = {
    'name': '中文测试'
}
client.buildPoster("ced9b1d5337d494c", params=params).save()
from fastposter import Client

client = Client('1f5aa8d75f2d4bc4', 'http://127.0.0.1:5000')
params = {
    'name': '中文测试'
}
client.buildPoster("ced9b1d5337d494c", params=params).save()

生成的海报图片

常见问题

安装失败

有时候国内镜像同步比较慢,使用官方地址即可

bash
pip install fastposter -i https://pypi.org/simple
pip install fastposter -i https://pypi.org/simple
bash
pip install fastposter -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install fastposter -i https://pypi.tuna.tsinghua.edu.cn/simple
bash
pip install fastposter -i https://mirrors.aliyun.com/pypi/simple
pip install fastposter -i https://mirrors.aliyun.com/pypi/simple
bash
pip install fastposter -i https://pypi.douban.com/simple
pip install fastposter -i https://pypi.douban.com/simple