Skip to main content

Xiaoming DataHelper

一个简单的数据处理工具包,帮助你轻松处理 CSV 文件数据。

功能特点

  • 支持相对路径和绝对路径的 CSV 文件读取
  • 提供基本的数据统计功能
  • 简单易用的 API 设计
  • 完整的类型提示支持

安装

pip install xiaoming-datahelper

快速开始

from datahelper import CSVReader, DataProcessor

# 读取 CSV 文件
reader = CSVReader("data.csv")
data = reader.read()

# 处理数据
processor = DataProcessor(data)
stats = processor.calculate_stats("age")
print(stats)

使用示例

使用相对路径

from datahelper import CSVReader

# 使用相对路径(基于当前工作目录)
reader = CSVReader("data/sales.csv")
data = reader.read()

使用绝对路径

from datahelper import CSVReader

# 使用绝对路径
reader = CSVReader("/absolute/path/to/data.csv")
data = reader.read()

指定基准目录

from datahelper import CSVReader

# 指定基准目录
reader = CSVReader("data/sales.csv", base_dir="/path/to/project")
data = reader.read()

数据统计

from datahelper import CSVReader, DataProcessor

# 读取数据
reader = CSVReader("data.csv")
data = reader.read()

# 计算统计信息
processor = DataProcessor(data)
age_stats = processor.calculate_stats("age")
salary_stats = processor.calculate_stats("salary")

print("年龄统计:", age_stats)
print("薪资统计:", salary_stats)

开发指南

环境设置

  1. 克隆仓库:
git clone https://github.com/yourusername/xiaoming-datahelper.git
cd xiaoming-datahelper
  1. 创建虚拟环境:
python -m venv venv
source venv/bin/activate  # Windows 使用: venv\Scripts\activate
  1. 安装开发依赖:
pip install -e ".[dev]"

开发工具

项目提供了多个便捷的脚本:

  1. 清理项目:
./scripts/clean.sh
  1. 构建包:
./scripts/build.sh
  1. 上传到 PyPI:
./scripts/upload.sh

运行测试

pytest tests/

项目结构

datahelper/
├── src/
│   └── datahelper/
│       ├── __init__.py
│       ├── core/
│       │   ├── __init__.py
│       │   ├── reader.py
│       │   └── processor.py
│       └── utils/
│           ├── __init__.py
│           └── helpers.py
├── tests/
│   ├── __init__.py
│   ├── test_reader.py
│   └── test_processor.py
├── examples/
│   └── basic_usage.py
└── scripts/
    ├── clean.py
    ├── build.py
    └── upload.py

贡献指南

  1. Fork 项目
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 创建 Pull Request

许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件

作者

致谢

  • 感谢所有贡献者的付出
  • 特别感谢 pandas 和 numpy 团队

Metadata

Release files for xiaoming-datahelper 0.1.3

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

Source distribution (sdist)

Source distribution for xiaoming-datahelper 0.1.3
File Size Uploaded Provenance
xiaoming_datahelper-0.1.3.tar.gz 3.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for xiaoming-datahelper 0.1.3
File Interpreter ABI Platform
xiaoming_datahelper-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / xiaoming_datahelper-0.1.3.tar.gz

Download URL xiaoming_datahelper-0.1.3.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
61cc39fecefe5fb1a89335d38e8fd8125f775ec20de0fe22f1cd616be30725b5
BLAKE2b-256 checksum
How to use checksums
32f45ce474754e8679981efa497c84745ec6c149023e782a0266d3cc388e8e1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / xiaoming_datahelper-0.1.3-py3-none-any.whl

Download URL xiaoming_datahelper-0.1.3-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a17781c9bd1c39c9c8cf8ab5e5f19d7a497aeb6d52f54101fa7eb21ac2582b7
BLAKE2b-256 checksum
How to use checksums
bcd13b410f839063eff6878b0c764ca37e03d4bab64ab8a4883eeba335b85d62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Security for xiaoming-datahelper 0.1.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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