Skip to main content

PyPitravel

PyPI version Python version License

PyPitravel 是一个用于解析旅行规划平台《圆周旅迹》数据、提供行程规划导出与可视化的工具。

项目由来

由于“圆周旅迹”仅提供 iOS 客户端,导致在电脑端进行复杂的行程规划与整理非常不便。本项目旨在通过解析其 API 数据,在电脑端实现行程的可视化导出与整理。

核心功能

  • 智能解析: 自动从旅行行程链接中提取行程 ID,并支持航班交通信息的精简备注。
  • API 代理: 安全地获取旅行规划平台数据,绕过 CORS 跨域拦截。
  • 本地部署: 提供轻量级的本地 Web 服务。
  • 可视化分析: 支持交互式地图轨迹绘制,区分飞机/火车/驾车/步行路线,支持日期筛选。
  • 数据导出: 支持将行程规划数据导出为 XLSX 格式,方便在 Excel 中进行编辑与打印。
  • 双模式启动: 支持浏览器模式和 WebView2 桌面窗口模式。

快速上手

安装

浏览器模式(默认):

pip install pypitravel

桌面窗口模式(WebView2):

pip install pypitravel[gui]

桌面窗口模式依赖 WebView2 运行时,Windows 10 20H2+ 和 Windows 11 已预装。如未安装,请参考 Microsoft WebView2 下载。

启动

浏览器模式

pypitravel

程序会自动寻找可用端口(默认 8000)并唤起浏览器,无需手动输入地址。

桌面窗口模式

pypitravel --gui

程序会在 WebView2 桌面窗口中启动,无需浏览器,体验接近原生应用。

快速执行 (无需安装)

如果你安装了 uv,可以使用 uvx 直接运行,无需手动安装:

# 浏览器模式
uvx pypitravel

# 桌面窗口模式
uvx --from 'pypitravel[gui]' pypitravel --gui

命令行参数

参数 说明 默认值
-p, --port 服务端口号 8000
--cache-dir 自定义缓存目录路径 ~/.pypitravel/cache/
--gui 使用 WebView2 桌面窗口启动 -
--no-browser 启动时不自动打开浏览器 -

示例:

# 使用 9000 端口
pypitravel -p 9000

# 使用自定义缓存目录
pypitravel --cache-dir /path/to/cache

# 桌面窗口模式
pypitravel --gui

# 桌面窗口模式 + 自定义端口
pypitravel --gui -p 9000

快速执行 (无需安装)

如果你安装了 uv,可以使用 uvx 直接运行,无需手动安装:

uvx pypitravel

从源码安装 (开发者)

如果你需要进行二次开发或修改源码:

  1. 环境要求:Python >= 3.12,安装 uv。
  2. 克隆项目并安装依赖:
    uv sync
    
  3. 运行项目:
    uv run pypitravel
    

应用预览

路线地图

路线地图

技术栈

  • 后端: FastAPI, httpx
  • 前端: HTML, JavaScript, Tailwind CSS, SheetJS, MapLibre GL JS
  • 地图: MapLibre GL JS + OpenFreeMap + OSRM 路由
  • 桌面窗口: pywebview + WebView2 (可选)
  • 依赖管理: uv

许可证

本项目采用 Apache License 2.0 开源。

免责声明

PyPitravel 仅供个人学习与研究使用。所调用的 Pitravel 服务为商业软件,其 API 和数据归原平台所有。

  • 本项目不承担任何因使用本项目而导致的平台服务条款违反责任。
  • 严禁将本项目用于任何商业用途或大规模自动化抓取。
  • 使用时请遵守目标平台的相关服务条款与隐私政策。

Metadata

Release files for pypitravel 1.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypitravel 1.1.10
File Size Uploaded Provenance Actions
pypitravel-1.1.10.tar.gz 1.9 MB With provenance Details for pypitravel-1.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pypitravel 1.1.10
File Interpreter ABI Platform Actions
pypitravel-1.1.10-py3-none-any.whl Python 3 none any Details for pypitravel-1.1.10-py3-none-any.whl

Total release size: 1.9 MB

Release files / pypitravel-1.1.10.tar.gz

Download URL pypitravel-1.1.10.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
0865df786bdd6241795e72069a34b44c163fef0b6faa43baecea887ab9d50a8f
BLAKE2b-256 checksum
How to use checksums
234784377ef03853ec87aca73e8dbfc691a616b8864d9db2ccce64e8706136bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release files / pypitravel-1.1.10-py3-none-any.whl

Download URL pypitravel-1.1.10-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1c679342db6bcbb00170661313bd9846f433a188739b2902a9d74b3941073a7
BLAKE2b-256 checksum
How to use checksums
43207354f90b405d584ea69f7f249cb3f4a667b6affe790a8370658e30c2d4e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Security for pypitravel 1.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pypitravel-1.1.10.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page