Skip to main content

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.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

fastzdp_upload-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file fastzdp_upload-0.1.0.tar.gz.

File metadata

  • Download URL: fastzdp_upload-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Windows/10

File hashes

Hashes for fastzdp_upload-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abd5b6e076f9b0b05a4cb21de92fa209482323040a871e9d5d1a3e04d23531a2
MD5 cea6403592a687a8fb0a90479b510d2c
BLAKE2b-256 5e4c715984149abce4682f9c75c16a031f5aada62d0abadb54e5b56620063d4e

See more details on using hashes here.

File details

Details for the file fastzdp_upload-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fastzdp_upload-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Windows/10

File hashes

Hashes for fastzdp_upload-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f53c4812f2054bce21778aee0896061a24574143562213e3df5bf44e1344b3d
MD5 1c264db0dab9991114db5750e5f66333
BLAKE2b-256 b8be64f830104140a0b1f1f96f918fcf4c34fe6de4f28949c303f7a43e6dde6d

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