Metadata-Version: 2.4
Name: pvmd
Version: 0.0.6
Summary: 数据管理工作站：表格数据接入、清洗、统计分析与报表导出，提供 Web 与桌面两种界面
Author: EAD Suite
License-Expression: LicenseRef-Proprietary
Keywords: data,etl,clean,analysis,flask,tkinter
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: Flask>=3.0
Requires-Dist: pandas>=2.0
Requires-Dist: numpy>=1.24
Requires-Dist: matplotlib>=3.7
Requires-Dist: requests>=2.31
Requires-Dist: pyarrow>=14.0
Requires-Dist: polars>=0.20
Requires-Dist: Pillow>=10.0
Requires-Dist: scipy>=1.10
Requires-Dist: openpyxl>=3.1
Requires-Dist: python-docx>=1.1
Requires-Dist: pydantic>=2.0
Requires-Dist: fpdf2>=2.7
Requires-Dist: chardet>=5.0
Requires-Dist: json-repair>=0.28
Requires-Dist: tksheet>=7.0
Requires-Dist: pycryptodome>=3.19
Requires-Dist: waitress>=2.1.0
Provides-Extra: web
Provides-Extra: tk
Dynamic: license-file

# 智析数据

本机部署的数据管理工具，用于表格类数据的接入、清洗、统计分析、可视化与报表输出，
并按数据集粒度管理访问权限。数据文件、账户信息与授权记录均保存在本机，运行期间不向外部服务传输数据。

本页为双语：中文说明在前，英文说明自「Zhixi Data」一节起。

## 概述

系统由两个 Web 服务与一个桌面程序组成，通过同一条命令启动：

| 服务 | 默认端口 | 职责 |
| --- | --- | --- |
| webapp | 26800 | 数据接入、清洗、透视、图表与导出 |
| simpleweb | 26801 | 数据集管理、权限分配、审批与备份 |

桌面程序通过 `ezapp --tk` 启动，不占用端口，不依赖浏览器。

## 运行环境

- Python 3.8 及以上。
- 平台：Windows x64。安装包为预编译二进制包（`cp38-abi3-win_amd64`），安装时无需编译环境，
  适用于 64 位 CPython 3.8 及以上版本。不支持 32 位与 ARM 平台。
- 端口 26800 与 26801 需处于空闲状态。端口被占用时，可通过 `--port-web` 与
  `--port-simple` 指定其他端口。
- webapp 默认监听 `0.0.0.0`，局域网内其他主机可访问。simpleweb 固定监听 `127.0.0.1`，
  仅本机可访问。若需限制 webapp 仅本机访问，启动时指定 `--host 127.0.0.1`。

## 安装

```bash
pip install pvmd
```

webapp、simpleweb 与桌面程序均包含在该命令中，装完即可使用，无需再安装其他组件。
安装完成后提供 `ezapp` 与 `ezapptk` 两个命令行入口，前者启动两个 Web 服务，后者启动桌面程序。

## 启动

```bash
ezapp                    # 启动 webapp(26800) 与 simpleweb(26801)，并打开浏览器
ezapp --tk               # 启动桌面程序
ezapp --info             # 输出实际生效的目录路径，不启动服务
```

| 参数 | 说明 |
| --- | --- |
| `--port-web 26900` | 指定 webapp 端口 |
| `--port-simple 26901` | 指定 simpleweb 端口 |
| `--only web` / `--only simple` / `--only tk` | 仅启动单个服务，用于排查故障 |
| `--host 127.0.0.1` | 限制 webapp 仅监听本机 |
| `--no-browser` | 启动后不自动打开浏览器 |
| `--single-process` | 单进程双线程运行，用于子进程方式无法启动的环境 |
| `--reset-admin-password` | 将管理员口令重置为默认口令后退出 |

## 初始账户

首次启动后访问 <http://127.0.0.1:26800>，使用默认账户 `admin` 与默认口令 `easy123` 登录。
系统要求修改口令后方可继续使用。口令遗失时，执行 `ezapp --reset-admin-password`
将其重置为默认口令，登录后再次修改。

## 功能

### 数据接入

支持 csv、tsv、xlsx、xls、parquet、json 与 txt 格式。每份数据在独立标签页中打开，
切换标签页时各自保持处理状态。含多个工作表的 Excel 文件可按表分别载入。

### 数据清洗

提供缺失值、异常值、重复值与结构整理四类处理：

- 缺失值：删除，或按均值、中位数、众数、前值与后值填充。
- 异常值：按 IQR、Z-score 或固定阈值识别，处理方式包括删除、替换为上下限与标记。
- 重复值：按全部列或指定列判定，保留首条或末条记录。
- 结构整理：列拆分、多行拆分、多条件筛选、分组透视。

清洗规则可保存为模板，应用于结构相同的数据集，无需重复配置。

### 标准化与脱敏

按字段类型与取值范围进行标准化。敏感字段可按规则遮蔽后导出，原始数据不离开本机。

### 图表与报表

提供折线图、柱状图、饼图与散点图等常用图形，支持导出为 PNG。明细与统计结果可导出为
Excel；需要交付文档时，可导出 PDF 或 Word。

### 管理与授权

以数据集为单位提供以下功能：字段与取值分布统计、时间维度分析、临时数据集、
孤立数据集清理、查看与编辑授权、审批流程、风险预警、趋势分析与备份管理。

