Metadata-Version: 2.1
Name: tariochbctools
Version: 0.11.2
Summary: Importers, plugins and price fetchers for Beancount
Home-page: https://github.com/tarioch/beancounttools/
Author: Patrick Ruckstuhl
Author-email: patrick@ch.tario.org
License: MIT
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: Intended Audience :: Developers
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Office/Business :: Financial :: Accounting
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/x-rst; charset=UTF-8
Requires-Dist: beancount
Requires-Dist: bitstampclient
Requires-Dist: mt-940
Requires-Dist: pyyaml
Requires-Dist: ibflex
Requires-Dist: requests
Requires-Dist: camelot-py[cv]
Provides-Extra: testing
Requires-Dist: pytest ; extra == 'testing'
Requires-Dist: pytest-cov ; extra == 'testing'
Requires-Dist: flake8 ; extra == 'testing'

.. image:: https://img.shields.io/pypi/l/tariochbctools.svg
   :target: https://pypi.python.org/pypi/tariochbctools
.. image:: https://img.shields.io/pypi/v/tariochbctools.svg
   :target: https://pypi.python.org/pypi/tariochbctools

tariochbctools
==============


Some importers, plugins and price fetchers for the double-entry bookkeeping software `Beancount <http://furius.ca/beancount/>`__.

plugins
-------
**generate_base_ccy_prices**

Dynamically generates prices to the base ccy by applying the fx rate to the base ccy for non base ccy prices

::

  plugin "tariochbctools.plugins.generate_base_ccy_prices" "CHF"


price fetchers
--------------
**alphavantage**

Fetches prices from `Alphavantage <https://www.alphavantage.co/>`_
Requires the environment variable ``ALPHAVANTAGE_API_KEY`` to be set with your personal api key.

::

  2019-01-01 commodity VWRL
    price: "CHF:tariochbctools.plugins.prices.alphavantage/VWRL.SW"

**alphavantagefx**

Fetches fx rates from `Alphavantage <https://www.alphavantage.co/>`_
Requires the environment variable ``ALPHAVANTAGE_API_KEY`` to be set with your personal api key.

::

  2019-01-01 commodity BTC
    price: "CHF:tariochbctools.plugins.prices.alphavantagefx/BTC"


**bitstamp**

Fetches prices from `Bitstamp <https://www.bitstamp.com/>`_

::

  2019-01-01 commodity BTC
    price: "EUR:tariochbctools.plugins.prices.bitstamp/BTC"

**exchangeratesapi**

Fetches prices from `exchangeratesapi.io <https://exchangeratesapi.io//>`_

::

  2019-01-01 commodity EUR
    price: "CHF:tariochbctools.plugins.prices.exchangeratesapi/EUR"

**interactivebrokers**

Fetches prices from `interactivebrokers <https://www.interactivebrokers.com/>`_
Only works if you have open positions with the symbols.
Requires the environment variables ``IBKR_TOKEN`` to be set with your flex query token and ``IBKR_QUERY_ID``
with a flex query that contains the open positions.

::

  2019-01-01 commodity VWRL
    price: "CHF:tariochbctools.plugins.prices.ibkr/VWRL"


importers
---------
**bitstamp**

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

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

::

  username: "12345"
  key: "MyKey"
  secret: "MySecret"
  account: 'Assets:Bitstamp'
  otherExpensesAccount: 'Expenses:Fee'
  capGainAccount: 'Income:Capitalgain'
  monthCutoff: 3
  currencies:
    - eur
    - btc

::

  from tariochbctools.importers.bitst import importer as bitstimp
  CONFIG = [bitstimp.Importer()]

**revolut**

Import CSV from `Revolut <https://www.revolut.com/>`_

::

  from tariochbctools.importers.revolut import importer as revolutimp
  CONFIG = [revolutimp.Importer('/Revolut-CHF.*\.csv', 'Assets:Revolut:CHF', 'CHF')]

**transferwise**

Import from `Transferwise <https://www.transferwise.com/>`_ using their api

::

  from tariochbctools.importers.transferwise import importer as twimp
  CONFIG = [twimp.Importer()]

Create a file called transferwise.yaml in your import location (e.g. download folder).

::

  token: <your api token>
  baseAccount: <Assets:Transferwise:>

**TrueLayer**

Import from `TrueLayer <https://www.truelayer.com/>`_ using their api services. e.g. supports Revolut.
You need to create a dev account and see their documentation about how to get a refresh token.

::

  from tariochbctools.importers.truelayer import importer as tlimp
  CONFIG = [tlimp.Importer()]

Create a file called truelayer.yaml in your import location (e.g. download folder).

::

  baseAccount: <Assets:MyBank:>
  client_id: <CLIENT ID>
  client_secret: <CLIENT SECRET>
  refresh_token: <REFRESH TOKEN>

**zkb**

Import mt940 from `Zürcher Kantonalbank <https://www.zkb.ch/>`_

::

  from tariochbctools.importers.zkb import importer as zkbimp
  CONFIG = [zkbimp.ZkbImporter('/\d+\.mt940', 'Assets:ZKB')]

**ibkr**

Import dividends from `Interactive Brokers <https://www.interactivebrokers.com/>`_

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

::

  token: <flex web query token>
  queryId: <flex query id>
  baseCcy: CHF

**zak**

**Currently not working reliably**. Import PDF from `Bank Cler ZAK <https://www.cler.ch/de/info/zak/>`_

**mt940**

Import Swift mt940 files.

**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.

::

  transactions:
    - narration: 'Save'
      postings:
          - account: 'Assets:Normal'
            amount: '-10'
            currency: CHF
          - account: 'Assets:Saving'


::

  from tariochbctools.importers.schedule import importer as scheduleimp
  CONFIG = [ scheduleimp.Importer() ]

**Cembra Mastercard Montly Statement**

Import Monthly Statement PDF from Cembra Money Bank (e.g. Cumulus Mastercard).
Requires the dependencies for camelot to be installed. See https://camelot-py.readthedocs.io/en/master/user/install-deps.html#install-deps


::

  from tariochbctools.importers.cembrastatement import importer as cembrastatementimp
  CONFIG = [cembrastatementimp.Importer('\d+.pdf', 'Liabilities:Cembra:Mastercard')]


