No project description provided
Project description
fastzdp_upload
FastAPI文件上传下载的组件库。
使用本组件库,你将一行代码轻松拥有如下接口:
- 文件上传
- 文件下载
- 文件删除
- 获取文件列表
安装
pip install fastzdp_upload
使用
import fastzdp_upload
from fastapi import FastAPI
from sqlmodel import SQLModel, Field, create_engine, Session
# 创建数据库引擎
sqlite_url = "mysql+pymysql://root:root@127.0.0.1:3306/test?charset=utf8mb4"
engine = create_engine(sqlite_url, echo=True)
# 确保表存在
SQLModel.metadata.drop_all(engine)
SQLModel.metadata.create_all(engine)
def get_db():
db = Session(engine)
try:
yield db
finally:
db.close()
app = FastAPI()
app.include_router(fastzdp_upload.get_router(get_db))
if __name__ == '__main__':
import uvicorn
uvicorn.run(app, host='0.0.0.0', port=8000)
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
fastzdp_upload-0.1.1.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file fastzdp_upload-0.1.1.tar.gz
.
File metadata
- Download URL: fastzdp_upload-0.1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 114d8c273ded731fb8efb508ef9a0107fbf8a28b2120aebf2114ad707dfa8765 |
|
MD5 | d5f008a81722257f22634bb6ad419e81 |
|
BLAKE2b-256 | db1b01ddc471e57ba36ec30eae5a0f44df365cedf2e2adbf0873aff31ef555ab |
File details
Details for the file fastzdp_upload-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: fastzdp_upload-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a9af8e20ebacc18cb86f5e7a6bd9650f60603f9b4b1c6f5cba3269148306634 |
|
MD5 | 7c6f7f07d0ee2f9d86029bacaa898ea2 |
|
BLAKE2b-256 | d879b96294b80e847cfa1b916cd0eca2f74a7928dcfbf57a7778e148dbc0f132 |