## 数据目录

所有可写内容存放于用户主目录下的数据文件夹（`C:\Users\<用户名>\ezapp`），
分为 config、data、ext、backups、uploads、logs、tk 七个子目录。
卸载、重装与升级均不修改该目录。迁移至其他主机时，将其复制到目标主机的相同位置即可，
数据集、账户与授权记录随之保留。实际路径以 `ezapp --info` 的输出为准。

## 授权

本软件为专有软件，按组件、机器码与失效日期授权，一机一码。首次运行自动签发 90 天试用授权，
试用期内功能不受限制。授权到期后，在「授权信息」页面粘贴新的授权码即可生效。

更换主机、更换系统盘或重装操作系统将导致机器码变更，需重新申请授权。建议在到期前完成更新。

许可条款随安装包分发（`LICENSE.txt`）。不同意条款者请勿安装。

## 联系方式

授权申请、续期与问题反馈：857914532@qq.com

---

# Zhixi Data

A locally deployed data management tool for tabular data: import, cleaning, statistical
analysis, charting and report export, with access control managed per dataset. Data files,
account records and licence information remain on the local machine; no data is transmitted
to external services during operation.

## Overview

The system consists of two web services and one desktop application, started by a single command:

| Service | Default port | Responsibility |
| --- | --- | --- |
| webapp | 26800 | Import, cleaning, pivoting, charts and export |
| simpleweb | 26801 | Dataset management, permissions, approvals and backups |

The desktop application is started with `ezapp --tk`. It occupies no port and requires no browser.

## Requirements

- Python 3.8 or later.
- Platform: Windows x64. The package is distributed as a prebuilt binary wheel
  (`cp38-abi3-win_amd64`) and requires no build environment; it runs on 64-bit CPython 3.8
  and later. 32-bit and ARM platforms are not supported.
- Ports 26800 and 26801 must be free. Alternative ports can be specified with `--port-web`
  and `--port-simple`.
- webapp listens on `0.0.0.0` by default and is reachable from other hosts on the local network.
  simpleweb listens on `127.0.0.1` only. To restrict webapp to the local host, start it with
  `--host 127.0.0.1`.

## Installation

```bash
pip install pvmd
```

webapp, simpleweb and the desktop application are all included in this single command and are
ready to use; no additional components are required. Installation provides the `ezapp` and
`ezapptk` command-line entry points, the first for the two web services and the second for the
desktop application.

## Startup

```bash
ezapp                    # start webapp(26800) and simpleweb(26801), open a browser
ezapp --tk               # start the desktop application
ezapp --info             # print the resolved paths without starting services
```

| Flag | Description |
| --- | --- |
| `--port-web 26900` | set the webapp port |
| `--port-simple 26901` | set the simpleweb port |
| `--only web` / `--only simple` / `--only tk` | start a single service, for troubleshooting |
| `--host 127.0.0.1` | bind webapp to the local host only |
| `--no-browser` | do not open a browser on startup |
| `--single-process` | run both services in one process and two threads |
| `--reset-admin-password` | restore the default administrator password and exit |

## Initial account

Open <http://127.0.0.1:26800> and sign in with the default account `admin` and the default
password `easy123`. The password must be changed before the system can be used. If it is lost,
run `ezapp --reset-admin-password` to restore the default and change it again after signing in.

## Features

### Import

Supports csv, tsv, xlsx, xls, parquet, json and txt. Each dataset opens in a separate tab and
retains its processing state when tabs are switched. Individual worksheets of a multi-sheet
Excel file can be loaded separately.

### Cleaning

Four groups of operations are provided:

- Missing values: removal, or filling with mean, median, mode, previous or next value.
- Outliers: identified by IQR, Z-score or a fixed threshold; handled by removal, replacement
  with bounds, or flagging.
- Duplicates: detected across all columns or selected keys; the first or last record is retained.
- Structure: column splitting, row splitting, multi-condition filtering and grouped pivots.

Cleaning rules can be saved as templates and applied to datasets with an identical structure.

### Standardisation and masking

Field types and value ranges are standardised. Sensitive fields can be masked according to rules
before export, so the original data does not leave the local machine.

### Charts and reports

Line, bar, pie and scatter charts, exported as PNG. Detail and summary tables are exported to
Excel; PDF or Word output is available for documents that must be delivered.

### Administration and access control

Per-dataset field and value distributions, time-dimension analysis, scratch datasets, orphaned
dataset cleanup, read and edit grants, approval workflow, risk alerts, trend analysis and
backup management.

## Data directory

All writable content is stored in `C:\Users\<user>\ezapp` in seven subdirectories:
config, data, ext, backups, uploads, logs and tk. Uninstalling, reinstalling and upgrading do not
modify this directory. To migrate, copy it to the same location on the target host; datasets,
accounts and licence records are retained. Run `ezapp --info` for the paths in effect.

## Licence

The software is proprietary and licensed per machine by component, machine code and expiry date.
A 90-day trial licence is issued automatically on first run, with no feature restrictions. After
expiry, a new licence code can be entered on the Licence page.

Replacing the host, the system disk or reinstalling the operating system changes the machine code
and requires a new licence. Updating before expiry is recommended. Licence terms are distributed
with the package (`LICENSE.txt`). Do not install the software if the terms are not accepted.

## Contact

Licence requests, renewals and defect reports: 857914532@qq.com
