@rustledger/wasm 0.8.7 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -2
- package/package.json +1 -1
- package/rustledger_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ Parse and validate your ledger faster than Python beancount.
|
|
|
8
8
|
|
|
9
9
|
[](https://github.com/rustledger/rustledger/actions/workflows/ci.yml)
|
|
10
10
|
[](https://github.com/rustledger/rustledger/actions/workflows/compat.yml)
|
|
11
|
+
[](https://docs.rs/rustledger-core)
|
|
11
12
|
[](https://github.com/rustledger/rustledger/releases)
|
|
12
13
|
[](LICENSE)
|
|
13
14
|
[](https://liberapay.com/rustledger)
|
|
@@ -30,11 +31,42 @@ Parse and validate your ledger faster than Python beancount.
|
|
|
30
31
|
| **Better errors** | Detailed error messages with source locations |
|
|
31
32
|
| **20 built-in plugins** | Plus Python plugin compatibility via WASI sandbox |
|
|
32
33
|
|
|
34
|
+
<details>
|
|
35
|
+
<summary><strong>Comparison with other tools</strong></summary>
|
|
36
|
+
|
|
37
|
+
| Feature | rustledger | Python beancount | hledger | ledger-cli |
|
|
38
|
+
|---------|------------|------------------|---------|------------|
|
|
39
|
+
| **Language** | Rust | Python | Haskell | C++ |
|
|
40
|
+
| **Speed** | Very fast | Slow | Fast | Fast |
|
|
41
|
+
| **Beancount syntax** | Native | Native | Via conversion | No |
|
|
42
|
+
| **Query language** | BQL (100% compat) | BQL | Custom | Custom |
|
|
43
|
+
| **LSP server** | Built-in | No | Via plugin | No |
|
|
44
|
+
| **WASM support** | Yes | No | Partial | No |
|
|
45
|
+
| **Plugin system** | Native + Python | Python | Haskell | Custom |
|
|
46
|
+
| **Active development** | Yes | Maintenance | Yes | Limited |
|
|
47
|
+
|
|
48
|
+
**When to use rustledger:**
|
|
49
|
+
- You use Beancount syntax and want speed
|
|
50
|
+
- You want a single binary with no runtime dependencies
|
|
51
|
+
- You need LSP editor integration
|
|
52
|
+
- You want to use existing Python plugins
|
|
53
|
+
|
|
54
|
+
**When to use Python beancount:**
|
|
55
|
+
- You need Fava web interface (until rustledger integration)
|
|
56
|
+
- You have complex Python plugins with C extensions
|
|
57
|
+
|
|
58
|
+
**When to use hledger:**
|
|
59
|
+
- You prefer hledger's syntax and reports
|
|
60
|
+
- You need time-tracking features
|
|
61
|
+
|
|
62
|
+
</details>
|
|
63
|
+
|
|
33
64
|
## Install
|
|
34
65
|
|
|
35
66
|
| Platform | Command |
|
|
36
67
|
|----------|---------|
|
|
37
|
-
| **macOS** | `brew install rustledger
|
|
68
|
+
| **macOS/Linux** | `brew install rustledger` |
|
|
69
|
+
| **Arch Linux** | `yay -S rustledger-bin` or `yay -S rustledger` (from source) |
|
|
38
70
|
| **Windows** | `scoop bucket add rustledger https://github.com/rustledger/scoop-rustledger && scoop install rustledger` |
|
|
39
71
|
| **Cargo** | `cargo binstall rustledger` or `cargo install rustledger` |
|
|
40
72
|
| **Fedora/RHEL** | `sudo dnf copr enable robcohen/rustledger && sudo dnf install rustledger` |
|
|
@@ -46,6 +78,8 @@ Parse and validate your ledger faster than Python beancount.
|
|
|
46
78
|
|
|
47
79
|
<sub>Missing your platform? [Open an issue](https://github.com/rustledger/rustledger/issues/new) to request it.</sub>
|
|
48
80
|
|
|
81
|
+
**Coming from Python beancount?** See the [Migration Guide](docs/MIGRATION.md) for command equivalents and plugin mapping.
|
|
82
|
+
|
|
49
83
|
## Quick Start
|
|
50
84
|
|
|
51
85
|
```bash
|
|
@@ -64,9 +98,64 @@ rledger query ledger.beancount "SELECT account, SUM(position) GROUP BY account"
|
|
|
64
98
|
| `rledger doctor` | Debugging tools for ledger issues |
|
|
65
99
|
| `rledger extract` | Import transactions from CSV/OFX bank statements |
|
|
66
100
|
| `rledger price` | Fetch commodity prices from online sources |
|
|
101
|
+
| `rledger-lsp` | Language Server Protocol for editor integration |
|
|
67
102
|
|
|
68
103
|
Python beancount users can also use `bean-check`, `bean-query`, etc.
|
|
69
104
|
|
|
105
|
+
<details>
|
|
106
|
+
<summary><strong>Report subcommands</strong></summary>
|
|
107
|
+
|
|
108
|
+
| Subcommand | Alias | Description |
|
|
109
|
+
|------------|-------|-------------|
|
|
110
|
+
| `balances` | | All account balances |
|
|
111
|
+
| `balsheet` | `bal` | Balance sheet report |
|
|
112
|
+
| `income` | `is` | Income statement |
|
|
113
|
+
| `journal` | `register` | Transaction register |
|
|
114
|
+
| `holdings` | | Investment holdings |
|
|
115
|
+
| `networth` | | Net worth over time |
|
|
116
|
+
| `accounts` | | List all accounts |
|
|
117
|
+
| `commodities` | | List all commodities |
|
|
118
|
+
| `prices` | | Price entries |
|
|
119
|
+
| `stats` | | Ledger statistics |
|
|
120
|
+
|
|
121
|
+
</details>
|
|
122
|
+
|
|
123
|
+
<details>
|
|
124
|
+
<summary><strong>Doctor subcommands</strong></summary>
|
|
125
|
+
|
|
126
|
+
Debugging and diagnostic tools:
|
|
127
|
+
|
|
128
|
+
| Subcommand | Description |
|
|
129
|
+
|------------|-------------|
|
|
130
|
+
| `lex` | Dump lexer tokens (alias: `dump-lexer`) |
|
|
131
|
+
| `parse` | Parse and show directives |
|
|
132
|
+
| `context` | Show transaction context at a line number |
|
|
133
|
+
| `linked` | Find transactions by link (`^link`) or tag (`#tag`) |
|
|
134
|
+
| `missing-open` | Generate missing Open directives |
|
|
135
|
+
| `list-options` | List all available beancount options |
|
|
136
|
+
| `print-options` | Print options parsed from a file |
|
|
137
|
+
| `stats` | Display ledger statistics |
|
|
138
|
+
| `display-context` | Show inferred decimal precision context |
|
|
139
|
+
| `roundtrip` | Round-trip parse/format test |
|
|
140
|
+
| `directories` | Validate directory hierarchy against accounts |
|
|
141
|
+
| `region` | Print transactions in a line range with balances |
|
|
142
|
+
| `generate-synthetic` | Generate synthetic test files |
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Debug a parsing issue at line 42
|
|
146
|
+
rledger doctor context ledger.beancount 42
|
|
147
|
+
|
|
148
|
+
# Find all transactions with a link
|
|
149
|
+
rledger doctor linked ledger.beancount ^trip-2024
|
|
150
|
+
|
|
151
|
+
# Generate Open directives for accounts missing them
|
|
152
|
+
rledger doctor missing-open ledger.beancount >> ledger.beancount
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
</details>
|
|
156
|
+
|
|
157
|
+
<sub>Run `rledger <command> --help` for all options.</sub>
|
|
158
|
+
|
|
70
159
|
<details>
|
|
71
160
|
<summary><strong>CLI examples</strong></summary>
|
|
72
161
|
|
|
@@ -151,6 +240,58 @@ rledger format --in-place ledger.beancount
|
|
|
151
240
|
|
|
152
241
|
</details>
|
|
153
242
|
|
|
243
|
+
<details>
|
|
244
|
+
<summary><strong>Plugin support</strong></summary>
|
|
245
|
+
|
|
246
|
+
rustledger supports three types of plugins:
|
|
247
|
+
|
|
248
|
+
**Native plugins** (built-in, fastest):
|
|
249
|
+
```bash
|
|
250
|
+
# Run a native plugin from CLI
|
|
251
|
+
rledger check --native-plugin implicit_prices ledger.beancount
|
|
252
|
+
|
|
253
|
+
# Or declare in your beancount file (auto-detected as native):
|
|
254
|
+
# plugin "beancount.plugins.auto_accounts"
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**Python file plugins** (via WASM sandbox):
|
|
258
|
+
```bash
|
|
259
|
+
# Declare in your beancount file:
|
|
260
|
+
# plugin "/path/to/my_plugin.py"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**WASM plugins** (sandboxed WebAssembly):
|
|
264
|
+
```bash
|
|
265
|
+
# Load a WASM plugin
|
|
266
|
+
rledger check --plugin /path/to/plugin.wasm ledger.beancount
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**How Python plugins work:**
|
|
270
|
+
- File-based plugins (`.py` files) run in a sandboxed CPython compiled to WebAssembly
|
|
271
|
+
- No system Python installation required
|
|
272
|
+
- Plugins cannot access the filesystem or network (sandbox isolation)
|
|
273
|
+
- Compatible with most pure-Python beancount plugins
|
|
274
|
+
|
|
275
|
+
**Limitations:**
|
|
276
|
+
- Module-based plugins (`beancount.plugins.xyz`) only work if rustledger has a native implementation
|
|
277
|
+
- Plugins with C extensions won't work (numpy, pandas, etc.)
|
|
278
|
+
- No network access (price fetching plugins need alternatives)
|
|
279
|
+
|
|
280
|
+
</details>
|
|
281
|
+
|
|
282
|
+
## Editor Integration
|
|
283
|
+
|
|
284
|
+
rustledger includes a full-featured Language Server (`rledger-lsp`) for IDE support:
|
|
285
|
+
|
|
286
|
+
- Real-time diagnostics
|
|
287
|
+
- Autocompletion (accounts, currencies, payees)
|
|
288
|
+
- Go to definition / find references
|
|
289
|
+
- Hover information with account balances
|
|
290
|
+
- Rename refactoring
|
|
291
|
+
- Document formatting
|
|
292
|
+
|
|
293
|
+
See [LSP setup guide](crates/rustledger-lsp/README.md) for VS Code, Neovim, Helix, Zed, and Emacs.
|
|
294
|
+
|
|
154
295
|
## Performance
|
|
155
296
|
|
|
156
297
|
<picture>
|
|
@@ -194,7 +335,14 @@ See [BENCHMARKING.md](docs/BENCHMARKING.md) for detailed benchmark documentation
|
|
|
194
335
|
|
|
195
336
|
## Contributing
|
|
196
337
|
|
|
197
|
-
See [
|
|
338
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
|
|
339
|
+
|
|
340
|
+
**Documentation:**
|
|
341
|
+
- [Architecture](docs/ARCHITECTURE.md) - Crate structure and data flow
|
|
342
|
+
- [BQL Reference](docs/BQL_REFERENCE.md) - Query language guide
|
|
343
|
+
- [Importing](docs/IMPORTING.md) - CSV/OFX bank import tutorial
|
|
344
|
+
- [Validation errors](docs/VALIDATION_ERRORS.md) - Error code reference
|
|
345
|
+
- [API docs](https://docs.rs/rustledger-core) - Rust API documentation
|
|
198
346
|
|
|
199
347
|
By submitting a pull request, you agree to the [Contributor License Agreement](CLA.md).
|
|
200
348
|
|
package/package.json
CHANGED
package/rustledger_wasm_bg.wasm
CHANGED
|
Binary file
|