PHPackages                             hejunjie/wechat-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hejunjie/wechat-bill-parser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hejunjie/wechat-bill-parser
===========================

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

v2.3.1(1mo ago)9281MITPHPPHP ^8.1

Since May 27Pushed 1mo ago1 watchersCompare

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

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

hejunjie/wechat-bill-parser
===========================

[](#hejunjiewechat-bill-parser)

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

Warning

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

A PHP library for automated WeChat bill parsing: cracks ZIP archive passwords and extracts bill data from Excel files. Ideal for personal finance tracking, automated bookkeeping, and financial tool development.

**Want a quick overview?** The codebase has been parsed by [Zread](https://zread.ai/zxc7563598/php-wechat-bill-parser).

Features
--------

[](#features)

- 🔐 **Automatic ZIP Password Cracking**: Multi-process brute-force tool written in C, delivering fast results with minimal resource usage
- 📦 **No Manual Extraction Needed**: Handles password-protected archives — automatically decompresses and reads bill data
- 📄 **Intelligent Data Extraction**: Parses WeChat bill Excel files to extract account nicknames and transaction details
- 🧩 **Callback-Driven Flow Control**: Use `onPasswordFound` / `onDataParsed` callbacks to flexibly control the parsing process
- 📬 **Email Monitoring Ready**: Combine with email auto-forwarding for fully automated bill collection and parsing

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- [libzip](https://libzip.org/)
- gcc (for compiling the password cracker)
- Composer

### Install System Dependencies

[](#install-system-dependencies)

**Ubuntu / Debian:**

```
sudo apt install libzip-dev gcc
```

**macOS (Homebrew):**

```
brew install libzip
```

Note

macOS ships with gcc (actually clang), no extra install needed. Windows users can use this library via WSL.

Installation
------------

[](#installation)

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

On first run, the library automatically compiles the C-based password cracker. Make sure gcc and libzip are properly installed.

Quick Start
-----------

[](#quick-start)

```
use Hejunjie\WechatBillParser\WechatBillParser;
use Hejunjie\WechatBillParser\ParseOptions;

$zipFile = '/path/to/wechat_bill.zip';

$options = new ParseOptions($zipFile);

// Called when the password is found (return false to stop further processing)
$options->onPasswordFound = function ($password) {
    echo "Password: $password\n";
    return true;
};

// Called when data parsing is complete (return false to skip further processing)
$options->onDataParsed = function ($data) {
    echo "Nickname: " . $data['account'] . PHP_EOL;
    echo count($data['data']) . " records parsed\n";
    return true;
};

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

Only implement the callbacks you need. For example, if you only care about the password, just set `onPasswordFound` and leave `onDataParsed` unset.

Output Structure
----------------

[](#output-structure)

The `$data` array passed to the `onDataParsed` callback has the following structure:

```
[
    'real_name' => '',              // Real name (extraction not yet implemented)
    'account'   => '18273727771',   // WeChat nickname
    'data'      => [
        // Each row is a transaction record
        ['Transaction Time', 'Transaction Type', 'Counterparty', 'Product', 'Income/Expense', 'Amount (CNY)', 'Payment Method', 'Current Status', 'Transaction ID', 'Merchant Order ID', 'Remarks'],
        // ...
    ],
]
```

Project Structure
-----------------

[](#project-structure)

```
├── bin/                    # C source code (zip_bruteforce.c)
├── src/                    # PHP source code
│   ├── WechatBillParser.php     # Main parser
│   ├── ParseOptions.php         # Parse options (callback definitions)
│   ├── ZipPasswordCracker.php   # Password cracker (invokes the C executable)
│   ├── CsvExtractor.php         # Excel data extraction
│   └── Installer.php            # C tool compilation and environment detection
├── resources/              # Compiled binary output
└── vendor/                 # Composer dependencies

```

FAQ
---

[](#faq)

What if password cracking fails?WeChat bill ZIP passwords are typically 6-digit numbers. The cracker iterates through common password patterns. If cracking fails, make sure the ZIP file is not corrupted and is indeed a WeChat-exported bill file.

Does it support Alipay bills?Alipay bill parsing is available in a separate repository: [php-alipay-bill-parser](https://github.com/zxc7563598/php-alipay-bill-parser).

Motivation
----------

[](#motivation)

I keep track of my personal finances, but the bill formats exported by WeChat and Alipay are inconsistent and often arrive as encrypted ZIP archives. Manually exporting, extracting, and organizing these bills every time was tedious, so I built this tool to:

- Serve as middleware for personal bill processing, eliminating manual download and extraction steps
- Work with email monitoring scripts — forward bill emails to a designated address and parse everything automatically

Contact
-------

[](#contact)

Questions or suggestions? Feel free to open a [GitHub Issue](https://github.com/hejunjie/wechat-bill-parser/issues).

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance94

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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 ~69 days

Recently: every ~87 days

Total

7

Last Release

33d ago

Major Versions

v1.0.0 → v2.0.02025-08-01

PHP version history (2 changes)v1.0.0PHP &gt;=8.1

v2.3.1PHP ^8.1

### 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 (13 commits)")

---

Tags

automationbill-parsercsv-parserfinancial-toolpassword-bruteforcepersonal-financephp-librarywechat

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k53](/packages/civicrm-civicrm-core)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54686.7k25](/packages/solspace-craft-freeform)[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

47889.0k6](/packages/pimcore-data-importer)[in2code/powermail

Powermail is a well-known, editor-friendly, powerful and easy to use mailform extension for TYPO3 with a lots of features

1052.7M51](/packages/in2code-powermail)[yajra/laravel-datatables-export

Laravel DataTables Queued Export Plugin.

362.3M4](/packages/yajra-laravel-datatables-export)

PHPackages © 2026

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