PHPackages                             hejunjie/alipay-bill-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. hejunjie/alipay-bill-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

hejunjie/alipay-bill-parser
===========================

一个高性能、自动化的支付宝账单解析器，支持压缩包密码自动破解与账单数据智能提取，适用于账单分析、账单自动化入账、个人理财工具开发等场景 | A fast, automated Alipay bill parser that cracks compressed file passwords and extracts bill data. Perfect for bill analysis, automatic bookkeeping, and personal finance tools

v1.1.0(8mo ago)224MITPHPPHP &gt;=8.1

Since May 26Pushed 6mo agoCompare

[ Source](https://github.com/zxc7563598/php-alipay-bill-parser)[ Packagist](https://packagist.org/packages/hejunjie/alipay-bill-parser)[ RSS](/packages/hejunjie-alipay-bill-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

hejunjie/alipay-bill-parser
===========================

[](#hejunjiealipay-bill-parser)

 [English](./README.md)｜[简体中文](./README.zh-CN.md)---

⚠️ This project is for learning and communication purposes only. Commercial or illegal use is strictly prohibited.

A high-performance, automated Alipay bill parser that supports automatic password cracking of compressed files and intelligent extraction of bill data. Ideal for scenarios such as bill analysis, automated bookkeeping, and personal finance tool development.

**This project has been parsed by Zread. If you need a quick overview of the project, you can click here to view it：[Understand this project](https://zread.ai/zxc7563598/php-alipay-bill-parser)**

---

✨ Features
----------

[](#-features)

- 🔐 **Automatic Password Cracking for Compressed Files**: Utilizes a native C-based multithreaded brute-force tool for extremely fast response and minimal resource usage.
- 📦 **No Manual Extraction Required**: Supports password-protected archives, automatically decompresses and reads bill data without manual intervention.
- 📄 **Intelligent Data Extraction**: Parses Alipay bill CSV files to quickly extract account information, user names, and transaction details.
- 🧩 **Highly Customizable**: Offers flexible control over the parsing process via callback functions—for example, to retrieve only the password without generating HTML.
- 📬 **Compatible with Email Monitoring Scripts**: Can be integrated with email listeners to enable fully automated bill collection and parsing.

---

🛠 System Requirements
---------------------

[](#-system-requirements)

This library depends on the C library [libzip](https://libzip.org/). Please install the dependency first:

- Ubuntu / Debian：

    ```
    sudo apt install libzip-dev
    ```
- macOS (using Homebrew)：

    ```
    brew install libzip
    ```
- Windows users can use this via WSL, or use the precompiled `zip_bruteforce.exe`.

---

📦 Installation
--------------

[](#-installation)

Install this library via Composer:

```
composer require hejunjie/alipay-bill-parser
```

---

🚀 Usage
-------

[](#-usage)

```
use Hejunjie\AlipayBillParser\AlipayBillParser;
use Hejunjie\AlipayBillParser\ParseOptions;

$zipFile = '/path/to/支付宝交易明细(20240501-20250430).zip';

$options = new ParseOptions($zipFile);
$options->onPasswordFound = function ($password) {
    echo "password:$password\n";
    return true; // Returning false will terminate the subsequent parsing process.
};
$options->onDataParsed = function ($data) {
    echo "name " . $data['real_name'] . PHP_EOL;
    echo "account " . $data['account'] . PHP_EOL;
    echo "A total of " . count($data['data']) . " records have been parsed.\n";
    return true; // Returning false will skip the HTML generation step (under development).
};

// tips: Future versions may support directly generating a bill report as an HTML file.

$parser = new AlipayBillParser();
$parser->parse($options);
```

You can also choose to retrieve only the password or only the bill data—simply implement the corresponding callback functions as needed.

---

🧠 Purpose &amp; Motivation
--------------------------

[](#-purpose--motivation)

I usually keep track of my bills and personal income and expenses, but the bill formats exported from WeChat and Alipay are inconsistent and often come as encrypted compressed files. Exporting, extracting, and organizing these bills every time is extremely tedious. So, I developed this tool:

- Acts as middleware for personal bill processing;
- Eliminates the need for manual downloading and extraction by automatically cracking compressed files and extracting data;
- Can be combined with email monitoring scripts to enable automated transaction collection;
- Simply forward all bill emails to a designated mailbox, and you can parse all bill data with one click—freeing your hands completely.

---

🧾 Output Structure Description
------------------------------

[](#-output-structure-description)

The `$data` passed into the `onDataParsed` callback is an array with the following structure:

```
[
  'real_name' => '张三', // name
  'account' => '18273727771', // The registered Alipay account is usually a phone number, but it may also be an email address.
  'data' => [
      // Each line of bill record
      ['Transaction Time', 'Transaction Category', 'Counterparty', 'Counterparty Account', 'Product Description', 'Income/Expense', 'Amount', 'Payment Method', 'Transaction Status', 'Transaction Order Number', 'Merchant Order Number', 'Remarks'],
      ...
  ]
]
```

---

📮 Contact
---------

[](#-contact)

If you have any questions, suggestions, or cooperation interests, feel free to reach out to me via GitHub Issues.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance64

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Total

3

Last Release

250d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b65d4b40ae456172fb38f63f84bf737ac88031484b1f228b1cc8d71baa80adf?d=identicon)[苏青安](/maintainers/%E8%8B%8F%E9%9D%92%E5%AE%89)

---

Top Contributors

[![zxc7563598](https://avatars.githubusercontent.com/u/46590942?v=4)](https://github.com/zxc7563598 "zxc7563598 (9 commits)")

---

Tags

alipayautomationbill-parsercsv-parserfinancial-toolpassword-bruteforcepersonal-financephp-library

### Embed Badge

![Health badge](/badges/hejunjie-alipay-bill-parser/health.svg)

```
[![Health](https://phpackages.com/badges/hejunjie-alipay-bill-parser/health.svg)](https://phpackages.com/packages/hejunjie-alipay-bill-parser)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M283](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M226](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M63](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M344](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
