| 1 |
======================== |
| 2 |
beancount: CHANGES |
| 3 |
======================== |
| 4 |
Note: This file contains a list changes in the 'v2' branch. |
| 5 |
The master branch will rely on the Git repository history. |
| 6 |
|
| 7 |
|
| 8 |
2024-06-16 |
| 9 |
|
| 10 |
- Created branch 'v3' and released 3.0.0 |
| 11 |
|
| 12 |
Based on our recent discussion around Beancount branches being confusing, I did the following to branches: |
| 13 |
|
| 14 |
- v2: remains the same (no change); but v2 is now even less subject to freeze exceptions than before, because v3 is now officially born and PyPI releases will be made for it. The default reply to patches to v2 will be "move that to v3." |
| 15 |
|
| 16 |
- cpp: I turned the previous master branch's state with all C++ and Bazel build into a new 'cpp' branch. |
| 17 |
All work on the C++ rewrite -- if it is to continue -- will live on that branch. |
| 18 |
If things do move to Rust, I will probably salvage bits and pieces of that manually into a 'rust' branch. |
| 19 |
In particular, the schema defined in the proto files is something I'd like to carry forward (nicely |
| 20 |
documented and distinguishes between the pre and post interpolation data structures explicitly), |
| 21 |
and perhaps the new reFlex parser will be useful at some point. |
| 22 |
|
| 23 |
- v3: a new branch, to contain the state of the master branch MINUS the C++ bits. |
| 24 |
As stated above, the C++ code remains only on branch 'cpp'. |
| 25 |
This is now the official release branch and PyPI releases will be made of it. |
| 26 |
|
| 27 |
- master: this branch is now where new work on v3 might live. |
| 28 |
I'm not sure we really need it or what it should mean, but it should track v3 for now. |
| 29 |
|
| 30 |
I've reviewed missing PyPI releases and made sure we have these: |
| 31 |
|
| 32 |
https://pypi.org/project/beancount/ |
| 33 |
https://pypi.org/project/beangulp/ |
| 34 |
https://pypi.org/project/beanquery/ |
| 35 |
https://pypi.org/project/beanprice/ |
| 36 |
https://pypi.org/project/beangrow/ |
| 37 |
https://pypi.org/project/beancount2ledger/ |
| 38 |
|
| 39 |
The inclusion of v3 releases for PyPI and new PyPI releases for subprojects should normalize the versioning situation in Beancount. Note that packaging and following other people's conventions are not my forte (and I don't use PyPI for my own projects I just use source), if you have any suggestions or something's missing please reply to this thread. |
| 40 |
Thanks for your patience, |
| 41 |
|
| 42 |
|
| 43 |
2022-02-15 |
| 44 |
|
| 45 |
- Released 2.3.5 with only a few minor bugfixes. Mainly released for 3.10. |
| 46 |
|
| 47 |
|
| 48 |
2021-03-20 |
| 49 |
|
| 50 |
- Fixed #639: Released 2.3.4. |
| 51 |
|
| 52 |
|
| 53 |
2021-01-09 |
| 54 |
|
| 55 |
- Fixed bug in booking that assumed number is set on cost. I did this while |
| 56 |
running booking manually on entries freshly created on an importer (never ahd |
| 57 |
done that before, will be customary in v3). |
| 58 |
|
| 59 |
|
| 60 |
2021-01-08 |
| 61 |
|
| 62 |
- Fixed recently introduced bug with the export script that reordered the |
| 63 |
columns. |
| 64 |
- Fixed bug with printer leaving trailing whitespace. Was annoying. |
| 65 |
|
| 66 |
|
| 67 |
2020-12-20 |
| 68 |
|
| 69 |
- Merged half of branch pr128_seltzered_beanpriceupdate on this side of |
| 70 |
Beancount. The other side will be patched to |
| 71 |
http://github.com/beancount/beanprice. This adds some trimming functions to |
| 72 |
beancount.ops.lifetimes. |
| 73 |
|
| 74 |
|
| 75 |
2020-12-14 |
| 76 |
|
| 77 |
- Fixed #588: Catch more narrow exceptions from plugins and render full stack |
| 78 |
when caught. |
| 79 |
|
| 80 |
|
| 81 |
2020-11-25 |
| 82 |
|
| 83 |
- Fixed #584 - a bug which was occurring because a pathological example using a |
| 84 |
very large precision was used in inferring the precision of a currency and a |
| 85 |
subsequent attempt to quantize a large number exceeded the default precision. |
| 86 |
|
| 87 |
|
| 88 |
2020-11-22 |
| 89 |
|
| 90 |
- Fixed bug in parser.parse_file() which when passed a filename in would leave |
| 91 |
the file unclosed. |
| 92 |
- Fixed latent bug with key/value parsing (incorrect grammar rule, was working |
| 93 |
anyway somehow). |
| 94 |
- Internal changes to lexer and parser to minimize diffs with ongoing work in |
| 95 |
'master' / C++ scanner/parser. |
| 96 |
|
| 97 |
|
| 98 |
2020-11-17 |
| 99 |
|
| 100 |
- Made it legal to insert a balance entry after account closure. It is a common |
| 101 |
case that transactions happen on the last day of an account and the balance |
| 102 |
directive operates at the beginning of the day. It was arguable whether |
| 103 |
directives should be allowed after closure; notes and documents were allowed |
| 104 |
because statements and phone calls may still occur after an account is |
| 105 |
closed, but I suppose you can make the argument that a statement balance can |
| 106 |
also occur at a later date, so voila, make it legal. You still cannot post |
| 107 |
transactions to a closed account, which is the thing that really matters. |
| 108 |
|
| 109 |
|
| 110 |
2020-11-15 |
| 111 |
|
| 112 |
- Render the tolerance in Balance directives (merged from Aaron Lindsay). |
| 113 |
|
| 114 |
|
| 115 |
2020-11-01 |
| 116 |
|
| 117 |
- In the process of removing dependencies to the beancount.ops.holdings module, |
| 118 |
significantly sped up the net-worth-over-time script by using simple |
| 119 |
aggregation to an inventory (which is how it should be done). |
| 120 |
- Allow balance_by_account() method to compress positions that aren't booked, |
| 121 |
as an option. |
| 122 |
- Added split() method to Inventory, like segregate_units but with no |
| 123 |
constraints. |
| 124 |
- Fixed #255: Added a new beancount.core.prices.project() method to project |
| 125 |
prices to another cost currency. |
| 126 |
|
| 127 |
|
| 128 |
2020-10-26 |
| 129 |
|
| 130 |
- Fixed Github Actions workflows and Wheel generation. |
| 131 |
- Released 2.3.3 to trigger new binaries. |
| 132 |
|
| 133 |
|
| 134 |
2020-10-25 |
| 135 |
|
| 136 |
- Removed the part of setup_test checks running the binaries with --help, as |
| 137 |
they fail starting at 3.8. Someone with more time would create a test using |
| 138 |
pytest-virtualenv. |
| 139 |
|
| 140 |
|
| 141 |
2020-10-17 |
| 142 |
|
| 143 |
- Fixed #566: Duplicate postings on entries should count toward distinct |
| 144 |
hashes. |
| 145 |
|
| 146 |
|
| 147 |
2020-10-10 |
| 148 |
|
| 149 |
- Moved Emacs support to its own repository |
| 150 |
(http://github.com/beancount/beancount-mode). |
| 151 |
|
| 152 |
|
| 153 |
2020-09-12 |
| 154 |
|
| 155 |
- Added metadata on implicitly generated Price directives (from implicit_prices |
| 156 |
plugin). |
| 157 |
|
| 158 |
|
| 159 |
2020-09-12 |
| 160 |
|
| 161 |
- Released 2.3.2. |
| 162 |
|
| 163 |
|
| 164 |
2020-09-07 |
| 165 |
|
| 166 |
- Fixed #401: Fixed initialization bugs on min() and max() functions for the SQL |
| 167 |
aggregator. |
| 168 |
- Fixed #364: Fixed important core bug in how the CostSpec were converted to |
| 169 |
Cost for cost specs with total and per-unit cost numbers, like this {106.935 |
| 170 |
# 6.98 USD}. For short positions, the cost was computed as negative. In a |
| 171 |
sense this was a naive bug, but a very important one. This occurred only for |
| 172 |
short positions. |
| 173 |
|
| 174 |
|
| 175 |
2020-08-19 |
| 176 |
|
| 177 |
- Added an option to the printer to allow an arbitraty Python value to be |
| 178 |
output. This is useful when creating values programmatically with types not |
| 179 |
supported by the syntax. |
| 180 |
|
| 181 |
|
| 182 |
2020-07-25 |
| 183 |
|
| 184 |
- Release 2.3.1 as dependency for beanprice. |
| 185 |
- Moved beancount.prices.find_prices to beancount.ops.find_prices in |
| 186 |
preparation of moving price fetching code to a new 'beanprice' repository. |
| 187 |
|
| 188 |
|
| 189 |
2020-07-17 |
| 190 |
|
| 191 |
- Fixed bug #508 in beancount.plugins.unique_prices. |
| 192 |
|
| 193 |
|
| 194 |
2020-07-06 |
| 195 |
|
| 196 |
- Updated export script to honor lowercase "ignore" instead of "IGNORE" and set |
| 197 |
default tax type to "taxable" instead of "TAXABLE" so that changes in PR 472 |
| 198 |
don't pick up the metadata as currencies. |
| 199 |
|
| 200 |
|
| 201 |
2020-07-05 |
| 202 |
|
| 203 |
- Removed bean-report and all associated codes. Use bean-query instead (or |
| 204 |
Fava). |
| 205 |
- Removed bean-web and bean-bake (for v3). Use Fava instead. |
| 206 |
- Moved beancount.web.scrape to beancount.utils.scrape in preparation of |
| 207 |
removing beancount.web. |
| 208 |
- Removed experiments/portfolio for its dependency on beancount.reports code |
| 209 |
(this script was obsolete anyway). |
| 210 |
- Moved get_assets_holdings() function out of reports code to preserve it for |
| 211 |
use by an experimental script (in preparation for removing beancount.reports). |
| 212 |
- Moved beancount.scripts.tutorial to beancount.reports.tutorial in preparation |
| 213 |
of removing beancount.reports and beancount.web. |
| 214 |
- Moved beancount.reports.context to beancount.parser.context in preparation of |
| 215 |
removing beancount.reports and beancount.web. |
| 216 |
- Moved beancount.reports.table to beancount.utils.table in preparation of |
| 217 |
removing beancount.reports and beancount.web. |
| 218 |
|
| 219 |
|
| 220 |
2020-07-04 |
| 221 |
|
| 222 |
- Fixed #494, invalid account used for clamping the period view |
| 223 |
(Equity:Conversions:Previous instead of Equity:Conversions:Current). |
| 224 |
|
| 225 |
|
| 226 |
2020-06-27 |
| 227 |
|
| 228 |
- Merged PR #484, some parser improvements by @dnicolodi. |
| 229 |
- Merged PR #488 from branch beancount/pr135_ppmarciniak_fixnetworth by |
| 230 |
@pmarciniak. |
| 231 |
- Merged branch pr131_tohojo_csvtweaks (BitBucket PR 131) by @tohojo, fixed |
| 232 |
encoding bug in reading the file for the date and allow customizing the |
| 233 |
number parser. |
| 234 |
|
| 235 |
|
| 236 |
2020-06-26 |
| 237 |
|
| 238 |
- Merged #480 - parser: Read input data from Python file objects by dnicolodi. |
| 239 |
|
| 240 |
|
| 241 |
2020-06-10 |
| 242 |
|
| 243 |
- Released 2.3.0. See #459. |
| 244 |
|
| 245 |
|
| 246 |
2020-06-03 |
| 247 |
|
| 248 |
- Added a 'hooks' argument to beancount.ingest.scripts_utils.ingest() replacing |
| 249 |
'detect_duplicates_func'. 'find_duplicate_entries()' is still inserted if no |
| 250 |
other filter functions are specified (I'd like to remove this eventually; not |
| 251 |
changing behavior here for now.) |
| 252 |
- Added an example for how to run the importers explictly via a Python script |
| 253 |
calling the ingest() function. |
| 254 |
- Fixed bug with explicit invocation of importers via ingest() function when |
| 255 |
calling the 'file' sub command. |
| 256 |
- Some installations of pdfminer install 'pdf2txt.py' as 'pdf2txt'. Adjusted |
| 257 |
ingestion example scripts. |
| 258 |
|
| 259 |
|
| 260 |
2020-06-02 |
| 261 |
|
| 262 |
- Modified recently added --no-cache option to also delete the cache if it |
| 263 |
exists. Honor the same environment variables. The motivation behind this |
| 264 |
change is that while --no-cache is useful for debugging plugins, it can be |
| 265 |
disconcerting that if you remove it on the next run it picks up the old |
| 266 |
existing cache. Deleting it on usage of --no-cache is reasonable behavior and |
| 267 |
avoids the introduction of a --clear-cache option; this should be sufficient. |
| 268 |
|
| 269 |
|
| 270 |
2020-05-25 |
| 271 |
|
| 272 |
- Fixed #449: Added options to bean-check: --no-cache and --cache-filename to |
| 273 |
override the cache location. These are added to bean-check only and are |
| 274 |
useful during development. The 'BEANCOUNT_DISABLE_LOAD_CACHE' and |
| 275 |
'BEANCOUNT_LOAD_CACHE_FILENAME' environment variables are still honored by |
| 276 |
the loader and work across all other programs. |
| 277 |
|
| 278 |
|
| 279 |
2020-05-23 |
| 280 |
|
| 281 |
- Fixed #184: Added explicit test for Inventory.average(). |
| 282 |
- Fixed #404: Iex price source not working any more. |
| 283 |
- Fixed #281: Query "id" column does not identify transactions uniquely. Made |
| 284 |
the default hash_entry() function include metadata. Exclude metadata and |
| 285 |
derived fields explicitly in the context of comparison. |
| 286 |
- Fixed #182: Eliding an amount with total price raises TypeError. |
| 287 |
- Added options to filter accounts in "onecommodity" plugin: skip accounts with |
| 288 |
explicitly declared commodities, metadata of "onecommodity: FALSE" and added |
| 289 |
regular expression to specify the list of accounts to match (default: all). |
| 290 |
|
| 291 |
|
| 292 |
2020-05-22 |
| 293 |
|
| 294 |
- Migration of code repository to Github. |
| 295 |
|
| 296 |
|
| 297 |
2020-05-02 |
| 298 |
|
| 299 |
- Minor performance improvment by avoiding calling __iadd__ in a few places. |
| 300 |
- Fixed bug due to the removal of __version__ in apiclient: |
| 301 |
https://github.com/googleapis/google-api-python-client/commit/1d8ec6874e1c6081893de7cd7cbc86d1f6580320 |
| 302 |
- Changes all imports from 'apiclient' to 'googleapiclient', which is now the |
| 303 |
recommended way. |
| 304 |
- Fixed some warnings. |
| 305 |
- Disabled expensive assertions in Inventory class and implemented a special |
| 306 |
case for adding to an empty inventory to avoid expensive aggregation. This |
| 307 |
can occur in aggregation loops and is unnecessarily expensive when adding a |
| 308 |
single, very large inventory. |
| 309 |
- Made balance check aggregation avoid an initial empty inventory object, and |
| 310 |
changed the balance check code to call the realization utility function |
| 311 |
compute_balance(). |
| 312 |
|
| 313 |
|
| 314 |
2020-04-11 |
| 315 |
|
| 316 |
- Fixed #425: Tentative bug fix for crash on decref over null traceback. The |
| 317 |
Python API for this function may return some null values. Not taking any |
| 318 |
chances. This should fix this particular bug. |
| 319 |
|
| 320 |
|
| 321 |
2020-03-28 |
| 322 |
|
| 323 |
- Allow the "divert_expenses" plugin to override diversions on postings that |
| 324 |
aren't for expenses accounts. I needed this to account to a deposit to my |
| 325 |
kid's daycare, which is an asset account in his diverted ledger. |
| 326 |
|
| 327 |
|
| 328 |
2020-03-22 |
| 329 |
|
| 330 |
- Added docstrings on some import code (while installing a new importer; my |
| 331 |
stuff is sometimes poorly documented I'm afraid). |
| 332 |
|
| 333 |
|
| 334 |
2020-02-23 |
| 335 |
|
| 336 |
- Added new features to the CSV importer: |
| 337 |
* A new 'invert_sign' option to invert the sign of the amount. |
| 338 |
* A new field, 'CATEGORY', which goes unrendered. |
| 339 |
* Replace newlines from all narrations by semi-colons. |
| 340 |
These were driven by recent changes to the Amex CSV format. |
| 341 |
|
| 342 |
|
| 343 |
2019-12-29 |
| 344 |
|
| 345 |
- Added a CSV field for a unique reference number. If present, this is set as a |
| 346 |
link on the transaction. |
| 347 |
|
| 348 |
|
| 349 |
2019-12-25 |
| 350 |
|
| 351 |
- Applied patch from Daniele Nicolodi |
| 352 |
(https://bitbucket.org/blais/beancount/pull-requests/139/parser-work-around-python38-bug-causing-a) |
| 353 |
to work around typing constraints around signed size types introduced in |
| 354 |
Python 3.8. See also https://bugs.python.org/issue38913. |
| 355 |
|
| 356 |
- Fixed bug with running python3 as a subprocess during testing. Fixes an error |
| 357 |
that occurs with the tutorial file generation. |
| 358 |
|
| 359 |
|
| 360 |
2019-11-29 |
| 361 |
|
| 362 |
- Added 'encoding' option to CSV importer. Amex encodes as 'latin1', not |
| 363 |
'utf-8' and this turned out to be necessary. |
| 364 |
|
| 365 |
|
| 366 |
2019-11-10 |
| 367 |
|
| 368 |
- Added an option to upload-to-sheets script to apply a minimum to the number |
| 369 |
of rows resized to. The problem was I had another sheet longer than the |
| 370 |
auto-updated data sheet, and when new rows were being inserted, rows in the |
| 371 |
referencing sheet were being incremented automatically to refer to the now |
| 372 |
displaced previous rows in the updated data sheet (even if they used to refer |
| 373 |
to rows after the last row in the data sheet). Avoid resizing in the number |
| 374 |
of rows up or down sheet should avoid most of these problems (except when at |
| 375 |
the boundary, but then the minimum number of rows could just be increased). |
| 376 |
This is quick fix that should work in the medium term. |
| 377 |
|
| 378 |
|
| 379 |
|
| 380 |
2019-10-20 |
| 381 |
|
| 382 |
- More changes to unittest while porting to Bazel build (for C++ support). |
| 383 |
|
| 384 |
|
| 385 |
2019-10-11 |
| 386 |
|
| 387 |
- Added __main__ block to all tests because ongoing port to Bazel build |
| 388 |
requires it. |
| 389 |
|
| 390 |
|
| 391 |
2019-10-10 |
| 392 |
|
| 393 |
- Moved test data for b.utils.file_type for Bazel support. It otherwise assumes |
| 394 |
file_type.py is a package. |
| 395 |
|
| 396 |
|
| 397 |
2019-08-21 |
| 398 |
|
| 399 |
- Released 2.2.3. |
| 400 |
- Fixed bug in split_expenses plugin. |
| 401 |
|
| 402 |
|
| 403 |
2019-06-01 |
| 404 |
|
| 405 |
- Upgraded Bison to 3.4 (built from source). Silenced warnings. |
| 406 |
|
| 407 |
|
| 408 |
2019-05-01 |
| 409 |
|
| 410 |
- Fixed #389: Patch for b.p.forecast improvements. |
| 411 |
|
| 412 |
- Added rolled back change to default value of flag used when using the 'txn' |
| 413 |
syntax. See issue #295 for a discussion. |
| 414 |
|
| 415 |
|
| 416 |
2019-03-16 |
| 417 |
|
| 418 |
- Had a very quick shot at implementing trade tracking, added the list of |
| 419 |
matches positions from the booking methods. This doesn't work yet, I need to |
| 420 |
make changes to b.c.Inventory in order to make this work. Partial |
| 421 |
changelist. |
| 422 |
|
| 423 |
|
| 424 |
2019-03-03 |
| 425 |
|
| 426 |
- Fixed #378: Rendering metadata with null values wasn't properly implemented. |
| 427 |
In the process, I explicit parsing of None values by allowing "NULL". |
| 428 |
|
| 429 |
- Fixed #309: Catch PermissionError to work around |
| 430 |
https://bugs.python.org/issue25481. |
| 431 |
|
| 432 |
|
| 433 |
2019-02-27 |
| 434 |
|
| 435 |
- Implemented a quick prototype of the current trading accounts method of |
| 436 |
Peter Selinger in 'beancount.plugins.currency_accounts'. A few warts remain: |
| 437 |
|
| 438 |
* FIXME: We need to handle these important cases (they're not frivolous, |
| 439 |
this is a prototype), probably by inserting some exceptions with |
| 440 |
collaborating code in the booking (e.g. insert some metadata that |
| 441 |
disables price conversions on those postings). |
| 442 |
|
| 443 |
* FIXME(2): Ouch! Some of the residual seeps through here, where there |
| 444 |
are more than a single currency block. This needs fixing too. You can |
| 445 |
easily mitigate some of this to some extent, by excluding transactions |
| 446 |
which don't have any price conversion in them. |
| 447 |
|
| 448 |
|
| 449 |
2019-02-26 |
| 450 |
|
| 451 |
- Fixed #376: Coerce implicit boolean to true boolean. |
| 452 |
|
| 453 |
|
| 454 |
2019-02-10 |
| 455 |
|
| 456 |
- Fixed #374: Option --all treatment was broken in #210. Also catch and print |
| 457 |
errors. |
| 458 |
|
| 459 |
- Fixed rare failure of shutil.rmtree() in encryption cleanup test. |
| 460 |
|
| 461 |
|
| 462 |
2019-02-03 |
| 463 |
|
| 464 |
- Fixed #372: Removed formatted string literal to keep compat with Python 3.5. |
| 465 |
|
| 466 |
|
| 467 |
2019-01-29 |
| 468 |
|
| 469 |
- Fixed #362: Predicate matching a parent account was matching accounts with |
| 470 |
word breaks but not at the boundary of an account name. This was causing |
| 471 |
a rare (but important) failure in how Pad balances were calculated. |
| 472 |
|
| 473 |
|
| 474 |
2019-01-28 |
| 475 |
|
| 476 |
- Released 2.2.1 for bug fixes. |
| 477 |
|
| 478 |
|
| 479 |
2019-01-25 |
| 480 |
|
| 481 |
- Improve output of tags and links for bean-report ledger and hledger. |
| 482 |
|
| 483 |
|
| 484 |
2019-01-22 |
| 485 |
|
| 486 |
- Fixed problem with invalid format strings with 0-width field when rendering |
| 487 |
MISSING. |
| 488 |
|
| 489 |
|
| 490 |
2019-01-05 |
| 491 |
|
| 492 |
- Merged pull request #85 |
| 493 |
(https://bitbucket.org/blais/beancount/pull-requests/85) from hardikar, |
| 494 |
adding function grepn() to the shell. |
| 495 |
|
| 496 |
- Merged pull request #86 |
| 497 |
(https://bitbucket.org/blais/beancount/pull-requests/86) from hardikar, |
| 498 |
adding function subst() to the shell. |
| 499 |
|
| 500 |
- Merged pull request #89 |
| 501 |
(https://bitbucket.org/blais/beancount/pull-requests/89) from hardikar, |
| 502 |
adding functions date_diff(), date_add() to the shell. |
| 503 |
|
| 504 |
- Implemented best compression for zipfile in bean-bake as per Justus |
| 505 |
Pendleton's suggestion. For context, see this: |
| 506 |
https://groups.google.com/d/msgid/beancount/de75671d-532a-4deb-bd0f-fd9377e63753%40googlegroups.com?utm_medium=email&utm_source=footer |
| 507 |
|
| 508 |
|
| 509 |
2018-12-18 |
| 510 |
|
| 511 |
- Fixed #214: Add directory of current filename to sys.path with new option |
| 512 |
"insert_pythonpath". When this option is encountered in a file, we prepend |
| 513 |
the path of the file in which it is encountered at the front of the |
| 514 |
PYTHONPATH for the rest of the duration of the problem (we could consider |
| 515 |
resetting this after parsing and processing the plugins; not doing it now). |
| 516 |
|
| 517 |
- Added detection of hitting the root if the search for the repository root |
| 518 |
failed. |
| 519 |
|
| 520 |
- Fixed #341: find_repository_root() fails on source tarball. Renamed PKGINFO |
| 521 |
to PKG-INFO to match what pip sdist produces. |
| 522 |
|
| 523 |
- Change version number from 2.2.0-devel to 2.2.0-dev which apparently is |
| 524 |
recognized by pip (thanks Jakob Schnitzer). |
| 525 |
https://bitbucket.org/blais/beancount/pull-requests/91/default/diff#comment-85707662 |
| 526 |
|
| 527 |
|
| 528 |
2018-12-12 |
| 529 |
|
| 530 |
- Suppressed almost all the Python 3.8 warnings. |
| 531 |
|
| 532 |
|
| 533 |
2018-11-16 |
| 534 |
|
| 535 |
- Added more logging in loader (done while debugging something else). |
| 536 |
|
| 537 |
|
| 538 |
2018-10-26 |
| 539 |
|
| 540 |
- Fixed #302: Fixed second bug with font-locking for account names (starting |
| 541 |
with digit). |
| 542 |
|
| 543 |
- Fixed bug ingest that would cause relative filenames to fail. |
| 544 |
See this thread for details: |
| 545 |
https://groups.google.com/d/msgid/beancount/709141d5-88a4-444a-acef-94bf43a9b388%40googlegroups.com?utm_medium=email&utm_source=footer |
| 546 |
|
| 547 |
- Fixed bug in ingest whereby the custom duplicates detection function wasn't |
| 548 |
being called. |
| 549 |
|
| 550 |
|
| 551 |
2018-10-25 |
| 552 |
|
| 553 |
- Fixed unit test failure on BitBucket pipelines using a temp directory |
| 554 |
context manager. |
| 555 |
|
| 556 |
- Applied PR by Richard W to install the mixins package (install was broken). |
| 557 |
|
| 558 |
- Fixed #302: beancount.el does not fontify account names with single letter |
| 559 |
components (based on bug report by arianaut@). |
| 560 |
|
| 561 |
|
| 562 |
2018-10-13 |
| 563 |
|
| 564 |
- Fixed #158: Missing MIME type for QFX files. |
| 565 |
|
| 566 |
|
| 567 |
2018-10-04 |
| 568 |
|
| 569 |
- Merged new_ingest_mixins: Added new implementations of mixins for ingestion: |
| 570 |
|
| 571 |
* beancount.ingest.importers.mixins.identifier which implements identify(). |
| 572 |
* beancount.ingest.importers.mixins.filing which implements file_account() |
| 573 |
and file_name(). |
| 574 |
* beancount.ingest.importers.mixins.config which implement a simple schema |
| 575 |
with a configuration. |
| 576 |
|
| 577 |
These new mixins are intended to be more independent and more easily |
| 578 |
composable than the older ones. The beancount.ingest.importers.regexp has |
| 579 |
been removed. If you need it in interim, I made a copy under |
| 580 |
experiments/ingest/regexp.py. |
| 581 |
|
| 582 |
|
| 583 |
* Version: 2.1.3 |
| 584 |
|
| 585 |
2018-10-04 |
| 586 |
|
| 587 |
- Fixed #323: Escape strings in printer. |
| 588 |
|
| 589 |
- Minor bug fix for beancount.prices.price on null result. |
| 590 |
|
| 591 |
|
| 592 |
2018-09-19 |
| 593 |
|
| 594 |
- Removed TRUNCATE(), after realizing ROOT() can already do the same thing. |
| 595 |
|
| 596 |
|
| 597 |
2018-09-18 |
| 598 |
|
| 599 |
- Added TRUNCATE() function to SQL shell for Vikas Rawal. |
| 600 |
|
| 601 |
|
| 602 |
2018-09-03 |
| 603 |
|
| 604 |
- Added a parameter to the cmptest assertions to disable real booking and |
| 605 |
allow a weak local form of booking conversion that allows interpolation. |
| 606 |
(I'm using this in another project to assert some incomplete transactions.) |
| 607 |
|
| 608 |
|
| 609 |
2018-08-30 |
| 610 |
|
| 611 |
- Made assertions on entries off of the TestCase class, as free functions (so |
| 612 |
that they can be used in another project). |
| 613 |
|
| 614 |
|
| 615 |
2018-08-26 |
| 616 |
|
| 617 |
- Fixed tests for pipeline running pytest (somehow the curses functions fail, |
| 618 |
probably due to better environment isolation from pytest). |
| 619 |
|
| 620 |
- Implementation of beancount.ingest.regression_pytest, a pytest replacement |
| 621 |
for beancount.ingest.regression, which was for nose. This is simpler and |
| 622 |
better and more straightforward (no conditionals; all regression files must |
| 623 |
have all accompanying expect files and all must pass). See the module |
| 624 |
docstring for new instructions on how to use this. |
| 625 |
|
| 626 |
This should not break the older tests, as I haven't changed the older |
| 627 |
support. It (beancount.ingest.regression) will be removed eventually. |
| 628 |
|
| 629 |
(This completes porting Beancount to use pytest instead of nosetests.) |
| 630 |
|
| 631 |
|
| 632 |
2018-08-25 |
| 633 |
|
| 634 |
- Today we're switching to pytest as the official test runner. All the tests |
| 635 |
pass, and it even runs faster. It's about time! |
| 636 |
|
| 637 |
- Removed all references and workaround to nose. |
| 638 |
|
| 639 |
|
| 640 |
2018-08-23 |
| 641 |
|
| 642 |
- Oops... removing forgotten trace in bean-web. |
| 643 |
|
| 644 |
- Fixed #325: Implemented support for including encrypted files (for Milind Kamble |
| 645 |
and using some of this changes). |
| 646 |
|
| 647 |
|
| 648 |
2018-08-17 |
| 649 |
|
| 650 |
- Added 'issuer' column to the export script. I'm going to use this to produce |
| 651 |
a deaggregated list of exposure to individual stocks from a list of ETFs. |
| 652 |
|
| 653 |
|
| 654 |
2018-08-25 |
| 655 |
|
| 656 |
- Upgrade requirement to bison-3.0.5 for development. |
| 657 |
|
| 658 |
|
| 659 |
2018-08-12 |
| 660 |
|
| 661 |
- After many years of using something like it to track my investment portfolio |
| 662 |
using a Google Sheets doc, I cleaned up, rewrote and move the asset list |
| 663 |
exporting script to beancount.projects.export and deleted the old version |
| 664 |
under experiments/upload. |
| 665 |
|
| 666 |
|
| 667 |
2018-08-05 |
| 668 |
|
| 669 |
- Fixed #322: Adjustments to StopIteration treatment from within generators |
| 670 |
were breaking bean-example generation code. |
| 671 |
|
| 672 |
- Implemented a new plugin which asserts that on accounts with 'NONE' booking |
| 673 |
method reducing postings' cost basis is within the vicinity of the average |
| 674 |
cost basis in the account. This allows you to approximate the 'AVERAGE' |
| 675 |
booking method avoid too much cost basis leakage until it's implemented |
| 676 |
properly. |
| 677 |
|
| 678 |
|
| 679 |
2018-08-02 |
| 680 |
|
| 681 |
- Created a new 'commodity_attr' plugin to asset the presence and validity |
| 682 |
(in a set, like an enum) of metadata attributes on Commodity directives. |
| 683 |
|
| 684 |
I export my holdings joined to a table of per-Commodity attributes and I've |
| 685 |
made a mistake this week that ended up showing up as an overestimated |
| 686 |
portfolio value on my portfolio tracking Google Sheets doc. |
| 687 |
|
| 688 |
|
| 689 |
2018-07-31 |
| 690 |
|
| 691 |
- Fixed bug in new ingest() function found as I refactored my importers. |
| 692 |
|
| 693 |
- Fixed bug with the pipeline making sure to set the CWD of the subprocess |
| 694 |
when we run an import test. |
| 695 |
|
| 696 |
- Fixed bug with previous commit containing stray 'string' reference. (My |
| 697 |
environment has autoimports by default.) |
| 698 |
|
| 699 |
- Implemented a beancount.ingest.scripts_utils.ingest() function that will act |
| 700 |
as a main program, so you can write your own importer scripts from top to |
| 701 |
bottom without having to rely on bean-identiy, bean-extract or bean-file. |
| 702 |
|
| 703 |
The purpose of this change was to allow the user to insert an optional |
| 704 |
argument 'detect_duplicates_func' in order to implement their own duplicates |
| 705 |
detection. See discussion under |
| 706 |
https://bitbucket.org/blais/beancount/pull-requests/75/. In order to install |
| 707 |
your duplicates detector, just call ingest at the end of your importer |
| 708 |
script, like this: |
| 709 |
|
| 710 |
my_importers = [ ... ] |
| 711 |
ingest(my_importers, my_duplicates_func) |
| 712 |
|
| 713 |
I could have chosen to add a "hook" option and such to Beancount, but I |
| 714 |
preferred moving the whole import framework one level closer to code. I also |
| 715 |
like that it's not just an imported module; it's really just your script, |
| 716 |
with three subcommands. You could add more custom import-level stuff in |
| 717 |
there. The ingest() function is a main program, and commands like |
| 718 |
|
| 719 |
bean-extract myimporters.py ~/Downloads --reverse -e myledger.beancount |
| 720 |
|
| 721 |
are invoked similarly by calling the Python script directly, like this: |
| 722 |
|
| 723 |
./myimporters.py -d ~/Downloads extract --reverse -e myledger.beancount |
| 724 |
|
| 725 |
These two should be equivalent. |
| 726 |
|
| 727 |
The older way of doing things--that is, calling bean-identify, bean-extract |
| 728 |
and bean-file--are still supported regardless of whether you've inserted a |
| 729 |
call to ingest() in your importers configuration or not. This is made to |
| 730 |
work via a rather labyrinthine trampoline of functions calls (in particular, |
| 731 |
getting the arguments setup right was surprisingly tricky). |
| 732 |
|
| 733 |
I'm still debating whether this should be "the new way", or just for those |
| 734 |
wishing to build their own duplicate detection heuristic. Feedback (on the |
| 735 |
list) would be interesting. |
| 736 |
|
| 737 |
|
| 738 |
2018-07-29 |
| 739 |
|
| 740 |
- Updated to flex-2.6.4. |
| 741 |
|
| 742 |
|
| 743 |
2018-07-28 |
| 744 |
|
| 745 |
- Added a utility to import modules by dotted string name. |
| 746 |
|
| 747 |
|
| 748 |
2018-07-19 |
| 749 |
|
| 750 |
* Fixed #319: Incorrect version number from 2.1.2-devel to 2.1.3-devel. |
| 751 |
|
| 752 |
|
| 753 |
2018-07-28 |
| 754 |
|
| 755 |
- Added automated unit test for calling identify() from the importers test |
| 756 |
suite, expecting True, always. |
| 757 |
|
| 758 |
|
| 759 |
2018-05-31 |
| 760 |
|
| 761 |
- Created a new plugin: "fill_account" to automatically insert a posting with |
| 762 |
a default account name where there's a single posting. Will use this while |
| 763 |
traveling as a lot of the expenses come from cash; this should significantly |
| 764 |
shorten such files. |
| 765 |
|
| 766 |
- Changed template for version number from {date|short} to {date(date, "%s%)} |
| 767 |
as per discussion on #304 (thanks to Jason Chu for looking up the detail for |
| 768 |
this). |
| 769 |
|
| 770 |
|
| 771 |
2018-05-29 |
| 772 |
|
| 773 |
- Refactored the call to find duplicates in imported files so that it can be |
| 774 |
called only once with all the results from all the importers. This should |
| 775 |
eventually allow a user-provided function that can merge entries between |
| 776 |
importers. Existing behavior should be unaffected (though there may be a |
| 777 |
small delay until everything gets printed out; all the importers are invoked |
| 778 |
before any output is written). See #298. |
| 779 |
|
| 780 |
|
| 781 |
2018-05-28 |
| 782 |
|
| 783 |
- Fixed bug with tempdir being a symlink on Mac, which was making one test |
| 784 |
fail. |
| 785 |
|
| 786 |
- Fixed unit tests which failed due to timestamps getting rendered with an |
| 787 |
offset on a Mac while on a train in Japan. |
| 788 |
|
| 789 |
- Render tags and links on Document directive. |
| 790 |
|
| 791 |
- Minor bug fix: don't fail on rendering a MISSING instnace. |
| 792 |
|
| 793 |
- In 'divert_expenses' plugin, allow limiting diversions to one posting only. |
| 794 |
|
| 795 |
- Fixed unit test for git checkouts. This should fix the Travis-CI build. |
| 796 |
|
| 797 |
|
| 798 |
* Version: 2.1.2 |
| 799 |
|
| 800 |
2018-05-12 |
| 801 |
|
| 802 |
- Fixed setup.py to catch exceptions in the absence of git as well. |
| 803 |
|
| 804 |
|
| 805 |
* Version: 2.1.1 |
| 806 |
|
| 807 |
2018-05-12 |
| 808 |
|
| 809 |
- Fixed installation with missing version string. |
| 810 |
|
| 811 |
|
| 812 |
* Version: 2.1.0 |
| 813 |
|
| 814 |
2018-05-12 |
| 815 |
|
| 816 |
- Added back lexer test from Adrian Medrano Calvo's UTF8 changes to head. |
| 817 |
|
| 818 |
|
| 819 |
2018-05-08 |
| 820 |
|
| 821 |
- Fixed #287: In the price fetcher, store the datetime instances as |
| 822 |
naive-in-UTC in order to avoid a serialization problem with older Python |
| 823 |
versions. |
| 824 |
|
| 825 |
|
| 826 |
2018-05-06 |
| 827 |
|
| 828 |
- Changes to support git versioning if hg versioning is not available. |
| 829 |
|
| 830 |
|
| 831 |
2018-05-05 |
| 832 |
|
| 833 |
- Fixed #289: Add option to find beancount version. All scripts now support |
| 834 |
--version. |
| 835 |
|
| 836 |
- Amended PR64 to remove the need for __getitem__(). Clarified docstring. |
| 837 |
|
| 838 |
- Merged PR64 from Jakob Schnitzer: Inventory: use dict instead of list as a |
| 839 |
base. |
| 840 |
|
| 841 |
|
| 842 |
2018-05-04 |
| 843 |
|
| 844 |
- Fixed #290: Validation of account name components was incorrectly swapped. |
| 845 |
|
| 846 |
|
| 847 |
2018-05-03 |
| 848 |
|
| 849 |
- Amended PR74: Adding a new unit test, fail if tags / link appear after the |
| 850 |
first posting. Performance amendment to tags/links and clarification to the |
| 851 |
freezing of tags & links and their default values. |
| 852 |
|
| 853 |
- Merged PR74 / Fixed #99: Allow tags and links to be spread over several |
| 854 |
lines. |
| 855 |
|
| 856 |
- Amended PR14: added simple unit testing for regexp, changes in parsing UTF-8 |
| 857 |
account type to match changes in Beancount head. |
| 858 |
|
| 859 |
- Merged PR14 by Adrian Medrano Calvo: Support account names to consist of |
| 860 |
Unicode letters and numbers. |
| 861 |
|
| 862 |
2018-05-02 |
| 863 |
|
| 864 |
- Removed a few accidental __author__ metadatas from files, normalized to |
| 865 |
__copyright__ as all other files. |
| 866 |
|
| 867 |
|
| 868 |
2018-05-01 |
| 869 |
|
| 870 |
- Added patch for clean build for lexer. 2.6.1 results in a build warning. |
| 871 |
|
| 872 |
- Merged PR73 (Ethan Glasser-Camp) - Cleanups to lexer and more restrictive |
| 873 |
syntax for comments within a transaction's indented block. |
| 874 |
|
| 875 |
- Fixed failing test re. new grammar. |
| 876 |
|
| 877 |
- Merged PR29: Update grammar to allow comments in the middle of transactions |
| 878 |
(Ethan Glasser-Camp). |
| 879 |
|
| 880 |
- Merged PR71: Use enhanced extract method which passes existing entries |
| 881 |
(Patrick Ruckstuhl). |
| 882 |
|
| 883 |
|
| 884 |
2018-04-29 |
| 885 |
|
| 886 |
- Added polymorphic POSSIGN(_, account) function to the SQL shell in order to |
| 887 |
support correcting for per-account sign. |
| 888 |
|
| 889 |
- Implemented polymorphic NEG() function in the SQL shell, which works on |
| 890 |
instances of Decimal, Amount, Position, Inventory. |
| 891 |
|
| 892 |
- Changed the SQL shell's operators to dispatch to Python's default operator |
| 893 |
selection instead of coercing to Decimal instances. |
| 894 |
|
| 895 |
|
| 896 |
2018-04-28 |
| 897 |
|
| 898 |
- Added QUARTER() function to the SQL shell. |
| 899 |
(See https://groups.google.com/d/msg/beancount/fTlSnQRPayo/1yN8zd76AAAJ.) |
| 900 |
|
| 901 |
- Updated version of flex on Ubuntu (2.6.1) generates warnings. Fixed a few. |
| 902 |
But Beancount now fails on account names with a dash in them; added a test |
| 903 |
for those. (The lexer is not the issue; I suspect a bison update from 4/17.) |
| 904 |
|
| 905 |
|
| 906 |
2018-04-18 |
| 907 |
|
| 908 |
- Fixed #157: Building a price map with zero prices should not fail, |
| 909 |
especially when done accidentally. |
| 910 |
|
| 911 |
- Fixed #264: Converted zip compression in bake from using an external zip |
| 912 |
tool to using the 'zipfile' module packaged with Python. I'm doing this to |
| 913 |
fix the CI build as well. |
| 914 |
|
| 915 |
|
| 916 |
2018-04-17 |
| 917 |
|
| 918 |
- Fixed #265: Refined the timezone specification of the price sources. In |
| 919 |
doing this, I documented it in the beancount.prices.source module and now |
| 920 |
pass in a timezone-aware datetime instance instead of a date, and the source |
| 921 |
is now required to also require a timezone-aware datetime instance. I fixed |
| 922 |
all the tests, and added a utility to simulate running them from different |
| 923 |
timezones. |
| 924 |
|
| 925 |
- Implemented multi-file support for bean-doctor context command. Use it like |
| 926 |
this: |
| 927 |
|
| 928 |
bean-doctor context <toplevel.beancount> <file.beancount>:<lineno> |
| 929 |
|
| 930 |
The previous syntax is still supported; like this: |
| 931 |
|
| 932 |
bean-doctor context <toplevel.beancount> <lineno> |
| 933 |
|
| 934 |
|
| 935 |
2018-04-05 |
| 936 |
|
| 937 |
- Since I added a dependency on 'requests', forgot to add to checkdeps. Done. |
| 938 |
|
| 939 |
|
| 940 |
2018-04-04 |
| 941 |
|
| 942 |
- Handle error on an invalid implementation of a price source (e.g., in this |
| 943 |
case an obsoleted price source string of 'google' imports something else and |
| 944 |
referenceing .Source fails). |
| 945 |
|
| 946 |
- Bubble up error from Yahoo price source. |
| 947 |
|
| 948 |
- Fixed #267: Implemented a price source from the IEX exchange. |
| 949 |
|
| 950 |
|
| 951 |
2018-04-03 |
| 952 |
|
| 953 |
- Implemented Quandl importer on its REST API. Another implementation, based |
| 954 |
on the Quandl Python client API was proposed by Hugo Ideler (see PR34), but |
| 955 |
I didn't want to add a dependency on the client library (nor on Pandas), and |
| 956 |
after reading the description on Quandl API's website, I figured the library |
| 957 |
was simple enough the output could be parsed directly. I wrote a new |
| 958 |
implementation from scratch, parsing just the time-series datasets. |
| 959 |
|
| 960 |
- Merged PR68 from Martin Michlmayr, added Travis Yaml support file. |
| 961 |
|
| 962 |
- Fixed Emacs functionality to uncomment regions (change submitted by Stefan |
| 963 |
Monnier on the list). |
| 964 |
|
| 965 |
|
| 966 |
2018-04-02 |
| 967 |
|
| 968 |
- Fixed #193: Removed the broken Google Finance price source importer. Google |
| 969 |
has removed this service in the favor of a special Search page and this has |
| 970 |
been broken for the recent little while. |
| 971 |
|
| 972 |
- Fixed #203: Updated the Yahoo price source implementation to use the |
| 973 |
undocumented v7 and v8 APIs; moved away from the "ichart" and "download" |
| 974 |
APIs. The Yahoo importer is back in function. |
| 975 |
|
| 976 |
This introduced a new dependency on the awesome 'requests' library, which |
| 977 |
really, was quite inevitable). |
| 978 |
|
| 979 |
|
| 980 |
2018-04-01 |
| 981 |
|
| 982 |
- Merged PR65: Use parse_version to compare versions; then replicated |
| 983 |
parse_version() locally to avoid the dependency on setuptools. |
| 984 |
|
| 985 |
- Merged PR15 by Johannes Harms: |
| 986 |
Added the following features to the forecasting plugin: |
| 987 |
- Yearly repetition of recurring transactions (instead of just monthly) |
| 988 |
- Users may optionally specify an end date |
| 989 |
- Users may optionally specify the number of repetitions |
| 990 |
"I used this code to calculate scenarios for a possible real estate purchase |
| 991 |
and I contribute a cleaned-up version as an example file." |
| 992 |
|
| 993 |
- Merged PR54 & Fixed #232: Align quoted commodities correctly in ledger price |
| 994 |
statements (from Martin Michlmayr). |
| 995 |
|
| 996 |
- Merged PR57: query_execute: Allow ordering by columns which may be None |
| 997 |
(from Jakob Schnitzer). Made some adjustments to generalize on all |
| 998 |
datatypes. |
| 999 |
|
| 1000 |
- Merged PR62: Also allow 0/0 in SAFEDIV() (from Jakob Schnitzer), with small |
| 1001 |
adjustments to catch only the specific invalid operations on Decimal. |
| 1002 |
|
| 1003 |
- Merged PR64 from yagebu@ (Jakob Schnitzer), which makes the Inventory class |
| 1004 |
rely on the fact that Position is immutable in order to avoid unnecessary |
| 1005 |
copies. This yields an 18% speedup with no difference. |
| 1006 |
|
| 1007 |
- Removed unused and invalid mutating method Position.set_units(). Amazing |
| 1008 |
obsolete stuff like this can still be found. |
| 1009 |
|
| 1010 |
|
| 1011 |
2018-03-31 |
| 1012 |
|
| 1013 |
- Fixed #10: "print from close_date" causes problems on account open. This was |
| 1014 |
stemming from a bug in the implementation of the FROM clause execution. I |
| 1015 |
changed the "entry" context functions to also accept a RowContext object, as |
| 1016 |
the simple functions may be called in either entry or posting context. |
| 1017 |
|
| 1018 |
(The SQL shell remains the part of Beancount which is severely undertested |
| 1019 |
and wading into that code once again has convinced me I need to rewrite the |
| 1020 |
shell from scratch, it'll be simpler and better. The distinction between |
| 1021 |
entry and posting context will go away in the next version.) |
| 1022 |
|
| 1023 |
- Fixed #120: Documents directive with a trailing slash fails. |
| 1024 |
|
| 1025 |
|
| 1026 |
2018-03-28 |
| 1027 |
|
| 1028 |
- Fixed failing test in amount_test probably due to some recent merges. |
| 1029 |
|
| 1030 |
|
| 1031 |
2018-03-27 |
| 1032 |
|
| 1033 |
- Completed PR #59 which adds support for globbing patterns in includes, |
| 1034 |
inserting a chdir() around glob.glob() to handle expansion of relative |
| 1035 |
filenames. (Credits to Martin Michlmayr for submitting the patch in the |
| 1036 |
first place.) |
| 1037 |
|
| 1038 |
|
| 1039 |
* Version: 2.0.0 |
| 1040 |
|
| 1041 |
2018-03-27 |
| 1042 |
|
| 1043 |
- Released 2.0.0. Today we're starting versioning Beancount. Many people have |
| 1044 |
been waiting for this in order to manage their dependencies (e.g. Fava |
| 1045 |
users). |
| 1046 |
|
| 1047 |
We're loosely adopting semantic versioning (https://semver.org/) where bug |
| 1048 |
fixes will be posted as 0.0.x releases, and new features that don't break |
| 1049 |
existing functionality (nor change it too much) will be posted as 0.x.0 |
| 1050 |
releases. |
| 1051 |
|
| 1052 |
Note: There's nothing special about this particular point in time, other |
| 1053 |
than I haven't added much features in the last six months and have mainly |
| 1054 |
been fixing bugs and accepting bug reports in order to make sure things are |
| 1055 |
stable. There are plenty remaining bug reports and it's not perfect. |
| 1056 |
Addressing some of these will involve making changes that could break |
| 1057 |
existing functionality. For this reason, I prefer to release now and make |
| 1058 |
those changes as part of point releases later on. |
| 1059 |
|
| 1060 |
|
| 1061 |
2018-03-26 |
| 1062 |
|
| 1063 |
- Fixed #245: Synchronized the definition of a valid account regular |
| 1064 |
expression between the lexer and the later enhanced version (in Python) |
| 1065 |
which checks the configured prefixes. A valid subaccount name may start with |
| 1066 |
either a capital letter or a number. |
| 1067 |
|
| 1068 |
|
| 1069 |
2018-03-23 |
| 1070 |
|
| 1071 |
- Removed deprecated methods from beancount.core (position, inventory, |
| 1072 |
interpolation). |
| 1073 |
|
| 1074 |
|
| 1075 |
2018-03-22 |
| 1076 |
|
| 1077 |
- Fixed #249: Error messages involving postings should start counting at 1 |
| 1078 |
instead of 0. (I agree.) |
| 1079 |
|
| 1080 |
- Added aliases for COMMODITY_META() vs. CURRENCY_META() and CURRENCY() and |
| 1081 |
COMMODITY(). These terms are used interchangeably. In the next version of |
| 1082 |
the shell, only one of them will be available. |
| 1083 |
|
| 1084 |
- Removed the ability to explicitly set a different price currency than a cost |
| 1085 |
currency. I'm stunned my test for this is gone, I must have removed this by |
| 1086 |
accident? No idea. It should not be allowed. |
| 1087 |
|
| 1088 |
|
| 1089 |
2018-03-19 |
| 1090 |
|
| 1091 |
- Fixed #218, added a SAFEDIV function to the shell language. |
| 1092 |
|
| 1093 |
- Fixed #239, HELP command should tolerate semicolons and whitespace. |
| 1094 |
(Also, don't print shell commands in test (remove docstrings), we want the |
| 1095 |
name of the tests to list, not the input.) |
| 1096 |
|
| 1097 |
|
| 1098 |
2018-03-13 |
| 1099 |
|
| 1100 |
- Removed SIMPLE booking method and all traces of it, including the |
| 1101 |
'booking_algorithm' option. Only the later (I hesitate to say "newer" |
| 1102 |
because it's been around for years) FULL booking method is supported |
| 1103 |
onwards. |
| 1104 |
|
| 1105 |
- Fixed #35: Implemented implicit group-by syntax. That is, if you omit the |
| 1106 |
GROUP BY clause, it is automatically inferred to be the non-aggregate |
| 1107 |
columns. This make writing the type of simple queries we do much more |
| 1108 |
convenient and allows you to be a little sloppy. |
| 1109 |
|
| 1110 |
- Fixed bug with unit test util for docutil, which was stripping the first |
| 1111 |
empty line of the docstring (and failing). |
| 1112 |
|
| 1113 |
|
| 1114 |
2018-03-02 |
| 1115 |
|
| 1116 |
- Made the 'readline' library conditional, for Windows support. |
| 1117 |
See PR46. |
| 1118 |
|
| 1119 |
|
| 1120 |
2018-02-23 |
| 1121 |
|
| 1122 |
- Fixed #219: Restored sorting of the entries in the extractor. File order |
| 1123 |
will have to be maintained by extracting the line no, which is used as a |
| 1124 |
secondary key. |
| 1125 |
|
| 1126 |
|
| 1127 |
2018-02-19 |
| 1128 |
|
| 1129 |
- Added prototype for converting Google Docs doc from docx and rst |
| 1130 |
conversions, using the docx blocks to insert indented versions in the rst |
| 1131 |
file. |
| 1132 |
|
| 1133 |
- Removed deprecated beancount.ops.prices module. |
| 1134 |
|
| 1135 |
|
| 1136 |
2018-02-17 |
| 1137 |
|
| 1138 |
- Added an option to the CSV importer for the string separating the narration |
| 1139 |
(default: "; "). |
| 1140 |
|
| 1141 |
- Merged a change submitted by @droogmic to add options for the dateutils |
| 1142 |
parser, in order to disambiguate between day-first (DD-MM-YYYY) vs. |
| 1143 |
month-first (MM-DD-YYYY) date representations. |
| 1144 |
|
| 1145 |
- Created a new plugin "check_closing" that automatically inserts a zero |
| 1146 |
balance check after postings which are known - and flagged, using metadata - |
| 1147 |
to be closing trades. |
| 1148 |
|
| 1149 |
- Fixed bug in "sellgains" plugin whereby a price of zero units failed an |
| 1150 |
assertion. Added a test. |
| 1151 |
|
| 1152 |
|
| 1153 |
2018-02-12 |
| 1154 |
|
| 1155 |
- Added a side-effects local variable saver utility for writing importers. |
| 1156 |
|
| 1157 |
- Fixed #212: Clarified error message for error in covering non-aggregate |
| 1158 |
targets. |
| 1159 |
|
| 1160 |
- The Importer.extract() method now accepts a new parameters with the prior |
| 1161 |
entries (or None, if not specified) as 'existing_entries'. It's free to use |
| 1162 |
that as it pleases in order to flag entries as duplicates. The entries |
| 1163 |
returned by Importer.extract() will be checked for __duplicate__ metadata |
| 1164 |
and automatically inserted to that set if it is present. This allows the |
| 1165 |
importer to return some duplicate entries for context - which will be |
| 1166 |
rendered as such in the output, e.g. commented out - without having to |
| 1167 |
necessarily throw them away. |
| 1168 |
|
| 1169 |
(The previous signature is still supported in order to avoid breaking |
| 1170 |
everyone's importers.) |
| 1171 |
|
| 1172 |
|
| 1173 |
2018-01-31 |
| 1174 |
|
| 1175 |
- Modified 'divert_expenses' plugin to store the original account name as |
| 1176 |
metadata of diverted postings, so that they can be picked up by the |
| 1177 |
extract_tagged script and brought back into the extract file. |
| 1178 |
|
| 1179 |
|
| 1180 |
2018-01-29 |
| 1181 |
|
| 1182 |
- Created a new 'divert_expenses' plugin to redirect Expenses postings from |
| 1183 |
transactions tagged with a particular tag to another account. See this |
| 1184 |
thread for details: |
| 1185 |
https://docs.google.com/drawings/d/18fTrrGlmz0jFbfcGGHTffbdRwbmST8r9_3O26Dd1Xww/edit?usp=sharing |
| 1186 |
|
| 1187 |
- Added account_types.is_account_type() function, which should be used above |
| 1188 |
account_types.get_account_type(). |
| 1189 |
|
| 1190 |
|
| 1191 |
2018-01-23 |
| 1192 |
|
| 1193 |
- Removed the insertion of 'balance' metadata from the importer. We use it for |
| 1194 |
inserting Balance entries, not attach as metadata. |
| 1195 |
|
| 1196 |
- Disabled Balance insertion CSV test; |
| 1197 |
03d9a5c3b2784a6f6a05c12eaeb7776f0478a96d broke the insertion of Balance |
| 1198 |
entries without inserting 'balance' metadata. We'll probably have to revert the |
| 1199 |
sorting changes and that. For now, fix the test. |
| 1200 |
|
| 1201 |
- Fixed #210: Changed the bean-price option --undeclared to accept a string |
| 1202 |
value, the name of the Python source module to use for fetching undeclared |
| 1203 |
commodities. |
| 1204 |
|
| 1205 |
- Added an error on using explicit merge cost syntax (this one: {..., *}). |
| 1206 |
It's not supported yet, like AVERAGE cost booking (I probably should not |
| 1207 |
have enabled the syntax until it was done. I was hopeful and moving fast at |
| 1208 |
the time). |
| 1209 |
|
| 1210 |
|
| 1211 |
2018-01-16 |
| 1212 |
|
| 1213 |
- CSV importer: Added an option not to add balance metadata to output. |
| 1214 |
- CSV importer: Also, fixed a bug I introduced in the recent PR merge with |
| 1215 |
rendering the name of the importer. |
| 1216 |
- SQL importer: Made "location" field support transactions with metadata with |
| 1217 |
missing filename and line no. Some plugins might be doing that. |
| 1218 |
|
| 1219 |
|
| 1220 |
2018-01-08 |
| 1221 |
|
| 1222 |
- Fixed #209: Don't require 'ido. User will have to make sure that |
| 1223 |
beancount-use-ido is false. |
| 1224 |
|
| 1225 |
|
| 1226 |
2018-01-07 |
| 1227 |
|
| 1228 |
- Merged https://bitbucket.org/blais/beancount/pull-requests/28/allow-one-character-top-level-account, |
| 1229 |
allowing one character top-level account names in the syntax. This doesn't |
| 1230 |
mess with the flag token generateion because the account name is required to |
| 1231 |
have at least two components. |
| 1232 |
|
| 1233 |
|
| 1234 |
2017-12-09 |
| 1235 |
|
| 1236 |
- Fixed rendering of price directives to use the display context precision. |
| 1237 |
|
| 1238 |
|
| 1239 |
2017-11-24 |
| 1240 |
|
| 1241 |
- Silenced annoying warning about file_cache version incompatibility in |
| 1242 |
upload-to-sheets. |
| 1243 |
|
| 1244 |
|
| 1245 |
2017-10-28 |
| 1246 |
|
| 1247 |
- Fixed bug with identification based on the first line of a file. |
| 1248 |
|
| 1249 |
- Fixed bug with 'context' on a directive that's not a transaction. |
| 1250 |
|
| 1251 |
|
| 1252 |
2017-09-30 |
| 1253 |
|
| 1254 |
- Fixed a bug in reduction booking that would fail when the units are omitted. |
| 1255 |
|
| 1256 |
|
| 1257 |
2017-09-17 |
| 1258 |
|
| 1259 |
- Fixed bug in Balance check, detect when an account does not exist and handle |
| 1260 |
it properly. |
| 1261 |
|
| 1262 |
- Added bean-difference script, used to reconcile transactions in multiple |
| 1263 |
files after a long trip. |
| 1264 |
|
| 1265 |
|
| 1266 |
2017-09-06 |
| 1267 |
|
| 1268 |
- Added ABS() implementation to SQL shell for Position and Inventory types. |
| 1269 |
See https://groups.google.com/d/msg/beancount/0i4w98LmS6E/JJGOKSB8CQAJ |
| 1270 |
|
| 1271 |
|
| 1272 |
2017-08-08 |
| 1273 |
|
| 1274 |
- Accept account name components as numbers only. The grammar safely supports |
| 1275 |
this because of the leading semi-colon, all the tests pass, and everything |
| 1276 |
runs on my own very large input files. |
| 1277 |
|
| 1278 |
- Fixed a failing test with MIME mis-categorization which occurred under |
| 1279 |
Ubuntu. |
| 1280 |
|
| 1281 |
|
| 1282 |
2017-07-25 |
| 1283 |
|
| 1284 |
- Fixed #181: Support underscores in Python module names for price sources |
| 1285 |
(thanks to Stephan Mueller for reporting). |
| 1286 |
|
| 1287 |
|
| 1288 |
2017-07-23 |
| 1289 |
|
| 1290 |
- Fixed #179: Scientific notation should never appear in rendered output. |
| 1291 |
|
| 1292 |
|
| 1293 |
2017-07-02 |
| 1294 |
|
| 1295 |
- Fixed minor bug with rendering postings with missing numbers. |
| 1296 |
|
| 1297 |
|
| 1298 |
2017-07-06 |
| 1299 |
|
| 1300 |
- More changes on #173: use a stringify two-level macro in order to place the |
| 1301 |
parser source hash as a string in the source file. Hopefully this should |
| 1302 |
also work under MSDEV. |
| 1303 |
|
| 1304 |
|
| 1305 |
2017-07-05 |
| 1306 |
|
| 1307 |
- Fixed #173: Added a potential fix for building under MSDEV. Thanks to Alan |
| 1308 |
Ray for pointing out a method to build with MSDEV under Windows. |
| 1309 |
|
| 1310 |
|
| 1311 |
2017-06-25 |
| 1312 |
|
| 1313 |
- Fixed a minor bug in the tolerance inference code that wouldn't accept a |
| 1314 |
posting with a missing number only, e.g. Assets:Checking USD @ 1.32 CAD. |
| 1315 |
|
| 1316 |
- Added a "--no-colon" option to both bean-web and bean-bake in order to |
| 1317 |
support Windows filesystems which do not allow colons in filenames. |
| 1318 |
|
| 1319 |
|
| 1320 |
2017-06-22 |
| 1321 |
|
| 1322 |
- Added --numberify option to bean-query, which for CSV output will remove the |
| 1323 |
currencies of any Amount column. This is great for then uploading to a |
| 1324 |
spreadsheet. |
| 1325 |
|
| 1326 |
|
| 1327 |
2017-05-28 |
| 1328 |
|
| 1329 |
- Merged patch from Felix Eckhofer that adds an option to bean-format to make |
| 1330 |
it use a fixed width. I've been wanting this myself for a while actually, I |
| 1331 |
think a fixed value makes more sense than what I'd done previously and |
| 1332 |
should eventually be made the default. |
| 1333 |
|
| 1334 |
|
| 1335 |
2017-05-24 |
| 1336 |
|
| 1337 |
- Implemented beancount.plugins.auto and beancount.plugins.pedantic. I've been |
| 1338 |
wanting to do this for a while. When writing quick-and-dirty little tests, |
| 1339 |
inserting 'plugin "beancount.plugins.auto"' is quick and does the job, and |
| 1340 |
if you want absolutely all the verifications and to make Beancount as |
| 1341 |
pedantic as possible, you should be able to adopt 'plugin |
| 1342 |
"beancount.plugins.pedantic"'. |
| 1343 |
|
| 1344 |
In order to do that I had to make the loader support plugin definitions |
| 1345 |
whose __plugins__ attribute is a function reference, not just a string. It |
| 1346 |
supports both now. |
| 1347 |
|
| 1348 |
- A number like this now fails to parse: 1,245,449,72.00 USD. I added a test |
| 1349 |
in the lexer to tighten the parser. This has been brought up before and will |
| 1350 |
potentially avoid input errors. |
| 1351 |
|
| 1352 |
|
| 1353 |
2017-05-20 |
| 1354 |
|
| 1355 |
- Clarified error message for price format specified on the command-line. |
| 1356 |
|
| 1357 |
|
| 1358 |
2017-05-08 |
| 1359 |
|
| 1360 |
- Made the open/close map return by the getters not a defaultdict by default, |
| 1361 |
so that accidentally looking up elements won't mutate it. |
| 1362 |
|
| 1363 |
|
| 1364 |
2017-04-30 |
| 1365 |
|
| 1366 |
- Moved src/python/beancount/... to beancount/... |
| 1367 |
The purpose is to structure this project in the most common way |
| 1368 |
people expect it (most Python OSS projects have this structure, with the |
| 1369 |
package name directory at the root). I've had this other structure for a |
| 1370 |
while mainly for historical reasons. I wanted to make this clean before |
| 1371 |
baking a final 2.0 release and switching to numbered releases. |
| 1372 |
|
| 1373 |
- Moved src/elisp/beancount.el to editors/emacs/beancount.el and made |
| 1374 |
necessary adjustments. |
| 1375 |
|
| 1376 |
- Merged incomplete changes from booking branch to "default." The work on |
| 1377 |
supporting self-reduction (see |
| 1378 |
http://furius.ca/benacount/doc/self-reductions) won't be carried during 2.0, |
| 1379 |
it will be subject of a subsequent release. |
| 1380 |
|
| 1381 |
- This concludes the merging of all the branches, which I've done in order to |
| 1382 |
move the source to a more regular project directory (under /beancount). |
| 1383 |
|
| 1384 |
|
| 1385 |
2017-04-29 |
| 1386 |
|
| 1387 |
- Fixed #27: IN membership operator did not have a proper precedence definition. |
| 1388 |
|
| 1389 |
|
| 1390 |
2017-03-19 |
| 1391 |
|
| 1392 |
- Fixed minor bug with CSV importer that would occur when the file has no |
| 1393 |
valid columns. |
| 1394 |
|
| 1395 |
|
| 1396 |
2017-01-26 |
| 1397 |
|
| 1398 |
- (internal) Moved the implementation of booking methods to its own |
| 1399 |
beancount.parser.booking_methods module. |
| 1400 |
|
| 1401 |
- (internal) Split up the booking methods to functions for exhaustive testing |
| 1402 |
and allowing others to implement new methods more easily if desired. |
| 1403 |
|
| 1404 |
|
| 1405 |
2017-01-22 |
| 1406 |
|
| 1407 |
- Added new price source fetcher from OANDA's API. It supports a large number |
| 1408 |
of currency pairs with tickers like this "XXX_YYY", such as "EUR_USD". Use |
| 1409 |
it like the other price sources, e.g., like this: |
| 1410 |
|
| 1411 |
bean-price -e 'USD:oanda/EUR_USD' |
| 1412 |
|
| 1413 |
- Began working on the conversion of Google Docs to reStructuredText for |
| 1414 |
inclusion in Dominik Aumayr's docs. |
| 1415 |
|
| 1416 |
|
| 1417 |
2017-01-21 |
| 1418 |
|
| 1419 |
- Fixed #155: Use entry_points instead of scripts in setup.py. |
| 1420 |
|
| 1421 |
- Added an extra check for Balance directives, verifying that asserted |
| 1422 |
currencies are accepted currencies for that account (if the account's |
| 1423 |
corresponding currencies have been declared explicitly). In other words, |
| 1424 |
this will now fail instead of being silently ignored: |
| 1425 |
|
| 1426 |
2017-01-21 open Assets:Checking CAD |
| 1427 |
2017-01-21 balance Assets:Checking 0.00 USD |
| 1428 |
|
| 1429 |
- Fixed bug in sheets_upload.py / upload-to-sheets whereby all the fields of a |
| 1430 |
sheet being updated just in order to resize it was causing the sheet to be |
| 1431 |
reindexed at the front of the list of sheets. |
| 1432 |
|
| 1433 |
- Merged 'arithmetic_ops' branch with no effect, in order to move all files |
| 1434 |
and release. This will have to be revisited later. |
| 1435 |
|
| 1436 |
|
| 1437 |
2017-01-19 |
| 1438 |
|
| 1439 |
- Fixed bug with generation of column names in sheets uploader script. |
| 1440 |
|
| 1441 |
|
| 1442 |
2017-01-16 |
| 1443 |
|
| 1444 |
- Removed tools/gauth (used to be beancount.docs.gauth). All users of this are |
| 1445 |
slightly different, and they're utility scripts. Unfactoring. |
| 1446 |
|
| 1447 |
- Removed beancount.docs from Beancount library. These are internal tools used |
| 1448 |
to manage documentation, should not be included in the installed codebase. |
| 1449 |
|
| 1450 |
- Some cleanup of internal tools. |
| 1451 |
|
| 1452 |
- Added some basic unit tetsts for beancount.tools.sheets_upload. |
| 1453 |
|
| 1454 |
- Moved bin/upload-to-sheets to src/python/beancount/tools/sheets_upload.py |
| 1455 |
and replaced it with an associated stub for it. |
| 1456 |
|
| 1457 |
- Moved bin/treeify to src/python/beancount/tools/treeify.py. The script is |
| 1458 |
still usable in a standalone form (no new dependencies have been added). To |
| 1459 |
have all the source code in one place is more convenient for maintenance. |
| 1460 |
|
| 1461 |
- Created a beancount.tools package to contain all standalone tools which |
| 1462 |
don't depend on Beancount modules or packages. |
| 1463 |
|
| 1464 |
- Removed branch "returns2" and moved associated projects script |
| 1465 |
beancount.projects.returns to experiments/returns. This code isn't robust |
| 1466 |
enough to work for everyone, and so therefore I'm moving it back to |
| 1467 |
experiments until I have time to produce something that will work very |
| 1468 |
robustly, and on all my own accounts as well. |
| 1469 |
|
| 1470 |
|
| 1471 |
2017-01-15 |
| 1472 |
|
| 1473 |
(from branch "conversions") |
| 1474 |
|
| 1475 |
- Created and test beancount.core.convert Posting and Position conversion |
| 1476 |
functions: get_units(), get_cost(), get_weight(), get_value() (for market |
| 1477 |
value). |
| 1478 |
|
| 1479 |
- Implemented Inventory.reduce() and associated test, which works in |
| 1480 |
conjunction with those. |
| 1481 |
|
| 1482 |
- Implemented more straightforward versions of convert_position() and |
| 1483 |
convert_amount() in module beancount.core.convert, to convert positions and |
| 1484 |
amounts to other currencies. |
| 1485 |
|
| 1486 |
- Deprecated Inventory.units(); use Inventory.reduce(convert.get_units) |
| 1487 |
|
| 1488 |
- Deprecated Inventory.cost(); use Inventory.reduce(convert.get_cost) |
| 1489 |
|
| 1490 |
- Deprecated Inventory.get_units() to Inventory.get_currency_units() in order to |
| 1491 |
avoid future name confusion. |
| 1492 |
|
| 1493 |
- Deprecated Position.at_cost(); use convert.get_cost(position) instead. |
| 1494 |
|
| 1495 |
- Deprecated Position.get_cost(); use convert.get_cost(position) instead. |
| 1496 |
|
| 1497 |
- Deprecated b.c.interpolation.compute_cost_basis(); use |
| 1498 |
Inventory.(pos for pos in positions if pos.cost is not |
| 1499 |
None).reduce(convert.get_cost) |
| 1500 |
instead. |
| 1501 |
|
| 1502 |
- Deprecated get_posting_weight(); use convert.get_weight() instead. |
| 1503 |
|
| 1504 |
- Removed b.ops.holdings.get_pholding_market_value(), which was unused. |
| 1505 |
If you need a market-value function, use convert.get_value() instead. |
| 1506 |
|
| 1507 |
- Converted all the old code to these new converted functions. |
| 1508 |
|
| 1509 |
- Moved module beancount.ops.prices to beancount.core.prices, and added a |
| 1510 |
deprecation warning. |
| 1511 |
|
| 1512 |
- Deprecated shell function PRICE(). Renamed it to GETPRICE() in order to |
| 1513 |
avoid confusion. |
| 1514 |
|
| 1515 |
- Removed beancount.core.prices.convert_amount(). Use |
| 1516 |
beancount.core.convert.convert_amount() instead. Note that a failure doesn't |
| 1517 |
return None anymore, but an unmodified amount. Also notice the reordering of |
| 1518 |
parameters to be consistent with the other functions in that module. |
| 1519 |
|
| 1520 |
- Removed beancount.core.prices.get_position_market_value(); |
| 1521 |
use convert.get_value() instead. |
| 1522 |
|
| 1523 |
- Removed beancount.core.prices.get_inventory_market_value(); |
| 1524 |
use Inventory.reduce(convert.get_value, price_map) instead. |
| 1525 |
|
| 1526 |
- Removed private functions |
| 1527 |
beancount.query.query_env.convert_amount(), |
| 1528 |
beancount.query.query_env.convert_position(), and |
| 1529 |
beancount.query.query_env.value_position(), |
| 1530 |
beancount.query.query_env.value_inventory(). |
| 1531 |
These used to issue warnings if the conversion could not be carried out; now |
| 1532 |
they simply keeps the units of the position instead. |
| 1533 |
|
| 1534 |
|
| 1535 |
2017-01-15 |
| 1536 |
|
| 1537 |
- Fixed all tests for Python-3.6. |
| 1538 |
Beancount has not officially been ported to Python-3.6. |
| 1539 |
|
| 1540 |
|
| 1541 |
2017-01-14 |
| 1542 |
|
| 1543 |
- Fixed bug with generation of example that would produce an incorrect initial |
| 1544 |
balance for banking accounts. The example test should have been broken. (No |
| 1545 |
idea why this wasn't deteted earlier, probably by chance.) |
| 1546 |
|
| 1547 |
|
| 1548 |
2017-01-08 |
| 1549 |
|
| 1550 |
- Completed "Intro to Double-Entry Accounting" doc. |
| 1551 |
http://furius.ca/beancount/doc/intro |
| 1552 |
|
| 1553 |
- Added a --reverse/--descending flag to bean-extract to print the extracted |
| 1554 |
entries in reverse order. |
| 1555 |
|
| 1556 |
|
| 1557 |
2016-12-17 |
| 1558 |
|
| 1559 |
- Added a --title option to upload-to-sheets in order to conveniently set the |
| 1560 |
document's title. |
| 1561 |
|
| 1562 |
- Removed obsolete variable LEGACY_DEFAULT_TOLERANCES which had been |
| 1563 |
forgotten. |
| 1564 |
|
| 1565 |
|
| 1566 |
2016-12-15 |
| 1567 |
|
| 1568 |
- Made beancount.ingest.extract print out a stack trace when an unexpected |
| 1569 |
exception is raised. |
| 1570 |
|
| 1571 |
- Fixed bugs in beancount.query.query_render where expand wasn't being passed |
| 1572 |
through the rendering functions. |
| 1573 |
|
| 1574 |
- Deprecated bin/upload-csv-to-google-sheet; I moved the last version to |
| 1575 |
beancount/experiments/gapis in case you've come to be dependent on its |
| 1576 |
particularities. It doesn't need any of the Beancount libraries, so you can |
| 1577 |
just copy it somewhere and keep using it if so desired. |
| 1578 |
|
| 1579 |
- Replaced "bin/upload-csv-to-google-sheet" to "bin/upload-to-sheets". The |
| 1580 |
newer script is a complete rewrite which does not require the antiquated |
| 1581 |
gdata library, and which uses the latest and greatest version of the Google |
| 1582 |
Sheets API (v4). You don't need gdata anymore. Moreover, this one runs in |
| 1583 |
Python3 instead of depending on Python2. |
| 1584 |
|
| 1585 |
The script has slightly improved invocation semantics, and I'll using it |
| 1586 |
regularly to share CSV files with others, most often CSV files produced by |
| 1587 |
bean-query. |
| 1588 |
|
| 1589 |
|
| 1590 |
2016-12-11 |
| 1591 |
|
| 1592 |
- Changed b.p.split_expenses outputs to be more useful. |
| 1593 |
|
| 1594 |
|
| 1595 |
2016-12-10 |
| 1596 |
|
| 1597 |
- Made Amount, Posting, Cost and CostSpec all immutable classes that inherit |
| 1598 |
from typing.NamedTuple. |
| 1599 |
|
| 1600 |
- Removed mutable method Posting.add(). |
| 1601 |
|
| 1602 |
|
| 1603 |
2016-12-05 |
| 1604 |
|
| 1605 |
- Merged changes made for calculating wash sales a long time ago. I had |
| 1606 |
implemnted a temporary kludge to carry dates on all augmenting postings, |
| 1607 |
left it in a branch so I could use it there for taxes every year. Now that |
| 1608 |
the booking branch is merged, this is supported by default, so I could undo |
| 1609 |
that kludge. Some changes remained: |
| 1610 |
|
| 1611 |
* The Inventory.add_amount() method used to return the modified position. |
| 1612 |
Now it returns the position before being modified, which is more useful. |
| 1613 |
|
| 1614 |
* The list-wash-sales.py script has been updated. It now works on 'default'. |
| 1615 |
|
| 1616 |
* The 'carry_date_and_book_cost' branch has been merged away. |
| 1617 |
|
| 1618 |
|
| 1619 |
2016-12-04 |
| 1620 |
|
| 1621 |
- Made .tags and .links attributes of b.data.Transaction and b.data.Document |
| 1622 |
directives ensured to always be a set when they're empty. If there are no |
| 1623 |
tags (or links), those attributes are set to b.data.EMPTY_SET, whose value |
| 1624 |
is a frozenset(). This should make the processing of those attributes a bit |
| 1625 |
simpler. |
| 1626 |
|
| 1627 |
Note that if you create transactions from plugins and their tags and/or |
| 1628 |
links attributes are set None, they will now fail. The right thing to do is |
| 1629 |
to set their value to an empty set, or reuse the immutable |
| 1630 |
beancount.core.data.EMPTY_SET object. |
| 1631 |
|
| 1632 |
If you need to circumvent this temporarily, set the following option in your |
| 1633 |
file, which will allow None again: |
| 1634 |
|
| 1635 |
option "allow_deprecated_none_for_tags_and_links" "TRUE" |
| 1636 |
|
| 1637 |
See {1989ba9e0e79} for details. |
| 1638 |
|
| 1639 |
- Updated all copyright and license notices on all files. |
| 1640 |
|
| 1641 |
- Added a script to automatically verify that all source files include a |
| 1642 |
copyright notice. |
| 1643 |
|
| 1644 |
- Removed ancestral Beancount documentation from eons ago. These notes and |
| 1645 |
conversationsa are now wildly irrelevant to the current state of Beancount, |
| 1646 |
and all the documentation from Google Docs is vastly more recent and |
| 1647 |
obsoletes all these old snippets and notes. |
| 1648 |
|
| 1649 |
- Moved all development tools under tools/, from etc/ and |
| 1650 |
experiments/code-health/. |
| 1651 |
|
| 1652 |
|
| 1653 |
2016-12-03 |
| 1654 |
|
| 1655 |
- Fixed fava bug #429, avoid empty conversion entries if the cost of the |
| 1656 |
conversion balance is zero. See: |
| 1657 |
https://github.com/beancount/fava/issues/429. |
| 1658 |
|
| 1659 |
|
| 1660 |
2016-11-20 |
| 1661 |
|
| 1662 |
- Fixed bugs in bean-format; in order to do this properly I made bean-format |
| 1663 |
reuse the globally defined regular expressions for currency and account in |
| 1664 |
the rest of Beancount's code. This makes bean-format depend on the Beancount |
| 1665 |
installation. Bah, it's reasonable. This issue is related to issue #146. |
| 1666 |
|
| 1667 |
- Added ANY_META() function to the SQL shell's environment; ANY_META() allows |
| 1668 |
you to query a posting's metadata, falling back on the parent entry's |
| 1669 |
metadata. This idea was suggested by Stefano Zacchiroli in |
| 1670 |
https://groups.google.com/d/msg/beancount/jh-n4rvbQAI/Hz5Mmd60BAAJ. I also |
| 1671 |
added the first unit tests for environment functions--I'll have to write all |
| 1672 |
of those at some point. |
| 1673 |
|
| 1674 |
- Made unsupported cost specifications in the SIMPLE booking algorithm issue |
| 1675 |
an appropriate error. For example, instead of just ignoring the cost spec in |
| 1676 |
this: |
| 1677 |
|
| 1678 |
2014-10-15 * "buy widgets" |
| 1679 |
Assets:Inventory 10 WIDGET {} ;; Not supported. |
| 1680 |
Assets:Cash -80 GBP |
| 1681 |
|
| 1682 |
It will issue an error. See |
| 1683 |
https://groups.google.com/d/msg/beancount/9NBcT-SXZMQ/sy7Z3dIdBQAJ for |
| 1684 |
context. |
| 1685 |
|
| 1686 |
|
| 1687 |
2016-11-12 |
| 1688 |
|
| 1689 |
- Made the Emacs prefix key configurable via a new beancount-mode-map-prefix |
| 1690 |
variable. See discussion here: |
| 1691 |
https://groups.google.com/d/msg/beancount/_7TscZ9phNE/K8PkcRMpBAAJ |
| 1692 |
|
| 1693 |
|
| 1694 |
2016-11-06 |
| 1695 |
|
| 1696 |
- Fixed #139: Full booking parsing had been more liberal than the old SIMPLE |
| 1697 |
booking algorithm can interpret. In the old code, explicitly disallow some |
| 1698 |
interpolation cases which cannot be handled. |
| 1699 |
|
| 1700 |
- Fixed #129: Ignore custom directives for Ledger and HLedger conversion. |
| 1701 |
|
| 1702 |
|
| 1703 |
2016-11-05 |
| 1704 |
|
| 1705 |
- Fixed #142: bean-check should return non-zero exit code upon failure. |
| 1706 |
|
| 1707 |
|
| 1708 |
2016-10-30 |
| 1709 |
|
| 1710 |
- Merge the current version of the 'booking' branch and made the "FULL" booking |
| 1711 |
algorithm the default one. |
| 1712 |
|
| 1713 |
* The "experiment_booking_algorithm" option has been renamed to |
| 1714 |
"booking_algorithm". Its default value is now "FULL"; everyone will be |
| 1715 |
using the new booking code. If for some reason you have a transitional |
| 1716 |
need to revert to the older booking method use this option. |
| 1717 |
|
| 1718 |
option "booking_algorithm" "SIMPLE" |
| 1719 |
|
| 1720 |
* The new booking algorithm is _MUCH_ more powerful than the one old. I'll |
| 1721 |
describe it soon in a new document, but briefly: |
| 1722 |
|
| 1723 |
- It supports many more interpolation capabilities; try omitting amounts |
| 1724 |
or currencies which you think it ought be able to figure out |
| 1725 |
automatically and you might find it does. |
| 1726 |
|
| 1727 |
- All positions carry a date. This means that if you have transactions |
| 1728 |
that would merge because they weren't specified with a date, like this |
| 1729 |
you may face a problem: |
| 1730 |
|
| 1731 |
2016-01-15 * |
| 1732 |
Assets:Investments 70 UUG {10.00 USD} |
| 1733 |
... |
| 1734 |
|
| 1735 |
2016-02-16 * |
| 1736 |
Assets:Investments 25 UUG {10.00 USD} |
| 1737 |
... |
| 1738 |
|
| 1739 |
2016-03-30 * |
| 1740 |
Assets:Investments -80 UUG {10.00 USD} |
| 1741 |
... |
| 1742 |
|
| 1743 |
Those used to resolve automatically because both augmenting lots would |
| 1744 |
merge into a single one without a date. Now that all positions have an |
| 1745 |
acquisition date, the -80 reducing posting is ambiguous, because it |
| 1746 |
matches against these: |
| 1747 |
|
| 1748 |
Assets:Investments 70 UUG {10.00 USD, 2016-01-15} |
| 1749 |
Assets:Investments 25 UUG {10.00 USD, 2016-02-16} |
| 1750 |
|
| 1751 |
Either you'll have to disambiguate, or let Beancount do so. One way to |
| 1752 |
do this is to add more specific matching data, and split the posting. |
| 1753 |
An even easier way to do this is to make the default booking method of |
| 1754 |
this account to "FIFO" or "LIFO", which will automatically select the |
| 1755 |
oldest (newest) postings without issuing a warning. |
| 1756 |
|
| 1757 |
If you find yourself in a bind, please email the mailing-list with a |
| 1758 |
specific and as small as possible data input that reproduces the |
| 1759 |
problem. |
| 1760 |
|
| 1761 |
|
| 1762 |
- Removed parsing of the pipe (|) symbol as a separator for strings on |
| 1763 |
transaction description lines. This was vestigial from the days long long |
| 1764 |
ago when Beancount was attempting to be compatible with Ledger syntax; this |
| 1765 |
is wholly unnecessary how. |
| 1766 |
|
| 1767 |
You will have to convert transactions like this: |
| 1768 |
|
| 1769 |
2015-08-25 * "Tunnel" | "Coffees" |
| 1770 |
Expenses:Food:Coffee 15 CAD |
| 1771 |
Assets:Cash |
| 1772 |
|
| 1773 |
Into transactions like this: |
| 1774 |
|
| 1775 |
2015-08-25 * "Tunnel" "Coffees" |
| 1776 |
Expenses:Food:Coffee 15 CAD |
| 1777 |
Assets:Cash |
| 1778 |
|
| 1779 |
This can be done using a sed script, or as a macro in your favorite text editor. |
| 1780 |
If you need a temporary respite, you can use the following option, which |
| 1781 |
will replace all the error messages by a single warning: |
| 1782 |
|
| 1783 |
option "allow_pipe_separator" "TRUE" |
| 1784 |
|
| 1785 |
Support for this option will be removed eventually. |
| 1786 |
|
| 1787 |
|
| 1788 |
- Moved the {{...}}} total cost syntax from a legacy support with only "/" |
| 1789 |
separator and a date, no label, to full support. Previously, only these syntaxes |
| 1790 |
were supported for total cost: |
| 1791 |
|
| 1792 |
Assets:Account 100 MSFT {{2000.00 USD}} |
| 1793 |
Assets:Account 100 MSFT {{2000.00 USD / 2016-10-30}} |
| 1794 |
|
| 1795 |
Changes: |
| 1796 |
|
| 1797 |
* The "/" separator support has been removed, you must now use a comma, like |
| 1798 |
for the {...} full booking syntax. |
| 1799 |
|
| 1800 |
* The same syntax as for the regular {...} compound cost is supported; |
| 1801 |
however, specifying a compound amount will raise an error, and the |
| 1802 |
per-unit cost is interpreted as a total cost. |
| 1803 |
|
| 1804 |
For example, this: |
| 1805 |
|
| 1806 |
Assets:Account 100 MSFT {{2000.00 USD}} |
| 1807 |
|
| 1808 |
is interpreted as: |
| 1809 |
|
| 1810 |
Assets:Account 100 MSFT {0 # 2000.00 USD} |
| 1811 |
|
| 1812 |
which is equivalent to: |
| 1813 |
|
| 1814 |
Assets:Account 100 MSFT {20.00 USD} |
| 1815 |
|
| 1816 |
And the following will raise an error, it is not legal syntax: |
| 1817 |
|
| 1818 |
Assets:Account 100 MSFT {{0 # 2000.00 USD}} |
| 1819 |
|
| 1820 |
Finally, specifying a date and a label can be done, just like for {...}: |
| 1821 |
|
| 1822 |
Assets:Account 100 MSFT {{2000.00 USD, 2011-10-30, "ref32"}} |
| 1823 |
|
| 1824 |
The intention here is to deprecate the older limited syntax while keeping |
| 1825 |
support for total cost input using {{...}}. Based on previous questions, I |
| 1826 |
suspect that many users are still using {{...}} instead of {{# ...}}, so I |
| 1827 |
won't remove it just yet. |
| 1828 |
|
| 1829 |
- Removed very old compatibility code in beancount.core.amount that lived |
| 1830 |
since I cleaned up the definition of the D() constructor and moved it to |
| 1831 |
beancount.core.number. |
| 1832 |
|
| 1833 |
- Removed built-in aliases for auto_accounts and implicit_prices modules, from |
| 1834 |
beancount.ops to beancount.plugins. |
| 1835 |
|
| 1836 |
- Removed deprecated option "default_tolerance" (which had been renamed to |
| 1837 |
"inferred_tolerance_default"). |
| 1838 |
|
| 1839 |
- Removed deprecated option "tolerance". |
| 1840 |
|
| 1841 |
- Remove deprecated use of 'plugin' as an option. The directive ought to be |
| 1842 |
the only way. |
| 1843 |
|
| 1844 |
- Removed deprecated option "experiment_explicit_tolerances". |
| 1845 |
|
| 1846 |
- Renamed "experiment_booking_algorithm" to "booking_algorithm", and changed |
| 1847 |
the default value to "FULL". The old "SIMPLE" algorithm will be deprecated |
| 1848 |
eventually. |
| 1849 |
|
| 1850 |
- Removed old code that would warn if the user set account_rounding to a full |
| 1851 |
account name; it just needs be a subaccount. |
| 1852 |
|
| 1853 |
- Commit to Python 3.5. 3.5.0 released more than a year ago. You need to |
| 1854 |
update or stick with the 2.0b13 release. |
| 1855 |
|
| 1856 |
- Remove old code to dispatch between an external Enum class and the built-in |
| 1857 |
one that's included in 3.5 (commit to 3.5). |
| 1858 |
|
| 1859 |
- Added type annotations to beancount.core.data. This will grow more over |
| 1860 |
time. (I also need to add rules to use those.) |
| 1861 |
|
| 1862 |
|
| 1863 |
2016-10-23 |
| 1864 |
|
| 1865 |
- Modified parsing of transaction strings and links and tags. I did this to |
| 1866 |
factor out the parsing of tags and links in order to add it to other |
| 1867 |
transactions and minimize grammar code. There is user-visible impact to this |
| 1868 |
change: all of a transaction's strings must appear before tags or links. You |
| 1869 |
cannot place tags or links before or in-between strings anymore. This is a |
| 1870 |
reasonable restriction and I doubt anybody did anyway. |
| 1871 |
|
| 1872 |
- Added support for tags and links to the Document directive. This works just |
| 1873 |
as for Transactions, e.g. |
| 1874 |
|
| 1875 |
2016-10-23 document Assets:Checking "/statements/oct.pdf" #banking ^9fed846348c2 |
| 1876 |
|
| 1877 |
The current tags on the tag stack are also included, like for transactions. |
| 1878 |
|
| 1879 |
|
| 1880 |
2016-10-10 |
| 1881 |
|
| 1882 |
- Removed "experiment_explicit_tolerances" flag; made this supported by |
| 1883 |
default permanently. |
| 1884 |
|
| 1885 |
|
| 1886 |
2016-10-08 |
| 1887 |
|
| 1888 |
- Documented a subtle problem reported about balances against inventory of |
| 1889 |
mixed at-cost and no-cost, added more context to the error and a unit test |
| 1890 |
for balance checks with mixed at-cost and no-cost positions. |
| 1891 |
|
| 1892 |
- Fixed a bug in the full booking matching code whereby an existing position |
| 1893 |
not held at cost would trip up the matching code. (Credits to Son Nguyen for |
| 1894 |
finding and reporting.) |
| 1895 |
|
| 1896 |
- During ingest, when multiple extractors match a particular file, select the |
| 1897 |
first matching account instead of raising an error. |
| 1898 |
|
| 1899 |
- Fixed accidentally colliding key-binding for invoking bean-price from Emacs, |
| 1900 |
to C-c p. |
| 1901 |
|
| 1902 |
|
| 1903 |
2016-09-25 |
| 1904 |
|
| 1905 |
- Fixed typo in grammar that was parsing a transaction flag as '#' into '*'. |
| 1906 |
|
| 1907 |
- Added "cost_date" and "cost_label" columns in the SQL shell. |
| 1908 |
|
| 1909 |
|
| 1910 |
2016-09-04 |
| 1911 |
|
| 1912 |
- Implemented new "run" shell command that allows you to run a named query. |
| 1913 |
For example, if an input file has a Query directive like this: |
| 1914 |
|
| 1915 |
2016-09-01 query "home" "select account, sum(position) where account ~ 'Home' group by 1" |
| 1916 |
|
| 1917 |
And you input this command: |
| 1918 |
|
| 1919 |
run home |
| 1920 |
|
| 1921 |
The entries will be closed at tue query date (2016-09-01) and the query |
| 1922 |
automatically run. If you want to always include all the transactions, set a |
| 1923 |
date far into the future. |
| 1924 |
|
| 1925 |
This works from the command-line and from the shell, equally. You can also |
| 1926 |
run all the queries in an input file, like this: |
| 1927 |
|
| 1928 |
run * |
| 1929 |
|
| 1930 |
To view the list of available queries, just type the "run" command without |
| 1931 |
an argument. |
| 1932 |
|
| 1933 |
|
| 1934 |
2016-08-21 |
| 1935 |
|
| 1936 |
- Fixed a SQL shell bug with extracting UNITS() from a Position column. |
| 1937 |
|
| 1938 |
- Finally properly fixed the timezone of the Google Finance price fetcher. |
| 1939 |
(It was done incorrectly and I found my unit tests failing whenever I would |
| 1940 |
work on Beancount from another timezone.) |
| 1941 |
|
| 1942 |
|
| 1943 |
2016-08-17 |
| 1944 |
|
| 1945 |
- Added beancount.core.amount.abs() function for absolute values of Amount. |
| 1946 |
|
| 1947 |
- Added rendering of links to beancount.plugins.split_expenses plugin, and |
| 1948 |
made it quiet by default. Added --output-stdout option to make it do that |
| 1949 |
again. |
| 1950 |
|
| 1951 |
- Created a new experimental script that attempts to match postings between |
| 1952 |
two ledgers. A pair of (filename, account-regexp) is provided for each, and |
| 1953 |
then the amounts and links are compared and paired up, and remaining |
| 1954 |
unmatched postings are printed out. This is very useful to reconcile trip |
| 1955 |
expenses between a personal ledger and the ledger for a trip or external |
| 1956 |
project where some of the expenses are paid from the personal ledger as |
| 1957 |
contributions to the trip or project. |
| 1958 |
|
| 1959 |
- Made the upload-csv-to-google-sheet script use the basename (without |
| 1960 |
extension) of the given filenames as sheet names instead of "Sheet X" |
| 1961 |
numbers. (Note: This entire thing be rewritten using the new Google Sheets |
| 1962 |
API which won't require gdata and which will be more stable.) |
| 1963 |
|
| 1964 |
- Added a quick implementation of b.q.query_render.render_csv() |
| 1965 |
and refactored b.q.query_render.render_text() to use common code. Both |
| 1966 |
functions now have a new 'expand' option which will create multiple rows for |
| 1967 |
cells which return a list of strings. The new default behavior is to |
| 1968 |
concatenate the strings with commas. |
| 1969 |
|
| 1970 |
The shell (bean-query) has a new 'expand' shell variable to match. Also, the |
| 1971 |
-f/--format option of it is now supported, and in interactive mode it sets |
| 1972 |
the default value for 'expand'. |
| 1973 |
|
| 1974 |
- Since output to CSV is now implemented, I enabled the --output-csv option of |
| 1975 |
b.p.split_expenses as well. |
| 1976 |
|
| 1977 |
|
| 1978 |
2016-08-14 |
| 1979 |
|
| 1980 |
- Fixed bug in beancount.utils.file_type for Python3, whereby magic now returns |
| 1981 |
bytes, not a string |
| 1982 |
|
| 1983 |
|
| 1984 |
2016-08-04 |
| 1985 |
|
| 1986 |
- Made account name components allowed to have two characters (beyond the |
| 1987 |
first component). For instance, Assets:Investments:F is now a valid account |
| 1988 |
name. |
| 1989 |
|
| 1990 |
|
| 1991 |
2016-07-11 |
| 1992 |
|
| 1993 |
- Added parsing a transaction date column to metadata in the CSV importer. |
| 1994 |
|
| 1995 |
|
| 1996 |
2016-07-01 |
| 1997 |
|
| 1998 |
- bean-format now accepts input from stdin. |
| 1999 |
|
| 2000 |
|
| 2001 |
2016-06-30 |
| 2002 |
|
| 2003 |
- Make it possible for a BALANCES statement to have a WHERE clause. BALANCES |
| 2004 |
is now equivalent to |
| 2005 |
|
| 2006 |
SELECT account, sum(position) FROM ... WHERE ... GROUP BY account |
| 2007 |
|
| 2008 |
Inching one step closer to removing that WHERE clause eventually. |
| 2009 |
|
| 2010 |
|
| 2011 |
2016-06-18 |
| 2012 |
|
| 2013 |
- Added support for columns AMOUNT_DEBIT and AMOUNT_CREDIT in the csv |
| 2014 |
importer. |
| 2015 |
|
| 2016 |
- Merged ongoing progress from 'booking' branch; if you don't use any of the |
| 2017 |
in-progress new booking methods, this should not have any effect. |
| 2018 |
|
| 2019 |
However, the 'booking_method has changed names and you may have to adjust |
| 2020 |
its values if you've been tinkering with it: |
| 2021 |
|
| 2022 |
* 'booking_method' used to take on value "SIMPLE" or "FULL" and dispatch |
| 2023 |
betwee the current (old) booking implementation and the new one which will |
| 2024 |
support many other booking methods. This option is now named |
| 2025 |
'experiment_booking_algorithm' (a new option) and takes on the same |
| 2026 |
values. The default value is "SIMPLE", which keeps the behavior unchanged. |
| 2027 |
Use "FULL" if you want to test out the new booking algorithm: the new |
| 2028 |
algorithms should work except for the AVERAGE cost method. WARNING: This |
| 2029 |
is still under flux and considered unreleased. |
| 2030 |
|
| 2031 |
" 'booking_method': This is a different option now, and takes the value of |
| 2032 |
any one of the booking methods visible here: |
| 2033 |
https://bitbucket.org/blais/beancount/src/7b9e00e6e19136f680befc1d4322f47cdc294cf6/src/python/beancount/core/data.py?at=booking&fileviewer=file-view-default#data.py-64 |
| 2034 |
|
| 2035 |
|
| 2036 |
2016-06-13 |
| 2037 |
|
| 2038 |
- Ported beancount.docs.download_docs to the v3 drive API and the use of a |
| 2039 |
service account instead of a full access to a user account. Service accounts |
| 2040 |
are easier to configure and work with. |
| 2041 |
|
| 2042 |
- Ported beancount.docs.upload_options to the v3 drive API. |
| 2043 |
|
| 2044 |
|
| 2045 |
2016-06-05 |
| 2046 |
|
| 2047 |
- Added a new column to the posting context: "other_accounts" is a set of |
| 2048 |
account strings for the other postings of the transaction. |
| 2049 |
|
| 2050 |
- Added a new JOINSTR() generic function to the shell, to reduce the repeated |
| 2051 |
column above to a single comma-separated string. |
| 2052 |
|
| 2053 |
|
| 2054 |
2016-05-28 |
| 2055 |
|
| 2056 |
- Made various changes to the shell in order to make it possible to convert to |
| 2057 |
the market value: |
| 2058 |
|
| 2059 |
* CONVERT() has been converted to convert to the market value, when applied |
| 2060 |
to a position held at cost. However, it still requires a target currency |
| 2061 |
and it may fail if you apply it to a position for which the cost currency |
| 2062 |
differs from that of the target currency, i.e., it will not automatically |
| 2063 |
chase down the transitive conversions toward the desired target currency. |
| 2064 |
|
| 2065 |
* A new function VALUE() has been added, which is similar to CONVERT() but |
| 2066 |
which when applied to a position held at cost converts to the cost |
| 2067 |
currency at the current price. It's similar to CONVERT() but you don't |
| 2068 |
have to provide the target currency. And similarly to CONVERT(), you may |
| 2069 |
provide a particular date, and if at that date there is no available |
| 2070 |
conversion rate in the prices database, the conversion will fail |
| 2071 |
analogously and spit out an error message. |
| 2072 |
|
| 2073 |
* PRICE() has been renamed to GETPRICE() to avoid some confusion. PRICE() |
| 2074 |
does not convert, it merely gets the price from the price database. |
| 2075 |
GETPRICE() is thus a more appropriate name. |
| 2076 |
|
| 2077 |
|
| 2078 |
2016-05-22 |
| 2079 |
|
| 2080 |
- Created the beancount.plugins.mark_unverified plugin as a response to this |
| 2081 |
thread: https://groups.google.com/d/msg/beancount/hQoOSJE7qNo/-E__v-XhEgAJ |
| 2082 |
|
| 2083 |
This plugin makes it possible to compute the balances as of the last Balance |
| 2084 |
directive of each account by adding metadata to postings which appear after |
| 2085 |
that account's last balance. You'd filter out unverified postings with an SQL |
| 2086 |
query on meta-data like this: |
| 2087 |
|
| 2088 |
SELECT account, sum(position) |
| 2089 |
WHERE NOT meta('unverified') |
| 2090 |
GROUP BY 1 |
| 2091 |
ORDER BY 1 |
| 2092 |
|
| 2093 |
Note that the resulting balanaces almost certainly don't sum up to zero, |
| 2094 |
because of differing dates of the Balance directives. Also, note that |
| 2095 |
accounts without a single Balance directive will not have their postings |
| 2096 |
marked at all. |
| 2097 |
|
| 2098 |
|
| 2099 |
2016-05-08 |
| 2100 |
|
| 2101 |
- In the output of bean-price, sort prices exclusively by currency, regardless |
| 2102 |
of date. This is because on weekends you'll tend to get slightly varying |
| 2103 |
dates, and manual/occasional price updates are usually put in "chunks" in a |
| 2104 |
file section. It's easier to visually find the price by scanning by currency |
| 2105 |
order. |
| 2106 |
|
| 2107 |
|
| 2108 |
2016-05-05 |
| 2109 |
|
| 2110 |
- Added a shell function to filter a set of strings (for tags or links) with a |
| 2111 |
regular expression and return the first one. This way you can extract some |
| 2112 |
of the tags or links with a pattern as columns. |
| 2113 |
|
| 2114 |
|
| 2115 |
2016-05-01 |
| 2116 |
|
| 2117 |
- Fixed issue #124, a leak in the grammar parser which would leak the entire |
| 2118 |
set of entries on every instance of parse. |
| 2119 |
|
| 2120 |
- Fixed some warnings about unclosed files which occur only on default python |
| 2121 |
branch. |
| 2122 |
|
| 2123 |
|
| 2124 |
2016-04-29 |
| 2125 |
|
| 2126 |
- Don't just log an extraction error to logging.error() in the regression |
| 2127 |
tests; let the exception through. This makes building and debugging |
| 2128 |
importers much easier. |
| 2129 |
|
| 2130 |
- Created an experimental script to extract date/location information required |
| 2131 |
for a naturalization application. |
| 2132 |
|
| 2133 |
|
| 2134 |
2016-04-24 |
| 2135 |
|
| 2136 |
- Rewrote the section on "Core Data Structures" of the Design Doc, to reflect |
| 2137 |
the newer internals of Beancount, those which have been merged from the |
| 2138 |
ongoing 'booking' branch. |
| 2139 |
See http://furius.ca/beancount/doc/design-doc. |
| 2140 |
|
| 2141 |
|
| 2142 |
2016-04-23 |
| 2143 |
|
| 2144 |
- Added beancount.ingest.importers.fileonly, a simplistic importer which can |
| 2145 |
be instantiated to just file away some downloads without extracting anything |
| 2146 |
from them. |
| 2147 |
|
| 2148 |
|
| 2149 |
2016-04-18 |
| 2150 |
|
| 2151 |
- In bean-doctor context, all the accounts should appear in the |
| 2152 |
post-transaction balances, even if their balance is empty. This had been |
| 2153 |
fixed for the pre-transaction balances but I stumbled upon a case of |
| 2154 |
post-transaction balances not showing an empty account. |
| 2155 |
|
| 2156 |
|
| 2157 |
2016-04-17 |
| 2158 |
|
| 2159 |
- Added support for the BEANCOUNT_LOAD_CACHE_FILENAME environment variable, |
| 2160 |
which can be set in order to overridde the location of the pickle cache. |
| 2161 |
This variable may contain the string "{filename}", and if it is present the |
| 2162 |
basename of the beancount file will be spliced in. This can be useful if, |
| 2163 |
for example, you are reading your Beancount input file from a read-only |
| 2164 |
filesystem and still want to use the cache by specifying an alternative |
| 2165 |
filename. |
| 2166 |
|
| 2167 |
- Fixed a bug when reading from a read-only filesystem, the loader cache would |
| 2168 |
fail to be removed and raise an exception. |
| 2169 |
|
| 2170 |
- Fixed an important bug in beancount.ingest whereby instances of |
| 2171 |
b.i.cache.FileMemo weren't being shared as widely as they could have been. |
| 2172 |
FileMemo instances now have to be created via b.i.cache.get_file() and |
| 2173 |
FileMemo is now a hidden class _FileMemo. See this discussion for more details: |
| 2174 |
https://groups.google.com/d/msg/beancount/b-ZqYqag7AU/N-AaGSZOAwAJ |
| 2175 |
|
| 2176 |
|
| 2177 |
2016-04-10 |
| 2178 |
|
| 2179 |
- Create a new 'beancount.plugins.fix_payees' plugin that allows the user to |
| 2180 |
provide a set of rules to rewrite and clean up the names of the payees from |
| 2181 |
the Beancount file. |
| 2182 |
|
| 2183 |
While it would be ideal to do this at import time, in practice there are a |
| 2184 |
lot of downloaded files' "memo" fields which get set as the payee |
| 2185 |
automatically. These "memos" aren't very clean and readable strings: they |
| 2186 |
sometimes contain numbers, partial city names, and other junk. In order to |
| 2187 |
produce clean reports where one might want to aggregate by payee, it's |
| 2188 |
useful to rewrite the payees to make them nice and clean. You can use this |
| 2189 |
plugin to do that. |
| 2190 |
|
| 2191 |
|
| 2192 |
- Made the Custom directive accept ACCOUNT tokens. You can now do something |
| 2193 |
like this: |
| 2194 |
|
| 2195 |
2014-06-20 custom "budget" Assets:Account2 "balance < 200.00 USD" |
| 2196 |
|
| 2197 |
Prior to this, the account name had to be represented as a string. (Users of |
| 2198 |
the burgeoning Custom directive not like this very much.) |
| 2199 |
|
| 2200 |
Note that account names and regular strings are both output from the parser |
| 2201 |
as 'str' objects, so in order to make this possible, I had to change the |
| 2202 |
representation of the values to a pair of (value, dtype). Account names have |
| 2203 |
a 'dtype' of beancount.core.account.TYPE. (Eventually I will probably want |
| 2204 |
to make account strings represented with their own custom datatypes, but |
| 2205 |
that will require a fair amount of work on the codebase; this substitute is |
| 2206 |
fine for now, as there are no other places where such a disambiguation is |
| 2207 |
necessary.) |
| 2208 |
|
| 2209 |
|
| 2210 |
2016-04-04 |
| 2211 |
|
| 2212 |
- Added a test to make sure that building a source dist includes the header |
| 2213 |
files and C implementation files. |
| 2214 |
|
| 2215 |
- Sort Document directives after Transactions when they occur on the same day. |
| 2216 |
The reason for this is that statements typically include transactions on |
| 2217 |
that final day, and we'd like for them to occur at the right place in the |
| 2218 |
journals. See originating thread: |
| 2219 |
https://groups.google.com/d/msg/beancount/3ItOYS9DJx4/VyTJB3ssBQAJ |
| 2220 |
|
| 2221 |
|
| 2222 |
2016-04-03 |
| 2223 |
|
| 2224 |
- Fixed a bug in "bean-doctor context" which wouldn't report the full set of |
| 2225 |
accounts when an account's before-balance would be empty. |
| 2226 |
|
| 2227 |
- Fixed a bug in "bean-doctor linked" whereby the balances wouldn't get |
| 2228 |
printed out if there was no link. Print the balances before and after; in |
| 2229 |
fact, maybe this command should be renamed to "balances" and have an option |
| 2230 |
to support links. |
| 2231 |
|
| 2232 |
|
| 2233 |
2016-03-31 |
| 2234 |
|
| 2235 |
- Added TODAY() function to extract today's date. Not sure how useful it'll |
| 2236 |
be. |
| 2237 |
|
| 2238 |
|
| 2239 |
2016-03-27 |
| 2240 |
|
| 2241 |
- Added a PRICE() function to extract entries from the price database. You can |
| 2242 |
now query for "SELECT PRICE('USD', 'CAD', date)", for example. |
| 2243 |
|
| 2244 |
- Added a boolean renderer for the SQL shell. |
| 2245 |
|
| 2246 |
- Added support for arithmetic operations to the bean-query SQL shell. |
| 2247 |
|
| 2248 |
|
| 2249 |
2016-03-26 |
| 2250 |
|
| 2251 |
- Added an optional date argument to convert, so you can provide the requested |
| 2252 |
date in a SQL query, as in "CONVERT(sum(position), "CAD", 2015-06-01)". |
| 2253 |
|
| 2254 |
- Improved the rendering of the context, removed the weird comments it used to |
| 2255 |
render with, render an account name if the inventory is empty. |
| 2256 |
|
| 2257 |
- Ignore .DS_Store files from the file finder in ingest. |
| 2258 |
|
| 2259 |
|
| 2260 |
2016-03-22 |
| 2261 |
|
| 2262 |
- Support multiple accounts in same ofx file. See |
| 2263 |
https://bitbucket.org/blais/beancount/pull-requests/10/. I applied this |
| 2264 |
one-liner: issue a balance for each statement, use the maximum date for the |
| 2265 |
file_date() method, and added unit tests for this. |
| 2266 |
|
| 2267 |
|
| 2268 |
2016-03-21 |
| 2269 |
|
| 2270 |
- Fixed bug in beancount.ingest.file whereby two files being filed to the same |
| 2271 |
destination filename would clobber each other; with this fix, instead, an |
| 2272 |
error will be generated. |
| 2273 |
|
| 2274 |
- Create an example of an importer just filing a PDF file using the external |
| 2275 |
tool PDFminer2. If the tool isn't installed, nothing should "break" (but the |
| 2276 |
importer won't really do its job). The tests should be skipped |
| 2277 |
automatically, and the importing will just ignore the PDF file to be filed. |
| 2278 |
|
| 2279 |
|
| 2280 |
2016-03-20 |
| 2281 |
|
| 2282 |
- Implemented beancount.ingest.importers.regexp and |
| 2283 |
beancount.ingest.importers.config mixin classes to help support |
| 2284 |
functionality which used to be available in LedgerHub. |
| 2285 |
|
| 2286 |
- Removed the temporary beancount.ingest.importers.compat |
| 2287 |
backwards-compatibility helper for LedgerHub. Not needed. |
| 2288 |
|
| 2289 |
- Completed the documentation for the new import framework "beancount.ingest". |
| 2290 |
The document is here: |
| 2291 |
http://furius.ca/beancount/doc/ingest |
| 2292 |
|
| 2293 |
|
| 2294 |
2016-03-19 |
| 2295 |
|
| 2296 |
- Centralized the <3.4 and >=3.4 support for Enum class into |
| 2297 |
beancount.utils.misc_utils.Enum. |
| 2298 |
|
| 2299 |
- Added an option to the OFX importer to let the instantiator decides whether |
| 2300 |
a balance directive should not be inserted (NONE), should be inserted at the |
| 2301 |
declared date of a <ledgerbal> tag (DECLARED), or right after the last entry |
| 2302 |
imported from the file (LAST). |
| 2303 |
|
| 2304 |
|
| 2305 |
2016-03-18 |
| 2306 |
|
| 2307 |
- Merged 'web_months' branch modified from changes originally submitted by |
| 2308 |
Dave Stephens, which implements a monthly view. You enter the monthly view |
| 2309 |
from the annual view. |
| 2310 |
|
| 2311 |
|
| 2312 |
2016-03-14 |
| 2313 |
|
| 2314 |
- Added META() and ENTRY_META() functions to the SQL shell to answer a |
| 2315 |
question on the mailing-list (from richieuk63 at gmail dot com). |
| 2316 |
|
| 2317 |
- Fixed a bug with the OFX importer whereby the Balance directive should be |
| 2318 |
generated to a day following the date provided in the LEDGERBAL directive. |
| 2319 |
|
| 2320 |
- Added forgotten dependency on "beautifulsoup4" in setup.py. |
| 2321 |
|
| 2322 |
|
| 2323 |
2016-03-13 |
| 2324 |
|
| 2325 |
- Merged more changes from the 'ingest' branch which furthers the work of |
| 2326 |
integrating the LedgerHub code into Beancount (almost done now). |
| 2327 |
|
| 2328 |
* Added mimetype() and head() methods to the file cache object passed to the |
| 2329 |
extractors, as a convenience instead of having clients call the cached |
| 2330 |
convert() method. |
| 2331 |
|
| 2332 |
* Added paranoid exception handlers to all the methods called on the |
| 2333 |
importer classes. |
| 2334 |
|
| 2335 |
* Added tests for the examples provided in "examples/ingest". |
| 2336 |
|
| 2337 |
* Refactor some of the code of beancount.ingest.file. |
| 2338 |
|
| 2339 |
* Fixed bugs with ensuring the filenames are absolute names. |
| 2340 |
|
| 2341 |
* Cleaned up the output of the commands. |
| 2342 |
|
| 2343 |
* Made the header and section strings configurable from the import |
| 2344 |
configuration. |
| 2345 |
|
| 2346 |
* Cleaned up the OFX importer from LedgerHub, added unit tests for it, and |
| 2347 |
added it to the beancount.ingest.importers directory. In addition, added |
| 2348 |
it to the example configuration for ingest under |
| 2349 |
beancount/examples/ingest. |
| 2350 |
|
| 2351 |
* Added a dependency on the beautifulsoup4 package (bs4) in order to parse |
| 2352 |
XML files. |
| 2353 |
|
| 2354 |
- Added a beancount.core.amount.add() function to add two amounts. |
| 2355 |
|
| 2356 |
- Made the directive printer be more lenient to support incomplete postings. |
| 2357 |
|
| 2358 |
- Moved the "src/clojure" and "src/golang" directories to the experiments/ |
| 2359 |
directory; they really are experiments. Should have done this a long time |
| 2360 |
ago. |
| 2361 |
|
| 2362 |
|
| 2363 |
2016-03-12 |
| 2364 |
|
| 2365 |
- Converted the amount.amount_*() functions to amount.*(). It's just simpler |
| 2366 |
and nicer. |
| 2367 |
|
| 2368 |
- Made the beancount.report.balance_reports text reports rendered using the |
| 2369 |
precision from the DisplayContext, and realization.dump_balances() require a |
| 2370 |
formatter argument. More probaby needs to be done on issue #108 to close it, |
| 2371 |
but that's a good start. |
| 2372 |
|
| 2373 |
- Made the beancount.plugins.auto_accounts plugin insert entries that will |
| 2374 |
sort stably. |
| 2375 |
|
| 2376 |
- Sync up the print report code with the print command code, fixing a bug with |
| 2377 |
precision not being rendered correctly by the print report. |
| 2378 |
|
| 2379 |
- Fixed #104: bean-format would fail on numbers with commas in them. |
| 2380 |
|
| 2381 |
- Fixed #106: The "render_commas" option wasn't being honored. I have no idea |
| 2382 |
how things came to be this way, but I fixed it. When rendering numbers, |
| 2383 |
inserting commas for thousands (e.g., "1,000" vs. "1000") is now controlled |
| 2384 |
by the "render_commas" option, and the default is not to render them |
| 2385 |
(FALSE). Note: This should affect the web interface, the reports, and the |
| 2386 |
PRINT command, but so far NOT the output of the SQL query reports. The |
| 2387 |
reason for this is historical: the query rendering code does not make use of |
| 2388 |
the DisplayContext; it needs to be converted to do that. See |
| 2389 |
https://bitbucket.org/blais/beancount/issues/105/ |
| 2390 |
https://bitbucket.org/blais/beancount/issues/106/ |
| 2391 |
https://bitbucket.org/blais/beancount/issues/107/ and |
| 2392 |
https://groups.google.com/d/msg/beancount/frfN1zc6TEc/d5OjuDnREgAJ for a |
| 2393 |
discussion. |
| 2394 |
|
| 2395 |
|
| 2396 |
2016-03-06 |
| 2397 |
|
| 2398 |
- Fixed issue #83: Renamed 'default_tolerance' option to |
| 2399 |
'inferred_tolerance_default'. |
| 2400 |
|
| 2401 |
- Added exception handlers for all importer callbacks. Badly written importers |
| 2402 |
should never completely throw off the tools. |
| 2403 |
|
| 2404 |
|
| 2405 |
2016-03-05 |
| 2406 |
|
| 2407 |
- Improved handling of corrupted or out-of-date pickle cache file. |
| 2408 |
|
| 2409 |
- Fixed a test that would only fail in a timzone != EST. |
| 2410 |
|
| 2411 |
- Made bean-file use the configuration filename's directory as the default |
| 2412 |
output dir instead of requiring an option. The behavior of providing a |
| 2413 |
reasonable default makes most sense. |
| 2414 |
|
| 2415 |
|
| 2416 |
2016-02-28 |
| 2417 |
|
| 2418 |
- Moved beancount.scripts.report to beancount.report.report in order to be |
| 2419 |
consistent with the way other libraries are invoked. I had to move |
| 2420 |
beancount.report.report out of the way (to beancount.report.base) to make |
| 2421 |
space for it. |
| 2422 |
|
| 2423 |
- Moved beancount.scripts.query to beancount.query.shell in order to be |
| 2424 |
consistent with the way other libraries are invoked. |
| 2425 |
|
| 2426 |
- Merged fix by yagebu for bug found in b.ops.summarize() that would not yield |
| 2427 |
a list of ordered transactions. |
| 2428 |
|
| 2429 |
- Introduced a new "Custom" directive type. You can enter directives like |
| 2430 |
this: |
| 2431 |
|
| 2432 |
2016-02-28 custom "budget" .... |
| 2433 |
|
| 2434 |
where "..." can be a mixed list of |
| 2435 |
|
| 2436 |
* string |
| 2437 |
* date |
| 2438 |
* boolean |
| 2439 |
* number |
| 2440 |
* amount (number + currency) |
| 2441 |
|
| 2442 |
The first element is a string, which is intended to be used as the runtime |
| 2443 |
type of the directive. This can be used to prototype new features in plugins |
| 2444 |
or otherwise. |
| 2445 |
|
| 2446 |
Right now, no consistency is enforced on the datatypes declared for |
| 2447 |
directives with the same type name. Also, there is currently no way for a |
| 2448 |
plugin to declare what a valid set of tokens may be (but I may do this later |
| 2449 |
on to simplify error reporting for plugin implementors). |
| 2450 |
|
| 2451 |
|
| 2452 |
2016-02-27 |
| 2453 |
|
| 2454 |
- Fixed rendering bug in bean-web whereby empty cells would receive a 0.00 |
| 2455 |
amount. |
| 2456 |
|
| 2457 |
- Improved rendering of the account name in the name of the compat importer. |
| 2458 |
|
| 2459 |
|
| 2460 |
2016-02-24 |
| 2461 |
|
| 2462 |
- Changed the bean-doctor "linked" command to fetch the set of links from the |
| 2463 |
entire set of entries. |
| 2464 |
|
| 2465 |
- Added ABS() function to the shell, in order to dig around for transactions |
| 2466 |
with a particular amount. |
| 2467 |
|
| 2468 |
|
| 2469 |
2016-02-22 |
| 2470 |
|
| 2471 |
- Fixed issue #98: There was a bug when fetching historical data from a Yahoo |
| 2472 |
price source was failing, it wasn't handled correctly. |
| 2473 |
|
| 2474 |
- Merged LedgerHub back into beancount under a new "beancount.ingest" package. |
| 2475 |
The new protocol for importers can be read at: |
| 2476 |
/home/blais/p/repos/beancount1/src/python/beancount/ingest/importer.py |
| 2477 |
|
| 2478 |
There are three new scripts: |
| 2479 |
|
| 2480 |
bean-identify |
| 2481 |
bean-extract |
| 2482 |
bean-file |
| 2483 |
|
| 2484 |
These correspond one-to-one to their ledgerhub variants. |
| 2485 |
|
| 2486 |
There is a bit more work to be done to complete this - see the top of the |
| 2487 |
TODO file in the "ingest" branch if you're interested - and I'll write |
| 2488 |
documentation on this once all the work is completed. |
| 2489 |
|
| 2490 |
LedgerHub is now officially dead. |
| 2491 |
|
| 2492 |
|
| 2493 |
2016-02-20 |
| 2494 |
|
| 2495 |
- Create an beancount.utils.misc_utils.is_sorted() utility function to be used |
| 2496 |
in the new importer code. |
| 2497 |
|
| 2498 |
- Match a price source over the entire source string. |
| 2499 |
|
| 2500 |
|
| 2501 |
2016-02-19 |
| 2502 |
|
| 2503 |
- Now accepting '=' in currency symbol in order to accommodate currencies in |
| 2504 |
Yahoo, which look like this "CNYUSD=X". |
| 2505 |
|
| 2506 |
|
| 2507 |
2016-02-15 |
| 2508 |
|
| 2509 |
- Handle an incomplete pickle file by ignoring it and regenerating it silently. |
| 2510 |
|
| 2511 |
|
| 2512 |
2016-02-14 |
| 2513 |
|
| 2514 |
- Baked a 2.0b5 and 2.0b6 releases in a further attempt to get the included |
| 2515 |
files to be included by setuptools and for pip3 to be able to make a local |
| 2516 |
build. setuptools is horrible. |
| 2517 |
|
| 2518 |
- Baked a 2.0b4 release for a more recent PyPI availability. |
| 2519 |
|
| 2520 |
- Fixed issue #72 - Thanks to Gary Peck for figuring out what was wrong with |
| 2521 |
setuptools - and now you should be able to install via pip3 again, which |
| 2522 |
will pull all the dependencies automatically. If setuptools isn't installed, |
| 2523 |
this should degrade peacefully to distutil. |
| 2524 |
|
| 2525 |
|
| 2526 |
2016-02-06 |
| 2527 |
|
| 2528 |
- IMPORTANT API CHANGES FOLLOW: |
| 2529 |
|
| 2530 |
I made some important changes to the following classes: |
| 2531 |
|
| 2532 |
beancount.core.position.Position |
| 2533 |
beancount.core.inventory.Inventory |
| 2534 |
beancount.core.data.Posting |
| 2535 |
|
| 2536 |
"Position" objects have been restructured to reflect the structure implied |
| 2537 |
by the syntax. Instead of a .number (Decimal) and .lot (Lot) objects, a |
| 2538 |
Position now has a .units (Amount) and .cost (Cost) objects. |
| 2539 |
|
| 2540 |
The "Lot" class has been removed; it has been replaced by a "Cost" class |
| 2541 |
with .number (Decimal), .currency (string), .date (datetime.date), .label |
| 2542 |
(string) attributes. |
| 2543 |
|
| 2544 |
The "Inventory" class is a list of "Position" objects, and as such it has |
| 2545 |
received corresponding adjustments and minor changes. |
| 2546 |
|
| 2547 |
"Posting" objects do not contain a .position attribute anymore. Instead, the |
| 2548 |
data structure has been flattened to contain .units and .cost objects |
| 2549 |
directly. As a result, a Posting acts a bit like a subclass of a Position |
| 2550 |
rather than using composition to contain one. |
| 2551 |
|
| 2552 |
During the parsing phase, a "Posting" object's .cost attribute does not |
| 2553 |
point to a "Cost" instance, but rather to a "CostSpec" instance, which |
| 2554 |
reflects the unresolved and partially incomplete lot specification from the |
| 2555 |
input syntax that needs to get resolved to a particular lot during the new |
| 2556 |
booking process. |
| 2557 |
|
| 2558 |
Here's a pictorial representation of changes. Before we had: |
| 2559 |
|
| 2560 |
Assets:Checking -40 QQQ {66.32 USD, 2015-12-14} @ 70.32 USD |
| 2561 |
`---account---' `number' `--------------lot--------------' `--price--' |
| 2562 |
`currency'`---cost--' `--date--' |
| 2563 |
|
| 2564 |
posting (Posting) |
| 2565 |
.account (str) |
| 2566 |
.position (Position) |
| 2567 |
.number (Decimal) |
| 2568 |
.lot (Lot) |
| 2569 |
.currency (str) |
| 2570 |
.cost (Amount) |
| 2571 |
.number (Decimal) |
| 2572 |
.currency (str) |
| 2573 |
.lot_date (datetime.date) |
| 2574 |
.price (Amount) |
| 2575 |
.number (Decimal) |
| 2576 |
.currency (str) |
| 2577 |
|
| 2578 |
|
| 2579 |
After the changes we have something that looks more like the input: |
| 2580 |
|
| 2581 |
Assets:Checking -40 QQQ {66.32 USD, 2015-12-14, "0d6f0"} @ 70.32 USD |
| 2582 |
`---account---' `-units-' `------------cost-----------------' `--price--' |
| 2583 |
number currency date label |
| 2584 |
|
| 2585 |
posting (Posting) |
| 2586 |
.account (str) |
| 2587 |
.units (Amount) |
| 2588 |
.number (Decimal) |
| 2589 |
.currency (str) |
| 2590 |
.cost (Cost, CostSpec, or None) |
| 2591 |
.number (Decimal) |
| 2592 |
.currency (str) |
| 2593 |
.date (datetime.date, or None) |
| 2594 |
.label (str, or None) |
| 2595 |
.price (Amount, or None) |
| 2596 |
.number (Decimal) |
| 2597 |
.currency (str) |
| 2598 |
|
| 2599 |
And field-by-field conversions: |
| 2600 |
|
| 2601 |
posting.account -> posting.account |
| 2602 |
posting.position.number -> posting.units.number |
| 2603 |
posting.position.lot.currency -> posting.units.currency |
| 2604 |
posting.position.lot.cost.number -> posting.cost.number |
| 2605 |
posting.position.lot.cost.currency -> posting.cost.currency |
| 2606 |
posting.position.lot.lot_date -> posting.cost.date |
| 2607 |
(none) -> posting.cost.label |
| 2608 |
posting.price.number -> posting.price.number |
| 2609 |
posting.price.currency -> posting.price.currency |
| 2610 |
|
| 2611 |
Notes: |
| 2612 |
|
| 2613 |
* These changes are mostly driven by the need for the parser to output |
| 2614 |
incomplete cost specifications. The booking of lots against existing |
| 2615 |
inventory is isolated in a beancount.parser.booking and before booking we |
| 2616 |
need to be able to represent missing values from the input syntax, since |
| 2617 |
the booking process is able to interpolate and fill in these missing |
| 2618 |
values. It was required to make important changes to the data structures |
| 2619 |
for this reason. The parser outputs 'posting.cost' with an instance of a |
| 2620 |
new "CostSpec" class, not "Cost". After booking, all the postings's costs |
| 2621 |
are replaced by instances of "Cost" and "CostSpec" is gone. |
| 2622 |
|
| 2623 |
* This representation is much closer to the syntax. It's also flatter and |
| 2624 |
simpler. The original representation's design was driven by an old idea |
| 2625 |
that the lots were to be used as the key in Inventory mappings, but as it |
| 2626 |
turns out, operations on lots are just as well implemented with an |
| 2627 |
association list and performance isn't a problem. Moreover, lots with a |
| 2628 |
cost are never merged using such a mapping, only reduced against, so this |
| 2629 |
was an unnecessary distraction. |
| 2630 |
|
| 2631 |
* If you were creating Position objects in plugins or other code, please |
| 2632 |
look at the new interface and make necessary changes to your code. You can |
| 2633 |
create new Position objects from a pair of Amount and Cost objects. |
| 2634 |
|
| 2635 |
|
| 2636 |
- beancount.core.position.lot_currency_pair() has been converted to |
| 2637 |
beancount.core.position.Position.currency_pair(). |
| 2638 |
|
| 2639 |
- Renamed beancount.core.position.Position.cost() to |
| 2640 |
beancount.core.position.Position.at_cost() due to the conflict resulting |
| 2641 |
from the Position class changes. |
| 2642 |
|
| 2643 |
- There is a new option "booking_method" which should be set to the value |
| 2644 |
"SIMPLE" to maintain the current booking algorithm (it's the default if left |
| 2645 |
unset), but which can be set to "FULL" to enable the yet-unreleased, new |
| 2646 |
experimental booking method. Do this at your own risk; this is not ready for |
| 2647 |
public use, not effectively working yet. |
| 2648 |
|
| 2649 |
|
| 2650 |
2016-02-05 |
| 2651 |
|
| 2652 |
- Fixed bug with query parser: a single dot (.) would be matched as a number. |
| 2653 |
It should require at least some digits. |
| 2654 |
|
| 2655 |
- Fixed bug whereby a missing cost number would be rendered as "0"; if needs |
| 2656 |
be a null value. |
| 2657 |
|
| 2658 |
|
| 2659 |
2016-01-31 |
| 2660 |
|
| 2661 |
- Added python-magic as an optional depdendency, in order to support imports |
| 2662 |
code. Updated http://furius.ca/beancount/doc/install |
| 2663 |
|
| 2664 |
- Renamed beancount.scripts.checkdeps to beancount.scripts.deps (annoyed with |
| 2665 |
name too similar to beancount.scripts.check and I trip over it all the |
| 2666 |
time). |
| 2667 |
|
| 2668 |
- Moved ledgerhub.core.compress to beancount.ops.compress and its associated |
| 2669 |
test. |
| 2670 |
|
| 2671 |
- Moved ledgerhub.identify.filetype to beancount.utils.file_type and its |
| 2672 |
associated test and test files. |
| 2673 |
|
| 2674 |
- Small improvement to beancount.utils.test_utils.skipIfRaises() to accept |
| 2675 |
multiple exceptions. |
| 2676 |
|
| 2677 |
|
| 2678 |
2016-01-25 |
| 2679 |
|
| 2680 |
- Moved many of the utility code from ledgerhub.utils to beancount.utils. This |
| 2681 |
is beginning the process of migrating and rewriting LedgerHub and |
| 2682 |
integrating it into the Beancount source code. |
| 2683 |
|
| 2684 |
- Moved the 'remove_crdb' utility script from LedgerHub into |
| 2685 |
beancount/experiments/imports. |
| 2686 |
|
| 2687 |
|
| 2688 |
2016-01-18 |
| 2689 |
|
| 2690 |
- Committed the Query directive to non-experimental status, for |
| 2691 |
beancount-web's usage. |
| 2692 |
|
| 2693 |
|
| 2694 |
2016-01-16 |
| 2695 |
|
| 2696 |
- Created the beancount.plugins.coherent_cost plugin which checks that one's |
| 2697 |
currencies are either always used with cost, or never at all. This is by far |
| 2698 |
the most typical situation whereby a currency is always held at cost, or |
| 2699 |
never (and perhaps converted at price or not). |
| 2700 |
|
| 2701 |
- Created a function to filter just the transactions, which is such an |
| 2702 |
incredibly common operation I should have done this a while ago. I should |
| 2703 |
convert all code to use it. |
| 2704 |
|
| 2705 |
|
| 2706 |
2016-01-16 |
| 2707 |
|
| 2708 |
- Added a feature to the "beancount.plugins.ira_contribs" plugin to allow the |
| 2709 |
further restriction that the trigger posting must include a particular flag |
| 2710 |
in order for the insertion to occur. This is to be used in account that have |
| 2711 |
sales, whereby just looking at the sign of the posting isn't enough to |
| 2712 |
decide that an insertion must be made. |
| 2713 |
|
| 2714 |
|
| 2715 |
2016-01-10 |
| 2716 |
|
| 2717 |
- Addressed issue #96, supporting an explicitly installed C decimal version |
| 2718 |
when the Python3 installation does not include one. From |
| 2719 |
beancount.core.number: |
| 2720 |
|
| 2721 |
Note: Python 3.3 is supposed to guarantee a fast "C" decimal implementation, |
| 2722 |
as it comes with its source code. However, in practice, many distributions, |
| 2723 |
including the popular Ubuntu distro, simply don't compile it. Other distros |
| 2724 |
(e.g., Arch Linux) insist on breaking up Python into multiple packages in |
| 2725 |
order to manage the dependency to the mpdec library, and make that |
| 2726 |
installation optional. Moreover, there seems to have been changes in the |
| 2727 |
dispatching of pure-Python and fast C decimal implementations in Python-3.5's |
| 2728 |
source code itself. The result is that despite Python-3.3 or above being |
| 2729 |
installed, a fast C decimal implementation may or may not be present. Thus, we |
| 2730 |
must detect it here. I believe this subtle problem should go away with |
| 2731 |
Python-3.5 and above. |
| 2732 |
|
| 2733 |
What do we do? We import the default 'decimal' module, and if it's the pure |
| 2734 |
Python implementation, we attempt to import an explicitly installed |
| 2735 |
'cdecimal', which you can install with |
| 2736 |
|
| 2737 |
pip3 install m3-cdecimal |
| 2738 |
|
| 2739 |
Also added a check for this in checkdeps. Hopefully this resolves the issue |
| 2740 |
once and for all. |
| 2741 |
|
| 2742 |
|
| 2743 |
2016-01-09 |
| 2744 |
|
| 2745 |
- Fixed a bug (issue #94) in the load cache that wouldn't handle files |
| 2746 |
disappearing after having been moved. |
| 2747 |
|
| 2748 |
|
| 2749 |
2016-01-03 |
| 2750 |
|
| 2751 |
- Moved beancount.web.scrape.scrape() to beancount.web.web.scrape_webapp() to |
| 2752 |
isolate beancount.web.scrape from dependencies, so that other projects may |
| 2753 |
reuse it. |
| 2754 |
|
| 2755 |
|
| 2756 |
2015-12-25 |
| 2757 |
|
| 2758 |
- Closed multiple obsolete branches: parse_test_utils, display_context, |
| 2759 |
performance, datatypes. |
| 2760 |
|
| 2761 |
- Added some utilities for parsing strings for writing tests that use the |
| 2762 |
local variables present in the caller (a bit of magic). |
| 2763 |
|
| 2764 |
- Improved date parsing from command-line options for some scripts; imported |
| 2765 |
from branch 'text_statements'. |
| 2766 |
|
| 2767 |
|
| 2768 |
2015-12-24 |
| 2769 |
|
| 2770 |
- Implemented metadata stack and "pushmeta" and "popmeta" directives mirroring |
| 2771 |
"pushtag" and "poptag". These new directives work similarly, but setting |
| 2772 |
metadata fields instead of tags themselves. The parser maintains a stack of |
| 2773 |
values for each metadata field. Values explicitly set on the Transactions |
| 2774 |
themselves are not overridden by the meta stack. |
| 2775 |
|
| 2776 |
|
| 2777 |
2015-12-21 |
| 2778 |
|
| 2779 |
- Created a new project script that uses specific metadata on Open directives |
| 2780 |
to generate a document of a user's assets, institution names, addresses and |
| 2781 |
contact info, and account types and approximate value. Note: I haven't made |
| 2782 |
the example file include necessary fields to demo or document this yet. |
| 2783 |
|
| 2784 |
- The loader now supports loading encrypted files transparently. If a filename |
| 2785 |
ends with .gpg or .asc (and contains armored content), the file is run |
| 2786 |
through a gpg subprocess to decrypt it. No temporary files are created. Note |
| 2787 |
that caching for those files is disabled. |
| 2788 |
|
| 2789 |
If you're writing a script, you can also call |
| 2790 |
beancount.loaded.load_encrypted_file() directly to avoid the check. |
| 2791 |
|
| 2792 |
- Implemented the 'beancount.plugins.merge_meta' plugin that copies metadata |
| 2793 |
from an external file into a regular file. It is essentially a data join on |
| 2794 |
the key of accounts for Open and Close directives, and a join on the key of |
| 2795 |
currency on Commodity directives. |
| 2796 |
|
| 2797 |
- Added an option to Inventory.to_string() to avoid rendering parentheses. |
| 2798 |
|
| 2799 |
- Added variable and username expansion support for the loader filename. |
| 2800 |
|
| 2801 |
- Removed --batch mode for the encryption support; it needs to be potentially |
| 2802 |
interactive. |
| 2803 |
|
| 2804 |
|
| 2805 |
2015-12-17 |
| 2806 |
|
| 2807 |
- In prices, removed undocumented support for automatically extracting |
| 2808 |
Commodities with a "quote" metadata field. This had been used in times past |
| 2809 |
and had been brought in as legacy, but now neither the export code nor the prices |
| 2810 |
code use it. Vaccummed away. |
| 2811 |
|
| 2812 |
|
| 2813 |
2015-12-13 |
| 2814 |
|
| 2815 |
- Fixed a minor bug with the loader cache whereby errors weren't getting |
| 2816 |
emitted on a cache hit (Issue #92). |
| 2817 |
|
| 2818 |
|
| 2819 |
2015-12-12 |
| 2820 |
|
| 2821 |
- Made bean-web's --incognito mode replace integer numbers, not just |
| 2822 |
fractional ones. (See issue #86). |
| 2823 |
|
| 2824 |
- Output a warning when cdecimal isn't installed. This may occur on some |
| 2825 |
distribution which break up Python into multiple packages in order to allow |
| 2826 |
the user to avoid depending on a mpdec library install. Arch Linux suffers |
| 2827 |
from this problem. |
| 2828 |
|
| 2829 |
- Made some improvements to the loader caching algorithm in order not to rely |
| 2830 |
on the percision of timestamps from the filesystem. Filesystems implement |
| 2831 |
one-second precision which is not sufficient in some case. I now cache both |
| 2832 |
the time and the size of files in order to check for a cache hit, and this |
| 2833 |
paves the way for hashing the contents of files as well eventually. |
| 2834 |
|
| 2835 |
- Began implementing aggregation of some of the attributes of options map |
| 2836 |
across include files. Both "operating_currency" and "commodities" will be |
| 2837 |
aggregated correctly. (This was a request for beancount-web.) |
| 2838 |
|
| 2839 |
- Fixed flaky test that failed only in homecooked install of Python 3.5.1. |
| 2840 |
|
| 2841 |
- Fixed a minor bug that would not print out costs with zero amounts. |
| 2842 |
|
| 2843 |
|
| 2844 |
2015-12-11 |
| 2845 |
|
| 2846 |
- In the context page dedicated to rendering the details of an entry, render |
| 2847 |
an "Open" link on the upper right that can be clicked on in order to invoke |
| 2848 |
a desktop handler that will open a text editor to the containing file and at |
| 2849 |
the right line number. |
| 2850 |
|
| 2851 |
|
| 2852 |
2015-12-10 |
| 2853 |
|
| 2854 |
- Renamed beancount.reports.context.render_entry_context() to |
| 2855 |
render_file_context() and implemented render_entry_context() to accept an |
| 2856 |
entry directly instead of a (filename, line-no), so that bug reporters can |
| 2857 |
insert some print statements. I also removed the dcontext instance required |
| 2858 |
to be passed, since all the callers were fetching it from options_map. This |
| 2859 |
should make it easier for those sending bug reports to insert quick calls to |
| 2860 |
render the context around a particular entry or file location. |
| 2861 |
|
| 2862 |
|
| 2863 |
2015-12-09 |
| 2864 |
|
| 2865 |
- Fixed installation snafu: forgot to add the beancount.prices and bean-price |
| 2866 |
install to the setup.py file. |
| 2867 |
|
| 2868 |
|
| 2869 |
2015-12-07 |
| 2870 |
|
| 2871 |
- Fixed a bug in the load cache, whereby the load cache would not update |
| 2872 |
itself on an included file. In order to do this, first I made the loader |
| 2873 |
always return the full correct set of unique filenames processed in a load |
| 2874 |
call, and then I used this to check the latest modified time. |
| 2875 |
|
| 2876 |
- I also used this to fix a related bug in the bean-web watcher: If an |
| 2877 |
included file was being modified, bean-web would not reload itself |
| 2878 |
automatically. redstreet0 sent a pull request to highlight the problem |
| 2879 |
(thanks!): |
| 2880 |
https://bitbucket.org/blais/beancount/pull-requests/6/feature-include-files-refresh/diff |
| 2881 |
|
| 2882 |
|
| 2883 |
2015-12-03 |
| 2884 |
|
| 2885 |
- Added ROOT(account, num) account manipulation function to the shell. |
| 2886 |
|
| 2887 |
|
| 2888 |
2015-12-02 |
| 2889 |
|
| 2890 |
- Fixed issue #84: The sorting of entries from multiple files was incorrectly |
| 2891 |
placed, due to recent changes merged from the booking branch. |
| 2892 |
|
| 2893 |
- Fixed a bug deleting the load cache (was using an invalid filename). |
| 2894 |
|
| 2895 |
|
| 2896 |
2015-11-29 |
| 2897 |
|
| 2898 |
- Made the pickle load cache enabled by default. This means you can now remove |
| 2899 |
the BEANCOUNT_LOAD_CACHE environment variable. The load cache will be |
| 2900 |
written out automatically, but only if it takes more than the time threshold |
| 2901 |
(1 sec) to load a Beancount file. If it takes less than this time, no cache |
| 2902 |
is written. (This saves the creation of these pesky crumbs for files it |
| 2903 |
doesn't matter for.) If you would like to always disable the load cache, set |
| 2904 |
the environment variable BEANCOUNT_DISABLE_LOAD_CACHE. I don't recommend |
| 2905 |
it--this works well and for large files makes loading much, much faster. |
| 2906 |
|
| 2907 |
|
| 2908 |
2015-11-28 |
| 2909 |
|
| 2910 |
- Implemented a script used to fetch prices online and output them in |
| 2911 |
Beancount input format. This script is able not only to take an explicit |
| 2912 |
list of prices to get, but also able to read a Beancount input file and |
| 2913 |
figure out the list of commodities held at a particular point in time and |
| 2914 |
fetch only those prices. A "price" metadata field on a Commodity directive |
| 2915 |
is used to specify how and where to get prices from. It comes with support |
| 2916 |
for Google Finance and Yahoo! Finance price sources and the syntax supports |
| 2917 |
custom-written Python modules so you can write your own price fetching |
| 2918 |
extensions, that integrate with the price fetching tool. |
| 2919 |
|
| 2920 |
The new code is located under "src/python/beancount/prices" and this new |
| 2921 |
tool is documented in http://furius.ca/beancount/doc/prices. |
| 2922 |
|
| 2923 |
(Note: This is brand new code, probably imperfect, but I tried to keep this |
| 2924 |
simple yet complex enough to be practical. I've been using a variant of it |
| 2925 |
for a while, I'm going to merge this now and use it myself, and I hope it |
| 2926 |
works for others.) |
| 2927 |
|
| 2928 |
|
| 2929 |
2015-11-26 |
| 2930 |
|
| 2931 |
- I redesigned the portfolio export process in order to (a) simplify it |
| 2932 |
greatly (the process was a bit confusing, between the use of three metadat |
| 2933 |
fields: "ticker", "export" and "quote"), and (b) to separate it entirely |
| 2934 |
from the upcoming price fetching script metadata. |
| 2935 |
|
| 2936 |
The new outcome is very similiar, however, except it uses only a SINGLE |
| 2937 |
metadata field: "export", and the documentation has been rewritten to |
| 2938 |
reflect this: |
| 2939 |
https://docs.google.com/document/d/1mNyE_ONuyEkF_I2l6V_AoAU5HJgI654AOBhHsnNPPqw/edit# |
| 2940 |
|
| 2941 |
If you have an existing file, here's what you need to do to it: |
| 2942 |
|
| 2943 |
* Remove all the 'quote' metadata. You won't need it. |
| 2944 |
* If you have 'ticker' metadata: convert those to 'export'. |
| 2945 |
* If you have 'export' metadata: keep it. |
| 2946 |
* If you had an 'export' metadata with a "MONEY" spec, move that into the |
| 2947 |
'export' field after the symbol to export to. |
| 2948 |
|
| 2949 |
The example has been ported, so you can refer to that as well. |
| 2950 |
|
| 2951 |
I think the new process is much simpler to understand and the documentation |
| 2952 |
shorter and easier to read. It should be a trivial exercise to convert one's |
| 2953 |
input file to the newer format. |
| 2954 |
|
| 2955 |
|
| 2956 |
2015-11-22 |
| 2957 |
|
| 2958 |
- Removed beancount.core.data.AttrDict and replace it by a regular dict. This |
| 2959 |
removes some annoyances when pickling and copying metadata. Metadata is now |
| 2960 |
represented by a plain old dict. (Fixes issue #79.) |
| 2961 |
|
| 2962 |
|
| 2963 |
2015-11-09 |
| 2964 |
|
| 2965 |
- Implemented a simple pickle-date on beancount.loader.load_file(), which will |
| 2966 |
reload the parsed & processed contents of a top-level file if a cache file |
| 2967 |
is present and more recent than the file itself, or update the contents of |
| 2968 |
the cache after loading if not. (This works a bit like .pyc byte-compilation |
| 2969 |
in Python or .elc in Emacs LISP.) This makes the loading of large files |
| 2970 |
multiple times ~15x faster, which is a big deal since Beancount has become a |
| 2971 |
little bit slow (I need to spend time optimizing at some point). |
| 2972 |
|
| 2973 |
This feature is a bit experimental, so for now it only gets turned on if the |
| 2974 |
BEANCOUNT_LOAD_CACHE environment variable is set. |
| 2975 |
|
| 2976 |
|
| 2977 |
2015-10-04 |
| 2978 |
|
| 2979 |
- Implemented --output=<filename> option for bean-query tool. |
| 2980 |
|
| 2981 |
|
| 2982 |
2015-10-02 |
| 2983 |
|
| 2984 |
- Implemented an experimental new Query directive whose purpose is to define |
| 2985 |
pre-canned SQL queries in the Beancount file itself and to then build tools |
| 2986 |
to automate the generation of reports of those queries. |
| 2987 |
|
| 2988 |
For the moment being, I'm just playing with this to convince myself that |
| 2989 |
this can be powerful and generic enough to provide more generally. I've |
| 2990 |
found myself running specific queries on speific files, e.g., during trips |
| 2991 |
and I'd like to automate those to some extend, perhaps replace the script |
| 2992 |
code that lives in beancount.plugins.split_expenses with this. |
| 2993 |
|
| 2994 |
Anyhow, this is not supported but if you understand this and really want to |
| 2995 |
turn it on, set this option in your input file: |
| 2996 |
|
| 2997 |
option "experimental_query_directive" "TRUE" |
| 2998 |
|
| 2999 |
The directives aren't used anywhere yet, and you'll have to read source code |
| 3000 |
to figure out what they look like. |
| 3001 |
|
| 3002 |
|
| 3003 |
- Implemented a "reload" command in the shell. Typing "reload" will refresh |
| 3004 |
the data from the latest file contents. |
| 3005 |
|
| 3006 |
|
| 3007 |
2015-09-29 |
| 3008 |
|
| 3009 |
- Tightened the screws on the Amount() constructor a bit and made changes ini |
| 3010 |
order to allow it to accept a sentinel value for MISSING values from the |
| 3011 |
parser. Changes to beancount.core.amount.Amount are: |
| 3012 |
|
| 3013 |
1. A string for the number is not accepted anymore, that is, Amount(str, |
| 3014 |
str) is not supported anymore. Amount() now unconditionally requires a |
| 3015 |
Decimal instance, so you must use Amount(Decimal, str). In any case, this |
| 3016 |
constrcutros was likely abused only by me in the tests. I'd rather have |
| 3017 |
a tighter, less permissive constructor. |
| 3018 |
|
| 3019 |
2. The convenience constructor beancount.core.amount.from_string() is now |
| 3020 |
officially aliased as beancount.core.amount.A, so you can "from |
| 3021 |
beancount.core.amount import A". I now commit to using this constructor |
| 3022 |
and converted all the tests to use it. This is great for writing tests. |
| 3023 |
Amount really is a fundamental piece that deserves a very short alias |
| 3024 |
like this. |
| 3025 |
|
| 3026 |
In summary, how to create Amount instances: |
| 3027 |
|
| 3028 |
* If you use explicit values, use Amount(Decimal, str), e.g., |
| 3029 |
Amount(D('100.00'), 'USD'), Amount(number, currency) |
| 3030 |
|
| 3031 |
* If you need a convenience constructor, use A(str), e.g., |
| 3032 |
A('100.00 USD'), A('32,000 KRW') |
| 3033 |
|
| 3034 |
|
| 3035 |
2015-09-29 |
| 3036 |
|
| 3037 |
- Added a new column 'description' to the SQL client in order to produce more |
| 3038 |
compact reports. |
| 3039 |
|
| 3040 |
Oftentimes the payee is left to an empty value and journals |
| 3041 |
have a lot of wasted whitespace. Concatenating the payee and the narration |
| 3042 |
in a single field goes a long way towards producing reports that aren't |
| 3043 |
nearly as wide. I could have added a CONCAT() function but this is so common |
| 3044 |
and convenient that a dedicated 'description' alias is justified. You can |
| 3045 |
use it in posting context ("SELECT description ..." or "SELECT ... WHERE |
| 3046 |
description ~ '...'") or transaction context ("SELECT ... FROM description ~ |
| 3047 |
'...'").. |
| 3048 |
|
| 3049 |
|
| 3050 |
2015-09-27 |
| 3051 |
|
| 3052 |
- Implemented a plugin that can book price conversions using a particular |
| 3053 |
booking method, in this case, FIFO. This idea stemmed from a suggestion I |
| 3054 |
made on the mailing-list a few weeks ago, which was to process a particular |
| 3055 |
account's price conversions to insert cost basis specifications and in doing |
| 3056 |
so to book reducing postings to FIFO order automatically. This could all be |
| 3057 |
done via a plugin, so I did it. (See tag {c395de691449} on the mailing-list |
| 3058 |
for more context.) |
| 3059 |
|
| 3060 |
You can find it under "beancount.plugins.book_conversions". You use it like |
| 3061 |
this: first you load the plugin: |
| 3062 |
|
| 3063 |
plugin "beancount.plugins.book_conversions" "Assets:Bitcoin,Income:Bitcoin" |
| 3064 |
|
| 3065 |
The configuration requires you provide two accounts: |
| 3066 |
|
| 3067 |
1. An assets account to process, whereby all price conversions (in any currency) |
| 3068 |
occurring in that account will have their cost basis automatically inserted, |
| 3069 |
and, |
| 3070 |
|
| 3071 |
2. An Income account that is inserted on reducing transactions to absorb the |
| 3072 |
profit or loss of the sale. |
| 3073 |
|
| 3074 |
Then you book your transactions as simple price conversions, without worrying |
| 3075 |
about cost basis, for example, this input: |
| 3076 |
|
| 3077 |
2015-09-04 * |
| 3078 |
Assets:Bank -750.00 USD |
| 3079 |
Assets:Bitcoin 3.000000 BTC @ 250.00 USD |
| 3080 |
|
| 3081 |
2015-09-05 * |
| 3082 |
Assets:Bank -780.00 USD |
| 3083 |
Assets:Bitcoin 3.000000 BTC @ 260.00 USD |
| 3084 |
|
| 3085 |
2015-09-20 * |
| 3086 |
Assets:Bitcoin -2.000000 BTC @ 300.00 USD |
| 3087 |
Expenses:Something |
| 3088 |
|
| 3089 |
2015-09-21 * |
| 3090 |
Assets:Bitcoin -2.000000 BTC @ 310.00 USD |
| 3091 |
Expenses:Something |
| 3092 |
|
| 3093 |
2015-09-22 * |
| 3094 |
Assets:Bitcoin -2.000000 BTC @ 330.00 USD |
| 3095 |
Expenses:Something |
| 3096 |
|
| 3097 |
Would get translated by the plugin into the equivalent of this: |
| 3098 |
|
| 3099 |
2015-09-04 * |
| 3100 |
Assets:Bitcoin 3.000000 BTC {250.00 USD} @ 250.00 USD |
| 3101 |
trades: "trade-ff4c3e592147,trade-6b9c8689ed50" |
| 3102 |
Assets:Bank -750.00 USD |
| 3103 |
|
| 3104 |
2015-09-05 * |
| 3105 |
Assets:Bitcoin 3.000000 BTC {260.00 USD} @ 260.00 USD |
| 3106 |
trades: "trade-91e2245de593,trade-d622a89c614d" |
| 3107 |
Assets:Bank -780.00 USD |
| 3108 |
|
| 3109 |
2015-09-20 * |
| 3110 |
Assets:Bitcoin -2.000000 BTC {250.00 USD} @ 300.00 USD |
| 3111 |
trades: "trade-ff4c3e592147" |
| 3112 |
Income:Bitcoin -100.00000000 USD |
| 3113 |
Expenses:Something 600.00000000 USD |
| 3114 |
|
| 3115 |
2015-09-21 * |
| 3116 |
Assets:Bitcoin -1.000000 BTC {250.00 USD} @ 310.00 USD |
| 3117 |
trades: "trade-6b9c8689ed50" |
| 3118 |
Assets:Bitcoin -1.000000 BTC {260.00 USD} @ 310.00 USD |
| 3119 |
trades: "trade-91e2245de593" |
| 3120 |
Income:Bitcoin -110.00000000 USD |
| 3121 |
Expenses:Something 620.00000000 USD |
| 3122 |
|
| 3123 |
2015-09-22 * |
| 3124 |
Assets:Bitcoin -2.000000 BTC {260.00 USD} @ 330.00 USD |
| 3125 |
trades: "trade-d622a89c614d" |
| 3126 |
Income:Bitcoin -140.00000000 USD |
| 3127 |
Expenses:Something 660.00000000 USD |
| 3128 |
|
| 3129 |
Note that the price annotations are kept as in the input file. The plugin only |
| 3130 |
inserts the cost basis and splits postings where required. |
| 3131 |
|
| 3132 |
Secondly, a unique trade identifier is allocated for each matching pair of |
| 3133 |
postings that were booked and is added to the metadata of those postings. |
| 3134 |
Its value is a comma-separated list. This metadata is useful because it |
| 3135 |
allows you to load the entries and from it, to build a list of trades to |
| 3136 |
produce a suitable report for reporting. |
| 3137 |
|
| 3138 |
So the plugin also contains code to do this. You can invoke it as a main |
| 3139 |
program, like this: |
| 3140 |
|
| 3141 |
python3 -m beancount.plugins.book_conversions <filename.beancount> |
| 3142 |
|
| 3143 |
On the file above, it should generate the following output, which I believe is |
| 3144 |
the report you're really after for reporting purposes: |
| 3145 |
|
| 3146 |
Units Currency Cost Currency Buy Date Buy Price Sell Date Sell Price P/L |
| 3147 |
-------- -------- ------------- ---------- --------- ---------- ---------- ------ |
| 3148 |
2.000000 BTC USD 2015-09-04 250.00 2015-09-20 300.00 100.00 |
| 3149 |
1.000000 BTC USD 2015-09-04 250.00 2015-09-21 310.00 60.00 |
| 3150 |
1.000000 BTC USD 2015-09-05 260.00 2015-09-21 310.00 50.00 |
| 3151 |
2.000000 BTC USD 2015-09-05 260.00 2015-09-22 330.00 140.00 |
| 3152 |
-------- -------- ------------- ---------- --------- ---------- ---------- ------ |
| 3153 |
|
| 3154 |
Use the '--format=csv' option if you want to produce output suitable for |
| 3155 |
including in a spreadsheet. If you need to customize the output further, see the |
| 3156 |
source code (file:book_conversions.py). It is not possible to generate this list |
| 3157 |
of trades using the SQL client yet, to change the output columns you would have |
| 3158 |
to create a standalone script; you can copy just the main() function in the |
| 3159 |
plugin if you need to do that and import the rest. (Note: The function that |
| 3160 |
extracts the list of matches provides both the posting and its parent |
| 3161 |
Transaction object, so you can output data from the transaction if you want, |
| 3162 |
e.g. the narration of the selling transaction.) |
| 3163 |
|
| 3164 |
|
| 3165 |
2015-09-14 |
| 3166 |
|
| 3167 |
- Merged more changes to beancount.el (Emacs support) by Stefan Monnier: |
| 3168 |
* Use syntax-tables for comments and strings. |
| 3169 |
* Make ido use optional in Emacs config. |
| 3170 |
* Quote filenames on command lines |
| 3171 |
Thank you Stefan! |
| 3172 |
|
| 3173 |
|
| 3174 |
2015-09-12 |
| 3175 |
|
| 3176 |
- Added to beancount.plugins.split_expenses a new script that is able to |
| 3177 |
generate the typical kinds of reports you would need to provide to |
| 3178 |
participants in a shared project or travel on their specific expenses and |
| 3179 |
contributions, as well as a breakdown of their expenses per category |
| 3180 |
(expenses account) and final balances for each participants. Invoke it like |
| 3181 |
this: |
| 3182 |
|
| 3183 |
python3 -m beancount.plugins.split_expenses <filename> |
| 3184 |
|
| 3185 |
The script lives in the same file as the split_expenses plugin, because it |
| 3186 |
is tightly related to it. It presumes the input file will process through |
| 3187 |
this plugin. Try to run it on the example files under |
| 3188 |
beancount/examples/sharing. |
| 3189 |
|
| 3190 |
- Added a new file "examples/sharing/duxbury2015.beancount" which contains a |
| 3191 |
new example of sharing expenses on a trip between three people. |
| 3192 |
|
| 3193 |
- Starter cleanup of beancount.el contributed by Stefan Monnier. More changes |
| 3194 |
to come, this is basically a no-op patch. It just moves code around and |
| 3195 |
makes other such cosmetic changes to silence some compiler warnings, prepare |
| 3196 |
for subsequent changes, better follow coding conventions etc. Detail: |
| 3197 |
|
| 3198 |
* beancount.el: Add some standard file headers, license, and |
| 3199 |
sectioning comments. Sprinkle a few FIXMEs while I'm here. |
| 3200 |
(beancount-font-lock-defaults): Rename from beancount-font-lock-keywords, |
| 3201 |
since this corresponds to font-lock-keywords and not to |
| 3202 |
font-lock-defaults. |
| 3203 |
(beancount-directive-names, beancount-font-lock-keywords, |
| 3204 |
beancount-accounts): Move variables before their first use (to silence |
| 3205 |
the compiler). |
| 3206 |
(beancount-mode-map): Use a proper defvar instead of define-minor-mode's |
| 3207 |
half-broken :keymap. |
| 3208 |
(beancount-mode): Merge the make-local-variables into their corresponding |
| 3209 |
`set'. |
| 3210 |
(beancount-accounts): Move make-variable-buffer-local to top-level since |
| 3211 |
it's a global operation. |
| 3212 |
(beancount): Declare this group, already used in define-minor-mode. |
| 3213 |
(beancount-hash-keys): Mark unused arg `v' with an underscore. |
| 3214 |
(beancount-transaction-set-flag): Don't use replace-string (designed for |
| 3215 |
interactive use) from Elisp. |
| 3216 |
(beancount-for-line-in-region): Use copy-marker and eobp. |
| 3217 |
(beancount-align-numbers): Break lines to avoid hiding arguments. |
| 3218 |
(compilation-read-command): Declare variable to silence byte-compiler. |
| 3219 |
|
| 3220 |
|
| 3221 |
2015-09-06 |
| 3222 |
|
| 3223 |
- Filter out platform-specific comments from the code generated by GNU Bison, |
| 3224 |
in order to avoid unnecessary diffs when I switch between Linux and Mac OS X. |
| 3225 |
|
| 3226 |
|
| 3227 |
2015-09-05 |
| 3228 |
|
| 3229 |
- Changed the semantics of the account_rounding account, so that it matches |
| 3230 |
that of the other account options, that is, they all specify a sub-account |
| 3231 |
of the Equity account. So if you had |
| 3232 |
|
| 3233 |
option "account_rounding" "Equity:RoundingError" |
| 3234 |
|
| 3235 |
in your input file, change this to: |
| 3236 |
|
| 3237 |
option "account_rounding" "RoundingError" |
| 3238 |
|
| 3239 |
To ease the transition, the parser now checks if the first component is one |
| 3240 |
of the five categories and if so, issues a warning and removes the prefix. |
| 3241 |
|
| 3242 |
(One side-effect of this change is that the rounding error account may only |
| 3243 |
be an Equity account, but I'm hoping this won't be a problem for anyone.) |
| 3244 |
|
| 3245 |
|
| 3246 |
2015-08-31 |
| 3247 |
|
| 3248 |
- The column "weight" was broken; fixed by yagebu@. |
| 3249 |
|
| 3250 |
|
| 3251 |
2015-08-30 |
| 3252 |
|
| 3253 |
- Fixed a very minor bug in split_expenses plugin whereby the generated |
| 3254 |
postings did not contain the __automatic__ metadata field, and in some |
| 3255 |
particular situations, their automatically calculated values would end up |
| 3256 |
being used for inferring the tolerances. |
| 3257 |
|
| 3258 |
|
| 3259 |
2015-08-15 |
| 3260 |
|
| 3261 |
- Changed the semantics of the parsing stage, in a fairly profound way. |
| 3262 |
This should have no visible changes to users, but people writing scripts |
| 3263 |
should revise their code if they were using |
| 3264 |
beancount.parser.parser.parse_*() functions. |
| 3265 |
|
| 3266 |
Just to be clear: beancount.loader.load_*() has not changed. If you just use |
| 3267 |
the loader, there are no changes. Changes are only at the parser level. |
| 3268 |
|
| 3269 |
Here's what's going on and why: The parser used to carry out interpolation |
| 3270 |
of missing numbers on postings for each transaction locally, while parsing |
| 3271 |
the transactions. This was done by calling by calling |
| 3272 |
beancount.core.interpolate.balance_incomplete_postings(), here: |
| 3273 |
https://bitbucket.org/blais/beancount/src/ee2073aae080aaa8e260abe8a501abf872948f0e/src/python/beancount/parser/grammar.py?at=default#grammar.py-803 |
| 3274 |
|
| 3275 |
Loading a list of entries was carried out in two steps: |
| 3276 |
|
| 3277 |
,-----------------------load----------------------. |
| 3278 |
(recursively) |
| 3279 |
,---------------------. ,---------. ,------------. |
| 3280 |
(input)--->| parse + interpolate |-->| plugins |-->| validation |--> entries |
| 3281 |
`---------------------' `---------' `------------' |
| 3282 |
|
| 3283 |
First, the parser would run on the input and process all the input files |
| 3284 |
recursively (processing includes). "Interpolation", the process of filling |
| 3285 |
in missing numbers, was carried out at that stage, during parsing, and only |
| 3286 |
locally, that is, for each transaction in isolation. "Booking" of lots, that |
| 3287 |
is, selecting which of an account's inventory lots to match and reduce, was |
| 3288 |
explicit. This booking could not take advantage of the accumulated |
| 3289 |
inventories in order to vary its behavior. You had to specify the entire lot |
| 3290 |
information unambiguously. |
| 3291 |
|
| 3292 |
After this, in a second stage, the plugins were run on the entries and a |
| 3293 |
final validation step was run at the end. |
| 3294 |
|
| 3295 |
To implement the booking proposal |
| 3296 |
(http://furius.ca/beancount/doc/proposal-booking), we want for the user to |
| 3297 |
be able to provide a partial specification of lots to be matched against an |
| 3298 |
account's accumulated inventory at the date the transaction is to be |
| 3299 |
applied. The idea is that if there is no ambiguity, the user should be able |
| 3300 |
to specify very little information about a lot (for example if there is a |
| 3301 |
single lot in the account when processing the transaction an empty spec of |
| 3302 |
"{}" should be sufficient). Moreover, where the specification is ambiguous, |
| 3303 |
we also want to support automatic selection of lots according a method |
| 3304 |
specified by the user, e.g., FIFO booking, LIFO booking, etc. |
| 3305 |
|
| 3306 |
For this to work, we need to have parsed all the inputs to some sort of |
| 3307 |
incomplete specification, a representation of inputs that hasn't yet been |
| 3308 |
resolved to specific lots, in order to carry out booking. The parser has |
| 3309 |
been modified to output such incomplete postings: |
| 3310 |
|
| 3311 |
,-------------------------load-------------------------. |
| 3312 |
(recursively) |
| 3313 |
,-------. ,-------------. ,---------. ,------------. |
| 3314 |
(input)--->| parse |-->| booking |-->| plugins |-->| validation |--> entries |
| 3315 |
`-------' | + | `---------' `------------' |
| 3316 |
| interpolate | |
| 3317 |
`-------------' |
| 3318 |
incomplete |
| 3319 |
entries |
| 3320 |
|
| 3321 |
Because "interpolation" runs on the result of specific lot values, "booking" |
| 3322 |
must run before it, and so they are inter-related. Thus, booking and |
| 3323 |
inteprolation has been moved to a dedicated step that runs on the list of |
| 3324 |
incomplete entries and resolves them to the regular entries to be processed |
| 3325 |
further by plugins and validation. |
| 3326 |
|
| 3327 |
This also has a nice side-effect: the booking step is where all the |
| 3328 |
complexity is, and it is now isolated and I will be able to test and |
| 3329 |
experiment on it in isolation. This is where all the fun will be. |
| 3330 |
|
| 3331 |
A description of the incomplete specifications output by the parser can be |
| 3332 |
found here in the parser.py file, this is the description of the |
| 3333 |
intermediate state of postings whose lots haven't yet been matched and |
| 3334 |
resolved to specific inventory lots: |
| 3335 |
https://bitbucket.org/blais/beancount/src/18282452e265959b69d3d10c6d9cf32e5815c522/src/python/beancount/parser/parser.py?at=booking |
| 3336 |
|
| 3337 |
Essentially, a posting's 'lot' attribute contains a "LotSpec" tuple instead |
| 3338 |
of a "Lot" tuple, and several numbers may be left unfilled (for interpolate |
| 3339 |
values). I don't imagine anyone will ever have to manipulate such |
| 3340 |
intermediate entries, only the booking code. |
| 3341 |
|
| 3342 |
The previous booking algorithm has been moved to the booking stage and the |
| 3343 |
semantics should be identical to what they used to be. This is still the |
| 3344 |
default algorithm--it just runs in its own dedicated stage, still operating |
| 3345 |
locally on each transation. You should observe no difference in behaviour. |
| 3346 |
|
| 3347 |
I've merged these changes now in order to minimize the differences between |
| 3348 |
the booking and default branches and because I was able to do it without |
| 3349 |
changing any of the semantics (despite the large number of lines and tests |
| 3350 |
modified). This was a necessary refactoring. Because that code is now |
| 3351 |
isolated to its own stage I should be able to begin implementing the more |
| 3352 |
complex state-dependent booking algorithms in the 'booking' branch. (I'm |
| 3353 |
excited about this.) I could even implement different booking heuristics and |
| 3354 |
switch between them. |
| 3355 |
|
| 3356 |
Because the parser used to spit out regular, complete entries, |
| 3357 |
parser.parsedoc() was used in much of the tests instead of loader.loaddoc(), |
| 3358 |
so that many of those tests would not have to concern themselves with making |
| 3359 |
sure the input passed the validation stage run by the loader. For example, |
| 3360 |
creating Open directives just to create some Transaction test object wasn't |
| 3361 |
necessary in the tests. All of those tests had to be revised and I made them |
| 3362 |
all depend on beancount.loader.load_*() instead of the now weakened |
| 3363 |
parser.parse_*() functions which output incomplete, unbooked entries. This |
| 3364 |
cleans up the dependencies a bit as well. If you wrote your own unit tests |
| 3365 |
and were using parser.parsedoc(), you should convert them to use |
| 3366 |
loader.loaddoc(). In order for this change not to go unnoticed (and for |
| 3367 |
naming consistency with parse_string() and parse_file()) I'll probably |
| 3368 |
rename parser.parsedoc() to parser.parse_doc() and ditto with the loader. |
| 3369 |
|
| 3370 |
(Note: In some cases I've had to specifically setup the input of some tests |
| 3371 |
in "raw" plugin processing mode to avoid triggering some unwanted and |
| 3372 |
unrelated errors. I'm tempted to remove even more from the default plugins. |
| 3373 |
This may happen in a future CL.) |
| 3374 |
|
| 3375 |
|
| 3376 |
- Renamed beancount.parser.parser.parsedoc() to parse_doc() and |
| 3377 |
beancount.loader.loaddoc() to load_doc(), for consistency with the other |
| 3378 |
parse_*() and load_*() functions. Kept a stub that will issue a warning if |
| 3379 |
you use it. |
| 3380 |
|
| 3381 |
|
| 3382 |
2015-07-23 |
| 3383 |
|
| 3384 |
- In the conversion to the new booking syntax, I had inadventently removed |
| 3385 |
support for the total cost "{{ ... }}" syntax. I brought this back next to |
| 3386 |
the new booking syntax, and uncommented tests that had been made to skip. |
| 3387 |
|
| 3388 |
|
| 3389 |
2015-07-21 |
| 3390 |
|
| 3391 |
- Merged ongoing work from the 'booking' branch that will eventually change |
| 3392 |
the semantics of inventory booking; in the interest of a smooth transition, |
| 3393 |
and for me to be able to use either branch interchangeably, I introduced a |
| 3394 |
few changes that should have no user-visible effect on 'default': |
| 3395 |
|
| 3396 |
* The parser.parse_string() and parser.parse_file() routines don't |
| 3397 |
interpolate anymore. For this reason, the tests all had to be adjusted not |
| 3398 |
to include interpolation. The interpolation of incomplete postings |
| 3399 |
(grammar.interpolation()) has moved to a separate phase and is now run by |
| 3400 |
loader._load() *AFTER* parsing. This is key to implementing fuzzy matching |
| 3401 |
semantics for matching reducing lots: we need to have all the incomplete |
| 3402 |
transactions parsed and sorted in order to select matching lots in date |
| 3403 |
order. |
| 3404 |
|
| 3405 |
This only affects you if you wrote scripts against the parser |
| 3406 |
interface directly (this is highly unlikely). |
| 3407 |
|
| 3408 |
* For writing unit tests, parser.parsedoc() and loader.loaddoc() are now |
| 3409 |
decorator factories. This allowed me to add options to parser.parsedoc() |
| 3410 |
to perform interpolation, and when not specified, to check that entries |
| 3411 |
with interpolation are not present in the tests. Also, I coudl merge the |
| 3412 |
functionality of parser.parsedoc_noerrors() and loader.loaddoc_noerrors() |
| 3413 |
in their respective equivalents. The docstring tests now validate that |
| 3414 |
there are no errors in the docstrings by default. This makes the tests |
| 3415 |
tighter (a few bugs in the tests themselves were found and fixed). |
| 3416 |
|
| 3417 |
* The new syntax for cost specification that will be in effect for the |
| 3418 |
inventory booking proposal is now supported. The syntax is |
| 3419 |
backward-compatible with the previous one. Previously, the following |
| 3420 |
syntaxes were supported for specifying the cost and optionally a lot |
| 3421 |
acquisition date: |
| 3422 |
|
| 3423 |
Assets:Investments 1 HOOL {123.00 USD} |
| 3424 |
Assets:Investments 1 HOOL {123.00 USD / 2013-07-20} |
| 3425 |
|
| 3426 |
Instead of these options, the new syntax supports a comma-separated list |
| 3427 |
of cost-specifiers which can be one of |
| 3428 |
|
| 3429 |
<cost> -> e.g. 123.00 USD |
| 3430 |
<lot-date> -> e.g. 2015-07-20 |
| 3431 |
<label> -> e.g. "first-lot" |
| 3432 |
<merge-cost> -> e.g. * |
| 3433 |
|
| 3434 |
In order to keep current input working, either a comma (,) or a slash (/) |
| 3435 |
is supported to separate the components. This is valid: |
| 3436 |
|
| 3437 |
Assets:Investments 1 HOOL {2013-07-20 / 123.00 USD / "first-lot"} |
| 3438 |
|
| 3439 |
Those can be provided in any order. For example, these are all also valid |
| 3440 |
syntaxes for cost: |
| 3441 |
|
| 3442 |
Assets:Investments 1 HOOL {} |
| 3443 |
Assets:Investments 1 HOOL {"first-lot"} |
| 3444 |
Assets:Investments 1 HOOL {2013-07-20, 123.00 USD} |
| 3445 |
Assets:Investments 1 HOOL {2013-07-20, "first-lot"} |
| 3446 |
Assets:Investments 1 HOOL {*} |
| 3447 |
Assets:Investments 1 HOOL {*, 123.00 USD} |
| 3448 |
|
| 3449 |
Moreover, the cost amount now supports a compound amount that is expressed |
| 3450 |
not in terms of each unit of the currency, but in terms of the total |
| 3451 |
amount over all units, for example, this is how you could fold in the cost |
| 3452 |
of a commission: |
| 3453 |
|
| 3454 |
Assets:Investments 1 HOOL {123.00 # 9.95 USD} |
| 3455 |
|
| 3456 |
The syntax for a compound amount follows this pattern: |
| 3457 |
|
| 3458 |
[<per-unit-cost>] # [<total-cost>] <currency> |
| 3459 |
|
| 3460 |
The numbers are both optional. If no '#' separator is present, the total |
| 3461 |
cost component is assumed to be zero. This will eventually subsume the |
| 3462 |
{{...}} total cost syntax, by specifying only the total cost portion of |
| 3463 |
the compound amount: |
| 3464 |
|
| 3465 |
Assets:Investments 100 HOOL {# 12300.00 USD} |
| 3466 |
|
| 3467 |
Of course, this combines with the other spec formats, so this is valid: |
| 3468 |
|
| 3469 |
Assets:Investments 1 HOOL {123.00 # 9.95 USD, 2015-07-22} |
| 3470 |
|
| 3471 |
Finally, while the new syntax is supported in the parser, the old |
| 3472 |
semantics for inventory lot specification is still in order. If you |
| 3473 |
provide an unsupported combination of lot specifiers (e.g., you use a |
| 3474 |
label, a compound amount, or a merge-cost marker), an error will be issued |
| 3475 |
accordingly. |
| 3476 |
|
| 3477 |
So just use the cost and date as previously; I will bring in new semantics |
| 3478 |
incrementally, semantics that will take advantage of this new syntax. I |
| 3479 |
will try to do so in a way that minimizes changes. |
| 3480 |
|
| 3481 |
- I removed forwarded symbols from beancount.parser. Generally, in order to be |
| 3482 |
able to mock functions, you should always import packages, not symbols. |
| 3483 |
|
| 3484 |
|
| 3485 |
2015-07-20 |
| 3486 |
|
| 3487 |
- Numbers rendered from bean-query are now rendered using the display context |
| 3488 |
inferred from the input file. This means numbers are rounded nicely, using |
| 3489 |
the most common precision seen in the input file. |
| 3490 |
|
| 3491 |
- I fixed a bug on writing UTF-8 output to the console on Mac OS X and how it |
| 3492 |
interacts with the 'less' pager. |
| 3493 |
|
| 3494 |
|
| 3495 |
2015-07-12 |
| 3496 |
|
| 3497 |
- Implemented support for arithmetic operations: +, -, *, / and parenthesis |
| 3498 |
groupings are now supported, anywhere that a number can be seen in the input |
| 3499 |
file, including postings, costs & prices, and balance numbers. |
| 3500 |
|
| 3501 |
|
| 3502 |
2015-07-12 |
| 3503 |
|
| 3504 |
- Changed how web & report rendering code renders numbers so that it uses the |
| 3505 |
DisplayContext inferred from the numbers in the input file. Numbers in the |
| 3506 |
reports were previously using the default precision and that led to all |
| 3507 |
sorts of inconsistencies. The numbers are now rendered using the most common |
| 3508 |
precision which has been seen in the input files. (This work had been |
| 3509 |
planned for a while, as part of converting everything to use the |
| 3510 |
DisplayContext. Next up will be converting the shell's rendering routines.) |
| 3511 |
|
| 3512 |
|
| 3513 |
2015-07-11 |
| 3514 |
|
| 3515 |
- WARNING: API CHANGES AHEAD. If you wrote plugins, you will need to remove |
| 3516 |
the 'entry' parameter to constructors of Posting(). |
| 3517 |
|
| 3518 |
I removed the Posting.entry back-reference of Postings to their owning |
| 3519 |
Transaction objects. This makes programmatically creating our data |
| 3520 |
structures much more straight-forward and avoids us having to run pirouettes |
| 3521 |
around which object to create first. It also removes all manners of "fixing |
| 3522 |
up" transactions and removes one ultimatley unnecessary degree of freedom |
| 3523 |
from plugins outputs: we don't have to check that the plugins generate |
| 3524 |
objects with correct back-references. It also makes the documentation |
| 3525 |
simpler: I won't have to explain backreferences and how to deal with them. |
| 3526 |
Finally, it avoids the circular reference which could potentially make |
| 3527 |
Python's GC do some work for no other reason. |
| 3528 |
|
| 3529 |
This happened because it occurred to me that the only really important place |
| 3530 |
where back-references were used were in the beancount.core.realization code, |
| 3531 |
and that in the RealAccount objects I could easily replace the Posting |
| 3532 |
instances in lists of "postings or entries" into a new tuple object |
| 3533 |
"TxnPosting" that contains a reference to the parent transaction and a |
| 3534 |
reference to the posting. This voids the need for a back-reference, and |
| 3535 |
makes the API really straightforward. |
| 3536 |
|
| 3537 |
|
| 3538 |
- WARNING: USER-LEVEL CHANGES FOLLOW. I repatriated the following optional |
| 3539 |
plugins to the beancount.plugins package, so that all the plugins are in the |
| 3540 |
same place: |
| 3541 |
|
| 3542 |
beancount.ops.auto_accounts -> beancount.plugins.auto_accounts |
| 3543 |
beancount.ops.implicit_prices -> beancount.plugins.implicit_prices |
| 3544 |
|
| 3545 |
This is so that the "beancount.ops" package contains only plugins run by |
| 3546 |
default (non-optional), and so that the "beancount.plugins" only contains |
| 3547 |
optional plugins the user must provide. |
| 3548 |
|
| 3549 |
In doing so, I also made the "implicit_prices" plugin NOT INCLUDED BY |
| 3550 |
DEFAULT. This plugin creates automatically Price directives for all Postings |
| 3551 |
which have a @ <price> annotation, thus feeding those prices into the price |
| 3552 |
database. If you want to keep this behaviour -- and you probably should -- |
| 3553 |
you need to add the following in your input file: |
| 3554 |
|
| 3555 |
plugin "beancount.plugins.implicit_prices" |
| 3556 |
|
| 3557 |
(I'm considering moving move of the default plugins to be optional, in |
| 3558 |
particular, beancount.ops.documents, not sure yet.) |
| 3559 |
|
| 3560 |
|
| 3561 |
2015-07-05 |
| 3562 |
|
| 3563 |
- Implemented support for parsing strings from files in various encodings. |
| 3564 |
Only string objects encoded in non-ASCII are supported, e.g., payee, |
| 3565 |
narrations, description, etc. This means the account names are still |
| 3566 |
restricted to ASCII, in particular. This works with UTF8 encoding (tested), |
| 3567 |
latin1 encoding (tested), and probably more. The support is at the lexer |
| 3568 |
level. You may now supply an 'encoding' parameter to parser.parse_file(), |
| 3569 |
parser.parse_string(), loader.load_file(), loader.load_string() functions. |
| 3570 |
Passing in an invalid encoding should not mail it fail (though the contents |
| 3571 |
of the strings will be empty). Unit tests for all those cases have been |
| 3572 |
added. |
| 3573 |
|
| 3574 |
- Completely reviewed all lexer and grammar error handling code. The parser |
| 3575 |
code used to bail out with abort() on an unhandled exception and dump core |
| 3576 |
after issuing its error message (this is ugly but was never a big issue |
| 3577 |
since this occurred pretty rarely). All errors are now handled gracefully |
| 3578 |
(invalid lexer token, exception raised in lexer builder, invalid gramamr |
| 3579 |
rule, exception raised in grammar builder Python code). A comprehensive |
| 3580 |
suite of unit tests has been built to catch all these. You should never |
| 3581 |
experience a core dump anymore. A number of other unexpected cases has also |
| 3582 |
been dealt with. |
| 3583 |
|
| 3584 |
- The lexer used to have a fixed-size buffer for parsing its strings. The |
| 3585 |
buffer is now dynamically allocated. Lexing should also be slightly faster. |
| 3586 |
|
| 3587 |
- Mmeory management for the parser has been reviewed. Memory clean up for |
| 3588 |
temporaries generated during parsing has been reinstated (it was disabled |
| 3589 |
somehow) and cleanup rules are invoked even in the case of errors. This may |
| 3590 |
make the parser somewhat slower. |
| 3591 |
|
| 3592 |
|
| 3593 |
2015-07-02 |
| 3594 |
|
| 3595 |
- Built support for setuptools and rolled back changes. Setuptools is broken |
| 3596 |
beyond what I can bear. Forget this. You'll have to install dependencies by |
| 3597 |
hand. It's a one-liner, like this: |
| 3598 |
|
| 3599 |
pip3 install python-dateutil bottle ply lxml |
| 3600 |
|
| 3601 |
|
| 3602 |
2015-07-01 |
| 3603 |
|
| 3604 |
- Wrote a post-mortem/assessment doc on LedgerHub, detailed future plans for |
| 3605 |
LedgerHub and plans to eventually merge the codebase into Beancount again. |
| 3606 |
See: http://furius.ca/ledgerhub/doc/postmortem |
| 3607 |
|
| 3608 |
|
| 3609 |
|
| 3610 |
2015-06-27 |
| 3611 |
|
| 3612 |
- Complete the design doc and made it public. |
| 3613 |
|
| 3614 |
|
| 3615 |
2015-06-26 |
| 3616 |
|
| 3617 |
- Created a generic script that can be used to automate the upload of |
| 3618 |
arbitrary CSV files to a Google Spreadsheet. This can be used along with the |
| 3619 |
holdings reports in order to create a spreadsheet tracking your assets. |
| 3620 |
|
| 3621 |
Unfortunately, this script has to be written in Python 2.x, because of |
| 3622 |
the unavailability of the gdata-python-client library which is not available |
| 3623 |
at this time for Python 3.x. The script is self-contained. If you want |
| 3624 |
to use this, you must install the following libraries in your Python 2.x |
| 3625 |
install: |
| 3626 |
|
| 3627 |
* gdata-python-client |
| 3628 |
* oauth2client |
| 3629 |
* httplib2 |
| 3630 |
|
| 3631 |
|
| 3632 |
2015-06-25 |
| 3633 |
|
| 3634 |
- Posting objects now have (filename, lineno) in their metadata. This could |
| 3635 |
potentially be helpful for people who want to insert text programmatically |
| 3636 |
in their input file without having to write their own parser. |
| 3637 |
See: https://groups.google.com/d/msg/beancount/zNCFk-YGdr8/8P2_vGGH9xoJ |
| 3638 |
|
| 3639 |
|
| 3640 |
2015-06-15 |
| 3641 |
|
| 3642 |
- All the code to bake a static HTML archive of a bean-web interface has been |
| 3643 |
rewritten. |
| 3644 |
|
| 3645 |
* There used to be a number of bugs caused by the wget tool. These bugs have |
| 3646 |
been fixed. |
| 3647 |
|
| 3648 |
* The new code does not depend on wget -- Beancount does not require wget |
| 3649 |
anymore. Explicit code to do web scraping has been implemented. On the |
| 3650 |
other hand, a new dependency is introduced: lxml. This dependency was |
| 3651 |
already required for development and install in the same way as all the |
| 3652 |
other dependencies: using pip3. Should be a breeze to install on all |
| 3653 |
platforms. |
| 3654 |
|
| 3655 |
* A verification layer has been tacked on after the web scraping step to |
| 3656 |
check that there are no dangling links. |
| 3657 |
|
| 3658 |
* Intentionally skipped links are now converted to plain text, such that |
| 3659 |
there are no dangling links for pages we aren't saving (these just used |
| 3660 |
to be ignored). |
| 3661 |
|
| 3662 |
I repeat: Beancount does not depend on wget anymore. |
| 3663 |
Please install lxml with: "pip3 install lxml" |
| 3664 |
|
| 3665 |
|
| 3666 |
- The 'exportpf' report which is used to produce OFX that can be imported in |
| 3667 |
Google Finance now issues a warning if you did not provide either 'ticker' |
| 3668 |
or 'export' metadata for holdings that get exported. The reason for the new |
| 3669 |
adminition is that it trips up the OFX import and when Google Finance sees |
| 3670 |
a ticker it does not understand, the import fails. At least with the warning |
| 3671 |
we're telling the user they should be providing tickers or export directives |
| 3672 |
for all their commodities if they export the portfolio. |
| 3673 |
|
| 3674 |
|
| 3675 |
2015-06-10 |
| 3676 |
|
| 3677 |
- Removed dependency on curses. If you don't have curses, everything should |
| 3678 |
work fine now, errors are being caught. Curses was only used to provide good |
| 3679 |
default values for rendering tables in terminals on e.g. bean-report |
| 3680 |
journal and to decide whether to use a pager in multi-page bean-query. |
| 3681 |
The default values are fixed if curses isn't available, e.g. 80 chars wide, |
| 3682 |
but as previously, you can override them manually. I also removed the |
| 3683 |
dependency from checkdeps and from the install document. |
| 3684 |
|
| 3685 |
|
| 3686 |
2015-06-09 |
| 3687 |
|
| 3688 |
- Rewrote the Installation Instructions document completely to make it |
| 3689 |
simpler. Some users had found it daunting. |
| 3690 |
http://furius.ca/beancount/doc/install |
| 3691 |
|
| 3692 |
- Tested Windows installation using Cygwin and added it to the installation |
| 3693 |
instructions. |
| 3694 |
http://furius.ca/beancount/doc/install |
| 3695 |
|
| 3696 |
|
| 3697 |
2015-06-07 |
| 3698 |
|
| 3699 |
- Moved the following representation related symbols to their own module: |
| 3700 |
|
| 3701 |
beancount.core.amount.D -> beancount.core.number.D |
| 3702 |
beancount.core.amount.Decimal -> beancount.core.number.Decimal |
| 3703 |
beancount.core.amount.ZERO -> beancount.core.number.ZERO |
| 3704 |
beancount.core.amount.ONE -> beancount.core.number.ONE |
| 3705 |
beancount.core.amount.HALF -> beancount.core.number.HALF |
| 3706 |
beancount.core.amount.round_to -> beancount.core.number.round_to |
| 3707 |
|
| 3708 |
I also moved the tests. All the code specifically related to numbers is |
| 3709 |
now in beancount.core.number. I also removed the relative imports, as |
| 3710 |
Ledgerhub is importing from the Beancount source code now. |
| 3711 |
|
| 3712 |
This is not a user-visible change. However, if you wrote scripts against |
| 3713 |
the codebase, you will need to rename your imports. In the meantime I added |
| 3714 |
stubs which issue a warning if you import from the obsoleted names. |
| 3715 |
|
| 3716 |
|
| 3717 |
- Moved documentation scripts from experiments to the main Beancount codebase. |
| 3718 |
There is a new package for it: beancount.docs. These codes are used to maintain |
| 3719 |
the Beancount documentation and there is common code for authentication in there, |
| 3720 |
code that I plan to use for automating the exporting ot portfolios. |
| 3721 |
|
| 3722 |
This introduces some optional dependencies: |
| 3723 |
|
| 3724 |
* google-api-python-client |
| 3725 |
* oauth2client |
| 3726 |
* httplib2 |
| 3727 |
|
| 3728 |
These are optional, and at the moment none of the actual Beancount tools |
| 3729 |
make any use of them. I moved this into the main Beancount codes because |
| 3730 |
the common authentication code will be used to export portfolios directly |
| 3731 |
to a Google spreadsheet in Google Drive, which will be super convenient |
| 3732 |
to build custom portfolio tracking views. |
| 3733 |
|
| 3734 |
|
| 3735 |
2015-06-06 |
| 3736 |
|
| 3737 |
- Added an 'inferred_tolerance_multiplier' option to allow the user to adjust |
| 3738 |
the magnitude of the inferred tolerance. |
| 3739 |
|
| 3740 |
When the tolerance values aren't specified explicitly via the |
| 3741 |
'default_tolerance' option, the tolerance is inferred from the numbers in |
| 3742 |
the input file. For example, if a transaction has posting with a value |
| 3743 |
like '32.424 CAD', the tolerance for CAD will be inferred to be 0.001 |
| 3744 |
times some multiplier. This is the muliplier value. |
| 3745 |
|
| 3746 |
We normally assume that the institution we're reproducing this posting |
| 3747 |
from applies rounding, and so the default value for the multiplier is |
| 3748 |
0.5, that is, half of the smallest digit encountered. |
| 3749 |
|
| 3750 |
You can now customize this multiplier by changing this option, typically |
| 3751 |
expanding it to account for amounts slightly beyond the usual tolerance, |
| 3752 |
for example, if you deal with institutions with bad of unexpected rounding |
| 3753 |
behaviour. |
| 3754 |
|
| 3755 |
- Promoted the 'experiment_infer_tolerance_from_cost' option to |
| 3756 |
'infer_tolerance_from_cost': not an experiment anymore. See thread on |
| 3757 |
mailing-list w/ mharris. This feature works well and actually solves real |
| 3758 |
problems for users. |
| 3759 |
|
| 3760 |
A corresponding section has been added in the documentation at |
| 3761 |
http://furius.ca/beancount/doc/tolerances |
| 3762 |
|
| 3763 |
|
| 3764 |
2015-06-04 |
| 3765 |
|
| 3766 |
- When using the 'experiment_infer_tolerance_from_cost' option, the inferred |
| 3767 |
tolerance is now expanded to include the SUM of all maximum rounding errors |
| 3768 |
from postings held at cost, not just the maximum. Users with multiple |
| 3769 |
rounding events in a single transactions could occur rounding that many |
| 3770 |
times. We assume no more rounding events than the number of postings held at |
| 3771 |
cost. |
| 3772 |
|
| 3773 |
- I wrote a new document to explain how to deal with restricted stock units |
| 3774 |
vesting events: |
| 3775 |
http://furius.ca/beancount/doc/vesting |
| 3776 |
|
| 3777 |
|
| 3778 |
2015-06-03 |
| 3779 |
|
| 3780 |
- bean-doctor context now outputs weight and residual numbers at their full |
| 3781 |
precision instead of their rounded one. |
| 3782 |
|
| 3783 |
|
| 3784 |
2015-06-02 |
| 3785 |
|
| 3786 |
- Created a new document to keep track of user contributions: |
| 3787 |
http://furius.ca/beancount/doc/contrib |
| 3788 |
|
| 3789 |
|
| 3790 |
2015-05-30 |
| 3791 |
|
| 3792 |
- Converted the Syntax Cheat Sheet to a Google Doc and removed it here. |
| 3793 |
|
| 3794 |
- Added a check to bake the source code's checksums into the C extension |
| 3795 |
module and upon loading beancount.parser.parser check that the checksums |
| 3796 |
match. This automatically issues a warning on all programs that use the |
| 3797 |
parser if the compiled extension module is out-of-date and the user needs to |
| 3798 |
rebuild. This should explain the occasional unexpected situation where the |
| 3799 |
extension module doesn't match the Python code, for those running from |
| 3800 |
source or during development and in switching branches. |
| 3801 |
|
| 3802 |
- Added an experimental boolean option: 'experiment_infer_tolerance_from_cost' |
| 3803 |
that expands the inferred tolerance to include values inferred from the cost |
| 3804 |
and price amounts on those cost and price currencies. |
| 3805 |
|
| 3806 |
Here is the doc for it: |
| 3807 |
|
| 3808 |
Enable an EXPERIMENTAL feature that expands the maximum tolerance inferred |
| 3809 |
on transactions to include values on cost currencies inferred by postings |
| 3810 |
held at-cost or converted at price. Those postings can imply a tolerance |
| 3811 |
value by multiplying the smallest digit of the unit by the cost or price value |
| 3812 |
and taking half of that value. |
| 3813 |
|
| 3814 |
For example, if a posting has an amount of "2.345 RGAGX {45.00 USD}" |
| 3815 |
attached to it, it implies a tolerance of 0.001 x 45.00 / 2 = 0.045 USD |
| 3816 |
and this is added to the mix to enlarge the tolerance allowed for units of |
| 3817 |
USD on that transaction. All the normally inferred tolerances (see |
| 3818 |
http://furius.ca/beancount/doc/tolerances) are still taken into account. |
| 3819 |
Enabling this flag only makes the tolerances potentially wider. |
| 3820 |
|
| 3821 |
WARNING: This feature may go away in the future. It is an exploration to see |
| 3822 |
if it is truly useful. |
| 3823 |
|
| 3824 |
- Added a dependency check for 'curses' library and updated documentation. |
| 3825 |
This is for OpenSuse which packages curses separately. |
| 3826 |
|
| 3827 |
|
| 3828 |
2015-05-22 |
| 3829 |
|
| 3830 |
- Fixed a simple bug (#47) where the default value used for legacy tolerances |
| 3831 |
wasn't being initialized properly and added a test for it. |
| 3832 |
|
| 3833 |
|
| 3834 |
2015-05-20 |
| 3835 |
|
| 3836 |
- Fixed a potential important bug (#48) just introduced a few days ago whereby |
| 3837 |
enabling the 'account_rounding' option would inadvertently disable balance |
| 3838 |
checks. Thanks to Matthew Harris for finding and reporting it. |
| 3839 |
|
| 3840 |
- Added a 'dedent' option to both beancount.parser.parser.parse_string() and |
| 3841 |
beancount.loader.load_string(). This is a convenience for writing quick |
| 3842 |
tests. |
| 3843 |
|
| 3844 |
|
| 3845 |
2015-05-17 |
| 3846 |
|
| 3847 |
- MAJOR CHANGES: Precision and tolerances in Beancount have been entirely |
| 3848 |
revamped. The logic used to compute tolerances on transaction balances and |
| 3849 |
balance assertions is new. This previously discussed proposal: |
| 3850 |
|
| 3851 |
http://furius.ca/beancount/doc/proposal-rounding |
| 3852 |
|
| 3853 |
has been implemented. The new behaviour is documented here: |
| 3854 |
|
| 3855 |
http://furius.ca/beancount/doc/tolerances |
| 3856 |
|
| 3857 |
|
| 3858 |
Here is a high-level summary of changes (see doc above for details): |
| 3859 |
|
| 3860 |
* The tolerance used for transaction balances is inferred automatically from |
| 3861 |
the amounts on the transactions themselves. When not possible, a default |
| 3862 |
tolerance is looked up from values you can provide (as well as a global |
| 3863 |
default). |
| 3864 |
|
| 3865 |
* There is a new 'default_tolerances' option to provide tolerances to be |
| 3866 |
used used when it cannot be inferred automatically. You use it like this: |
| 3867 |
|
| 3868 |
option "default_tolerance" "*:0.005" |
| 3869 |
option "default_tolerance" "INR:0.5" |
| 3870 |
... |
| 3871 |
|
| 3872 |
* The 'tolerance' option has been deprecated. It now has no effect. |
| 3873 |
|
| 3874 |
* Balance assertions and Pad directives use a similar inference mechanism, |
| 3875 |
where the tolerance is based on the precision of the expected number in |
| 3876 |
the input. |
| 3877 |
|
| 3878 |
* Rounding errors may be automatically posted to a special account (new |
| 3879 |
postings are inserted during parsing where necessary). This is disabled by |
| 3880 |
default; you enable this by setting the new 'account_rounding' option to |
| 3881 |
the account you want the rounding errors to be posted to: |
| 3882 |
|
| 3883 |
option "account_rounding" "Equity:Rounding-Errors" |
| 3884 |
|
| 3885 |
* These changes may cause some of your transactions to report as not |
| 3886 |
balancing, because the tolerances and now inferred automatically and the |
| 3887 |
inferred tolerances may be smaller than the fixed value we used |
| 3888 |
previously. YOU NEED TO MAKE SUITABLE ADJUSTMENTS TO YOUR INPUT FILE. |
| 3889 |
However, because this might cause some minor disruption, I have provided |
| 3890 |
an option to allow users to revert Beancount to its previous tolerance |
| 3891 |
behavior for a few months: |
| 3892 |
|
| 3893 |
option "use_legacy_fixed_tolerances" "TRUE" |
| 3894 |
|
| 3895 |
* There is a new EXPERIMENTAL feature which makes Beancount accept an |
| 3896 |
explicit tolerance value on balance assertions, like this: |
| 3897 |
|
| 3898 |
YYYY-MM-DD balance <account> <number> ~ <tolerance> <currency> |
| 3899 |
|
| 3900 |
For example, |
| 3901 |
|
| 3902 |
2015-05-17 balance Assets:Vanguard 23.2134 ~ 0.002 RGAGX |
| 3903 |
|
| 3904 |
By default, this feature is not enabled; this is being tested out and it |
| 3905 |
might go away eventually. To enable it, add the following experiment flag: |
| 3906 |
|
| 3907 |
option "experiment_explicit_tolerances" "TRUE" |
| 3908 |
|
| 3909 |
|
| 3910 |
- The 'plugin' option has now been deprecated and will issue a warning if you |
| 3911 |
use it. You must now use the 'plugin' directive instead. |
| 3912 |
|
| 3913 |
- The parser now supports boolean types, with this syntax: TRUE, FALSE. This |
| 3914 |
can be useful to set metadata fields. |
| 3915 |
|
| 3916 |
- Postings that were inserted automatically have some metadata set on them to |
| 3917 |
distinguish this fact ('__automatic__'). |
| 3918 |
|
| 3919 |
|
| 3920 |
|
| 3921 |
2015-05-12 |
| 3922 |
|
| 3923 |
- Allow currency names up to 24 characters (not 12). This is often required |
| 3924 |
for people using financial options. |
| 3925 |
|
| 3926 |
|
| 3927 |
2015-05-11 |
| 3928 |
|
| 3929 |
- Added parsing of boolean types: TRUE, FALSE will produce values of |
| 3930 |
Python "True" and "False". This is useful to used as metadata values. |
| 3931 |
|
| 3932 |
- Removed extraneous reference release in key_value_value in parser. |
| 3933 |
|
| 3934 |
|
| 3935 |
2015-05-03 |
| 3936 |
|
| 3937 |
- Added Equity to the list of accounts that count as proceeds for |
| 3938 |
beancount.plugins.sellgains plugin. This is so that old transactions |
| 3939 |
may use an unknown equity account and still pass the sellgains check. |
| 3940 |
|
| 3941 |
|
| 3942 |
2015-04-19 |
| 3943 |
|
| 3944 |
- Fixed a bug with the pad directive that did not look for account name |
| 3945 |
boundaries when looking at a parent account. |
| 3946 |
|
| 3947 |
- In output of bean-doctor context, now print the residual amount. |
| 3948 |
|
| 3949 |
|
| 3950 |
2015-04-18 |
| 3951 |
|
| 3952 |
- Implemented limited support for arithmetic expressions. For now, only |
| 3953 |
support division. So A/B where "A" and "B" are numbers should now work. |
| 3954 |
|
| 3955 |
In order to support full arithmetic expressions, we need to reimplement |
| 3956 |
the lexer in order to distinguish between "*" as a TAG or as a multiplication |
| 3957 |
token, and operator precedence to deal with terms vs. exprs. This will |
| 3958 |
probably be done soon. (I need division for a particular task right now, so |
| 3959 |
it is being added in a backwards-compatilble way). |
| 3960 |
|
| 3961 |
|
| 3962 |
2015-04-18 |
| 3963 |
|
| 3964 |
- Merged a new plugin (beancount.plugins.sellgains) that automatically |
| 3965 |
cross-checks the purchase price of a lot against all the other legs that are |
| 3966 |
in non-income accounts. This is useful to verify the correctness of @ price |
| 3967 |
annotations on reductions at cost, because not only the transactions have to |
| 3968 |
balance in cost (that is, including the income portion), they then also have |
| 3969 |
to balance without the income portion, using the price you attached (if you |
| 3970 |
somehow reported an incorrect price you will get an error). |
| 3971 |
|
| 3972 |
This is best explained with an example: |
| 3973 |
|
| 3974 |
1999-07-31 * "Sell" |
| 3975 |
Assets:US:BRS:Company:ESPP -81 ADSK {26.3125 USD} @ 26.4375 USD |
| 3976 |
Assets:US:BRS:Company:Cash 2141.36 USD |
| 3977 |
Expenses:Financial:Fees 0.08 USD |
| 3978 |
Income:US:Company:ESPP:PnL -10.125 USD |
| 3979 |
|
| 3980 |
The regular balance verification checks all the legs against the cost basis: |
| 3981 |
|
| 3982 |
-18 x 26.3125 + 2141.36 + 0.08 - 10.125 = 0 USD |
| 3983 |
|
| 3984 |
This is the default behavior, and is still required. With the sellgains |
| 3985 |
plugin, an additional check also verifies that |
| 3986 |
|
| 3987 |
-18 x 26.4375 + 2141.36 + 0.08 = 0 USD |
| 3988 |
|
| 3989 |
Note how the price (26.4375) is used instead of the cost basis, and how |
| 3990 |
income legs are ignore in the calculation. |
| 3991 |
|
| 3992 |
Transactions with reductions without a price and without an income leg will |
| 3993 |
be ignored, so only those which can be verified will be verified. |
| 3994 |
|
| 3995 |
|
| 3996 |
2015-04-13 |
| 3997 |
|
| 3998 |
- Beancount now allows the cost to the set to zero. This is useful for stock |
| 3999 |
options that one receives from an employer that have no value attached to |
| 4000 |
them. |
| 4001 |
|
| 4002 |
Additionally, I'm considering allowing negative cost as well, which may be |
| 4003 |
necessary to handle adjusted cost bases, but I haven't added this just yet. |
| 4004 |
I'm not 100% convinced (adjustments are probably always upward). |
| 4005 |
|
| 4006 |
|
| 4007 |
2015-04-16 |
| 4008 |
|
| 4009 |
- Added a new command to bean-doctor: "linked" which prints out all |
| 4010 |
transactions linked to the one at a given line number, in a format Emacs can |
| 4011 |
grok with filename and location like errors so you can easily navigate |
| 4012 |
between the linked transactions. |
| 4013 |
|
| 4014 |
Correspondingly, added a "bean-linked" command to the Emacs support mode. |
| 4015 |
|
| 4016 |
|
| 4017 |
2015-04-13 |
| 4018 |
|
| 4019 |
- A minor improvment to bean-format has been implemented: Whitespace before |
| 4020 |
postings is now automatically normalized to the most frequent spacing |
| 4021 |
present in the document. This allows you to be somewhat sloppy on the |
| 4022 |
postings themselves when entering new transactions. |
| 4023 |
|
| 4024 |
|
| 4025 |
2015-02-16 |
| 4026 |
|
| 4027 |
- Finally completed documentation on how to export your portfolio to Google |
| 4028 |
Finance, as |
| 4029 |
http://furius.ca/beancount/doc/export, |
| 4030 |
or equivalently as |
| 4031 |
https://docs.google.com/document/d/1eZIDRmQZxR6cmDyOJf7U3BnCm4PDMah2twxYFfKPJtM/ |
| 4032 |
|
| 4033 |
|
| 4034 |
2015-02-10 |
| 4035 |
|
| 4036 |
- Revamped the export-to-OFX report to showcase a more explicit, flexible and |
| 4037 |
easily debuggable configuration. Also supports the declaration of money |
| 4038 |
instrument equivalents within the file itself. This will be documented here: |
| 4039 |
https://docs.google.com/document/d/1eZIDRmQZxR6cmDyOJf7U3BnCm4PDMah2twxYFfKPJtM/ |
| 4040 |
|
| 4041 |
|
| 4042 |
2015-02-03 |
| 4043 |
|
| 4044 |
- Fixed an unreported bug with Emacs support whereby a number appearing within |
| 4045 |
a narration string would get aligned along with the other amounts. |
| 4046 |
|
| 4047 |
|
| 4048 |
2015-02-01 |
| 4049 |
|
| 4050 |
- Implemented an "include" directive. The include directive does not parse the |
| 4051 |
files in order... rather, each parse run on an input file accumulates the |
| 4052 |
list of includes to be parsed and processed the includes after parsing the |
| 4053 |
file. Because we're order independent, this should work. Note however that |
| 4054 |
the options should be set in the root file. |
| 4055 |
|
| 4056 |
This is documented here: |
| 4057 |
https://docs.google.com/document/d/1wAMVrKIA2qtRGmoVDSUBJGmYZSygUaR0uOMW1GV3YE0/edit#heading=h.86lelow4097r |
| 4058 |
|
| 4059 |
|
| 4060 |
2015-01-24 |
| 4061 |
|
| 4062 |
- I created a new branch 'ledgerhub' to provide a version of Beancount that i |
| 4063 |
guaranteed to be compatible with LedgerHub. |
| 4064 |
|
| 4065 |
Previously, LedgerHub was synchronizing a copy of some of the files under |
| 4066 |
beancount.core in order to avoid depending on Beancount. This turned out to |
| 4067 |
be difficult to maintain, as Beancount is still evolving relatively fast. So |
| 4068 |
I've decided to return to the original state of affairs: LedgerHub will |
| 4069 |
depend on a Beancount install in order to reuse its core libraries. (The |
| 4070 |
original reason for not doing so was that I thought I'd want to fork |
| 4071 |
those core libraries to support Ledger-specific features, but at this point |
| 4072 |
it's dubious whether I will need that at all --or whether I couldn't just |
| 4073 |
add generic support in Beancount's core libraries themselve to do that-- and |
| 4074 |
this will be an easier way to synchronize the two codebases going forward). |
| 4075 |
|
| 4076 |
If you're a LedgerHub user, please checkout Beancount at its 'ledgerhub' |
| 4077 |
branch and make your PYTHONPATH depend on that. |
| 4078 |
|
| 4079 |
|
| 4080 |
2015-01-22 |
| 4081 |
|
| 4082 |
- Added a dependency check for PLY and documented in the Install doc |
| 4083 |
(http://furius.ca/beancount/doc/install). |
| 4084 |
|
| 4085 |
|
| 4086 |
2015-01-18 |
| 4087 |
|
| 4088 |
- Added a new, optional "Commodity" directive, which can be used to declare |
| 4089 |
commodity/currencies/instruments. The real purpose of this optional |
| 4090 |
directive is to hang per-commodity meta-data off of them. Some scripts are |
| 4091 |
much simplified by being able to define custom attributes for each |
| 4092 |
commodity, e.g. "name", "asset-class", "currency-exposure", and such. There |
| 4093 |
is a new function beancount.core.getters.get_commodity_map() which can be |
| 4094 |
used to gather a map of commodity to metadata. |
| 4095 |
|
| 4096 |
You otherwise don't have to add those declarations; the new directive is |
| 4097 |
entirely optional and its addition should not break any existing feature |
| 4098 |
nor input file. It is an error to insert duplicate Commodity directives |
| 4099 |
for the same commodity name. I'm mainly doing this now so I can migrate |
| 4100 |
the portfolio dashboard script from experiments into the mainline while |
| 4101 |
configuring it using metadata. |
| 4102 |
|
| 4103 |
The directive is documented here: |
| 4104 |
http://furius.ca/beancount/doc/language#heading=h.a3si01ejc035 |
| 4105 |
|
| 4106 |
|
| 4107 |
- I added a development dependency on pyflakes and validated all code on |
| 4108 |
'default' to pass a flawless pyflakes run. |
| 4109 |
|
| 4110 |
|
| 4111 |
2015-01-17 |
| 4112 |
|
| 4113 |
- I added a paragraph about Releases in the Install document. Basically, I |
| 4114 |
don't do releases: the "default" branch is stable, just clone on "default" |
| 4115 |
and update regularly, I do all "risky" feature development in branches and |
| 4116 |
only merge to "default" when fully stable. All major changes on "default" |
| 4117 |
are announced in this file. |
| 4118 |
|
| 4119 |
|
| 4120 |
2015-01-11 |
| 4121 |
|
| 4122 |
- **IMPORTANT** Fixed an inconsistency with the signs of total cost syntax, |
| 4123 |
like this: |
| 4124 |
|
| 4125 |
<account> -1000 USD @@ -1123.24 CAD |
| 4126 |
|
| 4127 |
It was required to use the negative sign in order to get the correct value. |
| 4128 |
This makes no sense: per-unit cost and price amounts were unsigned, and total |
| 4129 |
cost values were only allowed to be positive. Also, Ledger requires all |
| 4130 |
costs and prices to be positive/unsigned, which could be confusing for |
| 4131 |
Ledger users. I had no particularly good reason to require the same sign |
| 4132 |
for total cost: this was only an oversight. |
| 4133 |
|
| 4134 |
So I changed this so that total price, like total cost, per-unit price, |
| 4135 |
per-unit cost, are all positive/unsigned. An error is now raised i a price |
| 4136 |
or cost, total or per-unit, are provided negative. You need to convert your |
| 4137 |
input files to unsigned values, like this (for the above example): |
| 4138 |
|
| 4139 |
<account> -1000 USD @@ 1123.24 CAD |
| 4140 |
|
| 4141 |
If you pull this change and have negative total prices, your input file will |
| 4142 |
break. In order to circumvent the change, you may set the |
| 4143 |
BEANCOUNT_ALLOW_NEGATIVE_PRICES environment variable. I will remove this |
| 4144 |
workaround in a few months. |
| 4145 |
(This bug reported by Matthew Harris.) |
| 4146 |
|
| 4147 |
- Fixed a bug when total cost {{...}} syntax was being used with a negative |
| 4148 |
number of units: it would raise an error, although it was legal to do so. |
| 4149 |
For example, this is legal and was raising an error: |
| 4150 |
|
| 4151 |
<account> -10 MSFT {{455.24 USD}} |
| 4152 |
|
| 4153 |
It probably did not show up much because few people use the total cost |
| 4154 |
method, and the tests happened only to use positive numbers of units. |
| 4155 |
|
| 4156 |
- Fixed issue #5: bug in beancount.plugins.leafonly plugin when posting to a |
| 4157 |
non-leaf account that had no Open directive. (This bug reported by Nathan |
| 4158 |
Grigg.) |
| 4159 |
|
| 4160 |
|
| 4161 |
2015-01-04 |
| 4162 |
|
| 4163 |
- Merged the 'shell' branch into 'default', providing a new tool to extract |
| 4164 |
information from a Beancount input file: bean-query. This is the first |
| 4165 |
revision of the SQL-like query language for Beancount. Documentation for it |
| 4166 |
is available under http://furius.ca/beancount/doc/query. |
| 4167 |
|
| 4168 |
|
| 4169 |
2014-12-28 |
| 4170 |
|
| 4171 |
- Merged various functions (in beancount.ops.lifetimes) used to automatically |
| 4172 |
compute the date intervals that particular commodities are in used. This is |
| 4173 |
intended to be used to write scripts to automatically fetch all the price |
| 4174 |
entries needed during the lifetime of a particular Ledger. A script has been |
| 4175 |
created under experiments (src/experiments/fetch-missing-prices.py) which |
| 4176 |
you should be able to modify to your favourite price fetcher. |
| 4177 |
|
| 4178 |
- The 'export_holdings' report now exports an extra holding as a cash |
| 4179 |
equivalent mutual fund in order to take into account of the value of |
| 4180 |
holdings that could not be converted to symbols the online portfolio |
| 4181 |
manager software knows about. The cash position brings the portfolio to |
| 4182 |
close to its total value. |
| 4183 |
|
| 4184 |
|
| 4185 |
2014-12-26 |
| 4186 |
|
| 4187 |
- Merged the latest version of the 'display_context' branch into 'default'. |
| 4188 |
These changes make the DisplayContext object a factory for DisplayFormatter |
| 4189 |
objects which are then used to render numbers. This is a little more |
| 4190 |
sophisticated than the previous approach and will be reusable in the |
| 4191 |
rendering routines for the interactive SQL shell's result. |
| 4192 |
|
| 4193 |
|
| 4194 |
2014-12-25 |
| 4195 |
|
| 4196 |
- The 'metadata' branch has been merged into 'default'. Metadata is now |
| 4197 |
officially supported in Beancount. |
| 4198 |
|
| 4199 |
* Metadata can be created on all directives and postings. An attribute of |
| 4200 |
'.meta' can be used to access all parsed metadata. The object is a dict |
| 4201 |
which can also have its fields accessed via attributes. |
| 4202 |
|
| 4203 |
* The '.source' attribute on all directives has been removed and '.meta' now |
| 4204 |
replaces it. The 'filename' and 'lineno' attributes which were previously |
| 4205 |
available on the beancount.core.data.Source tuple have been folded into |
| 4206 |
the metadata dict under the same names. |
| 4207 |
|
| 4208 |
* Metadata values can be of various datatypes and these will be parsed and |
| 4209 |
available in Python: |
| 4210 |
|
| 4211 |
- Strings |
| 4212 |
- Account names (appears as str) |
| 4213 |
- Currency (appears as str) |
| 4214 |
- Dates (a datetime.date instance) |
| 4215 |
- Tags (appears as str) |
| 4216 |
- Numbers (a decimal.Decimal instance) |
| 4217 |
- Amount (a beancount.core.amount.Amount instance) |
| 4218 |
|
| 4219 |
* Attributes without a value will be parsed and have a value of 'None'. If |
| 4220 |
an attribute is repeated multiple times, only the first value for this |
| 4221 |
attribute will be parsed and retained. |
| 4222 |
|
| 4223 |
* Apart from the 'filename' and 'lineno' attributes, no other "special" |
| 4224 |
usage of metadata will be made by Beancount. Metadata is intended to be |
| 4225 |
for the user to attach arbitrary data to directives. The query language |
| 4226 |
will eventually support query arbitrary metadata attributes, but no special |
| 4227 |
meaning will be assumed. |
| 4228 |
|
| 4229 |
|
| 4230 |
|
| 4231 |
2014-12-19 |
| 4232 |
|
| 4233 |
- Created a new "export_holdings" report type that spits out an OFX format of |
| 4234 |
the holdings that can be consumed by external portfolio definition services |
| 4235 |
such as Google Finance (for example). This is useful, as it allows you to |
| 4236 |
monitor changes in your portfolio from a mobile device. |
| 4237 |
|
| 4238 |
Note that in some of these services, a commodity that isn't a valid ticker |
| 4239 |
symbol fails the import process. Also, a commodity that is a mutual fund |
| 4240 |
recorded in the OFX file as a stock will similar fail the import process. We |
| 4241 |
need to find a way to fetch this info from the file itself. When metadata |
| 4242 |
will get merged, we should be able to get it from the account names, where |
| 4243 |
we could attach a property to the account's corresponding Open directive. |
| 4244 |
|
| 4245 |
In the meantime, and as a kludge to start using this right away, place a |
| 4246 |
note for each currency (at any date, in any account) with the text in the |
| 4247 |
following format: |
| 4248 |
|
| 4249 |
YYYY-MM-DD note <account> "Export <commodity>: IGNORE" |
| 4250 |
YYYY-MM-DD note <account> "Export <commodity>: MUTUAL_FUND" |
| 4251 |
|
| 4252 |
This will get removed later. |
| 4253 |
|
| 4254 |
|
| 4255 |
|
| 4256 |
2014-12-07 |
| 4257 |
|
| 4258 |
- After much more work on the SQL query language (in 'shell' branch), I need |
| 4259 |
to access Inventory positions by index, so I removed the getitem ([]) |
| 4260 |
operator from Inventory, which was unused in the codebase. (If you have |
| 4261 |
scripts this *may* affect you; translate calls to [] into calls to |
| 4262 |
.get_position()). |
| 4263 |
|
| 4264 |
|
| 4265 |
|
| 4266 |
2014-11-29 |
| 4267 |
|
| 4268 |
- Completed work on calculating returns (merged branch 'returns' into |
| 4269 |
default). I created a new package called "projects" to hold these special |
| 4270 |
tasks, those that don't integrate in the plugins framework, and created a |
| 4271 |
beancount.projects.returns library that can be inovoked as a script, like |
| 4272 |
this: |
| 4273 |
|
| 4274 |
python3 -m beancount.projects.returns <filename.beancount> ... |
| 4275 |
|
| 4276 |
For the arguments, you will have to read the docstring. You essentially need |
| 4277 |
to provide two or three regular expressions to list the set of accounts |
| 4278 |
that define you portfolio as well as other lists of accounts that should be |
| 4279 |
considered internal flows. See the docstring for details. I will eventually |
| 4280 |
move much of that explanation into a Google Doc and detail it in more depth. |
| 4281 |
|
| 4282 |
There is also a script that runs it on the example beancount file, as well |
| 4283 |
as examples in the unit tests. |
| 4284 |
|
| 4285 |
|
| 4286 |
2014-11-27 |
| 4287 |
|
| 4288 |
- Started the "booking" branch which will implement the |
| 4289 |
http://furius.ca/beancount/doc/proposal-booking proposal. The first step was |
| 4290 |
to add an argument to the Open directive to specify the default booking |
| 4291 |
method to use when there are either 0, 2 or more matching lots in an |
| 4292 |
inventory. The only value supported by this are currently "STRICT" (the |
| 4293 |
default) or "NONE" which effectively disables inventory booking and is |
| 4294 |
equivalent to Ledger's method of accumulating lots. The new syntax looked |
| 4295 |
like this and is backward compatible with previous synta for it: |
| 4296 |
|
| 4297 |
YYYY-MM-DD open <account> [<commodities>] ["<booking-method>"] |
| 4298 |
|
| 4299 |
Though the result may be inventories with positive and negative positions in |
| 4300 |
the same commodity, this is useful for working with accounts booked at their |
| 4301 |
average cost (until we have correct treatment of basis for those with |
| 4302 |
dedicated syntax for merging lots). The total number of units and the total |
| 4303 |
cost should be correct. |
| 4304 |
|
| 4305 |
This state of the 'booking' branch was merged into the 'default' branch, |
| 4306 |
which is why it appears in this CHANGE entry. |
| 4307 |
|
| 4308 |
|
| 4309 |
2014-11-21 |
| 4310 |
|
| 4311 |
- Merged "metadata" branch into default, Beancount now parses the metadata but |
| 4312 |
does not store it anywhere. This was done so that early adopters can start |
| 4313 |
to enter metadata right away even if it is not usable yet. |
| 4314 |
|
| 4315 |
|
| 4316 |
2014-11-13 |
| 4317 |
|
| 4318 |
- Added a new "beancount.plugins.ira_contribs" module that automatically |
| 4319 |
inserts postings for tracking pre-tax money contributions. |
| 4320 |
|
| 4321 |
|
| 4322 |
2014-11-11 |
| 4323 |
|
| 4324 |
- The precision of rendered numbers isn't quantized nor subject to hard-coded |
| 4325 |
maximums anymore. I cleaned this up. There is a new "DisplayContext" object |
| 4326 |
that maintains the most common and maximum precisions to be used to render |
| 4327 |
each currency, and this precision is derived automatically from the numbers |
| 4328 |
used in the input file (the most common is the mode of the distribution of |
| 4329 |
numbers seen). The alignment of the printer's amounts is now also fixed (it |
| 4330 |
rendered correct transactions lately but alignment was a little borked), and |
| 4331 |
the output is now kept as tightly as possible close to the account names. |
| 4332 |
|
| 4333 |
- Numbers don't render with commas by default anymore. There is a new option: |
| 4334 |
'render_commas' that you can set to have commas in numbers rendered in all |
| 4335 |
the routines that output numbers. |
| 4336 |
|
| 4337 |
|
| 4338 |
2014-11-09 |
| 4339 |
|
| 4340 |
- A new directive has been created: "plugin" that accepts the an optional |
| 4341 |
plugin-configuration string. Instead of |
| 4342 |
|
| 4343 |
option "plugin" "<module>" |
| 4344 |
option "plugin" "<module>:<config>" |
| 4345 |
|
| 4346 |
Now use: |
| 4347 |
|
| 4348 |
plugin "<module>" |
| 4349 |
plugin "<module>" "<config>" |
| 4350 |
|
| 4351 |
The plugin option will remain functional for a while. The configuration |
| 4352 |
string is as previously a free-form string whose meaning is to be defined by |
| 4353 |
the plugin itself. |
| 4354 |
|
| 4355 |
- The parser now stores the distribution of the precisions of all the numbers |
| 4356 |
it parses, and this adds a little bit of overhead (about 4%). With a large |
| 4357 |
file, you might notice a little tiny bit of extra slowness. The reason I |
| 4358 |
created this is in order to automatically infer reasonable defaults for the |
| 4359 |
display precision (used in the SQL shell at the moment). |
| 4360 |
|
| 4361 |
- Renamed the 'bean-query' tool to 'bean-report'. There is a good reason for |
| 4362 |
this: there is a new tool coming that will provide an command-shell to make |
| 4363 |
interactive queries on your ledger contents. This tool will be |
| 4364 |
called--appropriately--"bean-query". I decided that the two tools should be |
| 4365 |
separate: "bean-report" will be used to render custom-coded reports (nothing |
| 4366 |
changes), and "bean-query" will be used to build reports out of SQL-like |
| 4367 |
queries. I'm hoping that eventually bean-query functionality will entirely |
| 4368 |
subsume bean-report reports, but that is unclear at this point. |
| 4369 |
|
| 4370 |
- Made default rendering for changes and balances of HTML reports by units(). |
| 4371 |
Rendering all the lots was horrible in even moderately complex stock trading |
| 4372 |
accounts with a few positions. Now we aggregate by currency ("units"). |
| 4373 |
|
| 4374 |
In order for the user to be able to view the previously available lot |
| 4375 |
detail from the web interface, we now provide a link to the "context", |
| 4376 |
which is a link specific to a transaction that renders the balances for all |
| 4377 |
the accounts just before the transaction is applied, and just after. |
| 4378 |
|
| 4379 |
- (Internal) Renamed beancount.core.complete to beancount.core.interpolate. |
| 4380 |
I've been using the term interpolate for a while now, in the docs, and it's |
| 4381 |
way more telling than complete. |
| 4382 |
|
| 4383 |
|
| 4384 |
(Beginning to summarize user-facing changes 2014-11-09.) |