Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand All @@ -36,4 +36,4 @@ jobs:
pipenv run mypy src tests
- name: Black
run: |
pipenv run black --check setup.py src tests
pipenv run black --check src tests
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include README.rst
include README.md
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ coverage: bin/pytest

.PHONY: black
black:
black setup.py src tests
black src tests

.PHONY: mypy
mypy:
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dataclasses = "*" # required by black on python-3.6

[packages]
ofxstatement = "*"
ofxstatement-sample = {editable = true, path = "."}
ofxstatement-transferwise = {editable = true, path = "."}

[pipenv]
allow_prereleases = true
307 changes: 129 additions & 178 deletions Pipfile.lock

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "ofxstatement-transferwise"
version = "1.1.0.dev0"
description = "Transferwise plugin for ofxstatement"
readme = "README.md"
license = "GPL-3.0-or-later"
authors = [
{name = "Andrey Lebedev", email = "andrey@lebedev.lt"}
]
keywords = ["ofx", "banking", "statement"]
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Natural Language :: English",
"Topic :: Office/Business :: Financial :: Accounting",
"Topic :: Utilities",
"Environment :: Console",
"Operating System :: OS Independent",
]
dependencies = [
"ofxstatement",
]
requires-python = ">=3.6"

[project.urls]
Homepage = "https://github.com/kedder/ofxstatement-transferwise"

[project.entry-points.ofxstatement]
transferwise = "ofxstatement_wise.wise:TransferwisePlugin"

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-dir]
"" = "src"

[tool.mypy]

[tool.pycodestyle]
max-line-length = 88

[tool.black]
line-length = 88
target-version = ['py36']
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

1 change: 0 additions & 1 deletion src/ofxstatement/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/ofxstatement/plugins/__init__.py

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def get_parser(self, filename: str) -> "TransferwiseParser":
class TransferwiseParser(CsvStatementParser):
date_format: str = "%d-%m-%Y"
mappings = {
"amount": 2,
"amount": 3,
"date": 1,
"memo": 4,
"memo": 5,
"refnum": 0,
}

def __init__(
self, fin: TextIO, currency: str = None, account_id: str = None
self, fin: TextIO, currency: str | None = None, account_id: str | None = None
) -> None:
super().__init__(fin)
self.currency = currency
Expand All @@ -55,7 +55,7 @@ def parse_record(self, line: List[str]) -> Optional[StatementLine]:
if sl is None:
return None

ccy = line[3]
ccy = line[4]
if ccy != self.currency:
# Skip lines in some other currencies
return None
Expand Down
12 changes: 6 additions & 6 deletions tests/sample-statement.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"TransferWise ID",Date,Amount,Currency,Description,"Payment Reference","Running Balance","Exchange From","Exchange To","Exchange Rate","Payer Name","Payee Name","Payee Account Number",Merchant,"Total fees"
TRANSFER-175545673,24-08-2020,-357.38,USD,"Sent money to John Doe","Moving to Revolut",787.62,USD,EUR,0.84840,,"John Doe","LT21 1111 2222 3333 4444",,11.35
TRANSFER-175545673,24-08-2020,-11.35,USD,"TransferWise Charges for: TRANSFER-175545673","Sending money",776.27,,,,,TransferWise,,,0
TRANSFER-175522746,24-08-2020,125.00,USD,"Received money from the friend. with reference ",,145.00,,,,"Friend.",,,,0.00
TRANSFER-174549828,20-08-2020,20.17,USD,"Topped up balance",,20.17,,,,,,,,0.17
TRANSFER-174549828,20-08-2020,-0.17,USD,"TransferWise Charges for: TRANSFER-174549828",,20.00,,,,,,,,0
"TransferWise ID",Date,"Date Time",Amount,Currency,Description,"Payment Reference","Running Balance","Exchange From","Exchange To","Exchange Rate","Payer Name","Payee Name","Payee Account Number",Merchant,"Total fees"
TRANSFER-175545673,24-08-2020,"24-08-2020 13:43:54",-357.38,USD,"Sent money to John Doe","Moving to Revolut",787.62,USD,EUR,0.84840,,"John Doe","LT21 1111 2222 3333 4444",,11.35
TRANSFER-175545673,24-08-2020,"24-08-2020 08:12:37",-11.35,USD,"TransferWise Charges for: TRANSFER-175545673","Sending money",776.27,,,,,TransferWise,,,0
TRANSFER-175522746,24-08-2020,"24-08-2020 19:27:05",125.00,USD,"Received money from the friend. with reference ",,145.00,,,,"Friend.",,,,0.00
TRANSFER-174549828,20-08-2020,"20-08-2020 16:01:22",20.17,USD,"Topped up balance",,20.17,,,,,,,,0.17
TRANSFER-174549828,20-08-2020,"20-08-2020 05:55:41",-0.17,USD,"TransferWise Charges for: TRANSFER-174549828",,20.00,,,,,,,,0
2 changes: 1 addition & 1 deletion tests/test_transferwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from ofxstatement.ui import UI

from ofxstatement.plugins.transferwise import TransferwisePlugin
from ofxstatement_wise.wise import TransferwisePlugin


def test_transferwise() -> None:
Expand Down