Skip to content

Commit

Permalink
Merge pull request #104 from tarioch/feature/multiple_configs
Browse files Browse the repository at this point in the history
Support multiple config files
  • Loading branch information
tarioch authored Oct 12, 2023
2 parents bab1eca + b646a81 commit 9612ae9
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions docs/importers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Bitstamp

Import transactions from `Bitstamp <https://www.bitstamp.com/>`__

Create a file called bitstamp.yaml in your import location (e.g. downloads folder).
Create a file called (or ending with) bitstamp.yaml in your import location (e.g. downloads folder).

.. code-block:: yaml
Expand Down Expand Up @@ -115,7 +115,7 @@ You can then create an import config for beancount, or add Wise to your existing
CONFIG = [twimp.Importer()]
Create a file called transferwise.yaml in your import location (e.g. download folder).
Create a file called (or ending with) transferwise.yaml in your import location (e.g. download folder).

.. code-block:: yaml
Expand Down Expand Up @@ -149,7 +149,7 @@ You need to create a dev account and see their documentation about how to get a
CONFIG = [tlimp.Importer()]
Create a file called truelayer.yaml in your import location (e.g. download folder).
Create a file called (or ending with) truelayer.yaml in your import location (e.g. download folder).

.. code-block:: yaml
Expand Down Expand Up @@ -193,7 +193,7 @@ all be listed in the end.
CONFIG = [nordimp.Importer()]
Create a file called nordigen.yaml in your import location (e.g. download folder).
Create a file called (or ending with) nordigen.yaml in your import location (e.g. download folder).

.. code-block:: yaml
Expand Down Expand Up @@ -222,7 +222,7 @@ Interactivebrokers

Import dividends and buys from `Interactive Brokers <https://www.interactivebrokers.com/>`__

Create a file called ibkr.yaml in your import location (e.g. downloads folder).
Create a file called (or ending with) ibkr.yaml in your import location (e.g. downloads folder).

.. code-block:: yaml
Expand Down Expand Up @@ -260,7 +260,7 @@ Schedule

Generate scheduled transactions.

Define a file called schedule.yaml in your import location (e.g. downloads folder). That describes the schedule transactions. They will be added each month at the end of the month.
Define a file called (or ending with) schedule.yaml in your import location (e.g. downloads folder). That describes the schedule transactions. They will be added each month at the end of the month.

.. code-block:: yaml
Expand Down Expand Up @@ -299,7 +299,7 @@ Blockchain

Import transactions from Blockchain

Create a file called blockchain.yaml in your import location (e.g. downloads folder).
Create a file called (or ending with) blockchain.yaml in your import location (e.g. downloads folder).


.. code-block:: yaml
Expand Down
2 changes: 1 addition & 1 deletion src/tariochbctools/importers/bitst/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Importer(importer.ImporterProtocol):
"""An importer for Bitstamp."""

def identify(self, file):
return "bitstamp.yaml" == path.basename(file.name)
return path.basename(file.name).endswith("bitstamp.yaml")

def file_account(self, file):
return ""
Expand Down
2 changes: 1 addition & 1 deletion src/tariochbctools/importers/blockchain/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Importer(importer.ImporterProtocol):
"""An importer for Blockchain data."""

def identify(self, file):
return "blockchain.yaml" == path.basename(file.name)
return path.basename(file.name).endswith("blockchain.yaml")

def file_account(self, file):
return ""
Expand Down
2 changes: 1 addition & 1 deletion src/tariochbctools/importers/ibkr/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Importer(importer.ImporterProtocol):
"""An importer for Interactive Broker using the flex query service."""

def identify(self, file):
return "ibkr.yaml" == path.basename(file.name)
return path.basename(file.name).endswith("ibkr.yaml")

def file_account(self, file):
return ""
Expand Down
2 changes: 1 addition & 1 deletion src/tariochbctools/importers/nordigen/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Importer(importer.ImporterProtocol):
"""An importer for Nordigen API (e.g. for Revolut)."""

def identify(self, file):
return "nordigen.yaml" == path.basename(file.name)
return path.basename(file.name).endswith("nordigen.yaml")

def file_account(self, file):
return ""
Expand Down
2 changes: 1 addition & 1 deletion src/tariochbctools/importers/schedule/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Importer(importer.ImporterProtocol):
"""An importer for Scheduled/Recurring Transactions."""

def identify(self, file):
return "schedule.yaml" == path.basename(file.name)
return path.basename(file.name).endswith("schedule.yaml")

def file_account(self, file):
return ""
Expand Down
2 changes: 1 addition & 1 deletion src/tariochbctools/importers/transferwise/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Importer(importer.ImporterProtocol):
"""An importer for Transferwise using the API."""

def identify(self, file):
return "transferwise.yaml" == path.basename(file.name)
return path.basename(file.name).endswith("transferwise.yaml")

def file_account(self, file):
return ""
Expand Down
2 changes: 1 addition & 1 deletion src/tariochbctools/importers/truelayer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _configure(self, file, existing_entries):
raise KeyError("At least one of `account` or `accounts` must be specified")

def identify(self, file):
return "truelayer.yaml" == path.basename(file.name)
return path.basename(file.name).endswith("truelayer.yaml")

def file_account(self, file):
return ""
Expand Down

0 comments on commit 9612ae9

Please sign in to comment.