Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
carderne committed Feb 23, 2025
1 parent 13cc150 commit 006330d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 428 deletions.
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

13 changes: 6 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ packages = ["starling_beancount"]
[project.scripts]
starling = "starling_beancount.extractor:cli"

[dependency-groups]
dev = [
"pyright>=1.1.391",
"ruff>=0.8.5",
"twine",
]

[project.urls]
homepage = "https://github.com/carderne/starling-beancount"

Expand All @@ -63,3 +56,9 @@ pythonVersion = "3.10"
[tool.ruff]
target-version = "py310"
line-length = 120

[dependency-groups]
dev = [
"pyright>=1.1.394",
"ruff>=0.9.7",
]
2 changes: 1 addition & 1 deletion starling_beancount/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def transactions(self, since: dt.date, display: bool = False) -> list[Transactio
if item["source"] == "INTERNAL_TRANSFER" or item["status"] not in VALID_STATUS:
continue

date = dateutil.parser.parse(item["transactionTime"].date)
date = dateutil.parser.parse(item["transactionTime"]).date()
payee = item.get("counterPartyName", "FIXME")
ref = " ".join(item["reference"].split())
amt = Decimal(item["amount"]["minorUnits"]) / 100
Expand Down
5 changes: 2 additions & 3 deletions starling_beancount/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from _typeshed import SupportsWrite
import textwrap
from typing import Sequence
from typing import Sequence, TextIO

import dateutil.parser
from beancount.core.data import Balance, Note, Transaction
Expand All @@ -13,7 +12,7 @@ def parse_date_liberally(string: str):
return dateutil.parser.parse(string).date()


def print_extracted_entries(entries: Sequence[Transaction | Balance | Note], file: SupportsWrite[str]):
def print_extracted_entries(entries: Sequence[Transaction | Balance | Note], file: TextIO):
print("", file=file)

for entry in entries:
Expand Down
Loading

0 comments on commit 006330d

Please sign in to comment.