Skip to main content

电商日报表格数据处理工具 — 读取电商平台导出的数据,按来源写入日报表格

Project description

tmailday

表格数据处理工具 — 读取导出的数据表格,按数据来源写入模板文件对应工作簿。

安装

uv pip install tmailday
# 或直接运行
uvx tmailday --help
uvx --extra-index-url https://heibai2006:45812c2769a5ac9eb2018cc19cf248c8940ef12f@git.des8.com/api/packages/ruichuang/pypi/simple tmailday

用法

CLI

# 校验模板
tmailday <模板文件>

# 处理单个数据文件,原地更新模板
tmailday <模板文件> <数据文件>

# 批量处理多个数据文件
tmailday <模板文件> <数据1> <数据2> ...

# 指定输出路径
tmailday <模板文件> <数据文件> -o <输出文件>

MCP Server

# stdio 模式
tmailday mcp

# HTTP(SSE) 模式
tmailday mcp --transport sse

在 MCP 客户端配置中添加:

{
  "mcpServers": {
    "tmailday": {
      "command": "uvx",
      "args": ["tmailday", "mcp"]
    }
  }
}

MCP Tools

Tool 说明
process_table(template_path, source_path, output_path?) stdio 本地路径,单文件处理
process_table_batch(template_path, source_paths, output_path?) stdio 本地路径,批量处理
process_table_data(template_data, template_filename, source_data, source_filename) base64 编码文件内容,单文件(SSE/HTTP 通用)
process_table_data_batch(template_data, template_filename, source_list) base64 编码文件内容,批量

HTTP 路由(SSE 模式下可用)

端点 方法 说明
/upload POST multipart 上传文件,返回临时路径 JSON
/process POST multipart 上传并直接处理,返回处理后的 xlsx 文件
/download/{token} GET 通过 token 下载已存储的文件

支持的数据类型

类型 格式 目标工作簿 匹配方式
日报 .xlsx B-日报 统计日期
生意参谋 .xls B-商品 统计日期 + 商品ID
商品报表 .zip (内含 .csv) B-无界 日期 + 场景ID

模板要求

模板文件为 .xlsx 格式,必须包含以下工作簿:

  • 月报、日报、B-日报、B-无界、B-商品

常用命令

uvx tmailday   #uvx运行
uvx --extra-index-url https://heibai2006:45812c2769a5ac9eb2018cc19cf248c8940ef12f@git.des8.com/api/packages/ruichuang/pypi/simple tmailday   #uvx运行(从自有服务器加载)
uv sync                    # 安装/同步依赖
uv run tmailday --help        # 查看 CLI 帮助
uv run tmailday <模板> <数据1> <数据2> ...          # 批量处理,原地更新模板
uv run tmailday <模板> <数据> -o <输出>              # 处理后输出到指定文件
uv run tmailday mcp         # 启动 MCP Server (stdio)
uv run tmailday mcp --transport sse  # 启动 MCP HTTP Server transport支持stdio,sse,streamable-http,http
uv add <package>           # 添加依赖

开发

git clone https://git.des8.com/ruichuang/rctmailday.git
cd rctmailday
uv sync
uv run tmailday --help
  • Python >= 3.12
  • 包管理器: uv
  • 框架: FastMCP

License

Copyright © 2026 瑞创. All rights reserved.

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

tmailday-0.1.6.tar.gz (7.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tmailday-0.1.6-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file tmailday-0.1.6.tar.gz.

File metadata

  • Download URL: tmailday-0.1.6.tar.gz
  • Upload date:
  • Size: 7.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tmailday-0.1.6.tar.gz
Algorithm Hash digest
SHA256 cab5779494db5a5e88d5450b697e328ce3ba9cc766b745e22b43022e5dca0dbb
MD5 2556a482a6763340c0141ec9fd3f0282
BLAKE2b-256 669d0e5441bce0bf4a2ccd8df97e81465912fa7f8e402f954634347e4d965015

See more details on using hashes here.

File details

Details for the file tmailday-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: tmailday-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tmailday-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 db016fe918993b2b305e931b88d7f6844c86a04ad111ad982650733eedf7672f
MD5 dd85186bc07e35f3619648d61cd4b0d0
BLAKE2b-256 87ac67239bdcd4daf03daf0cc8a51a800d1ff5f40c0052f260b229dd4945ae66

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