Changeset - 8a4fb5758cb8
[Not reviewed]
main
0 2 0
Ben Sturmfels (bsturmfels) - 30 days ago 2024-08-20 13:32:51
ben@sturm.com.au
statement_reconciler: Fix TypeError in Chase reconciler

There was an incorrect call to replace().
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reconcile/statement_reconciler.py
Show inline comments
...
 
@@ -281,25 +281,25 @@ def validate_chase_csv(sample: str) -> None:
 

	
 
def standardize_chase_record(row: Dict, line: int) -> Dict:
 
    """Turn an Chase CSV row into a standard dict format representing a transaction."""
 
    return {
 
        'date': datetime.datetime.strptime(row['Date'], '%m/%d/%y').date(),
 
        'amount': -1 * parse_amount(row['Amount']),
 
        # Descriptions have quite a lot of information, but the format is a little
 
        # idiosyncratic. We'll need to see more examples before coming up with any ways
 
        # to handle it in code. Others have used regular expressions to match the
 
        # various transaction types:
 
        # https://github.com/mtlynch/beancount-chase-bank/blob/master/beancount_chase/checking.py
 
        # See also: https://awesome-beancount.com/
 
        'payee': (row['Description'] or '').replace('ORIG CO NAME:')[:20],
 
        'payee': (row['Description'] or '').replace('ORIG CO NAME:', '')[:20],
 
        'check_id': '',
 
        'line': line,
 
    }
 

	
 

	
 
def read_chase_csv(f: TextIO) -> list:
 
    reader = csv.DictReader(f)
 
    # The reader.line_num is the source line number, not the spreadsheet row
 
    # number due to multi-line records.
 
    return sort_records(
 
        [standardize_chase_record(row, i) for i, row in enumerate(reader, 2)]
 
    )
setup.cfg
Show inline comments
 
[metadata]
 
name = conservancy_beancount
 
version = 1.20.0
 
version = 1.20.1
 
author = Software Freedom Conservancy
 
author_email = info@sfconservancy.org
 
description = Plugin, library, and reports for reading Conservancy’s books
 
license = AGPLv3-or-later WITH Beancount-Plugin-Additional-Permission-1.0
 
license_files =
 
  LICENSE.txt
 
  AGPLv3.txt
 
long_description = file: README.rst
 
long_description_content_type = text/x-rst; charset=UTF-8
 
project_urls =
 
  Source = %(url)s
 
url = https://k.sfconservancy.org/NPO-Accounting/conservancy_beancount
0 comments (0 inline, 0 general)