Giter Club home page Giter Club logo

fava_miler's Introduction

fava_miler

Airline miles and rewards points: expiration and value reporting for Fava/Beancount (Personal finance software).

Introduction

Airline miles and rewards points typically expire after a period of inactivity. They also can be viewed as having a value in a currency of your choice. If you track airline mile transactions in Beancount, this simple plugin reports on the value of miles and their expiry date. This is particularly useful if you have miles/points on many airlines or businesses.

Screenshot: Miler

Installation

pip install fava-miler

Configuring your beancount source

  • Define your operating_currency
  • Declare the currency for each of your airline miles
  • Add expiry-months and points-value metadata to your commodity declaration
    • Any negative value for expiry-months signifies that this commodity never expires

This should get the reporter working. Example:

option "operating_currency" "USD"
1990-01-01 commodity MILESAIRALD
    expiry-months: 24
    points-value: 0.015 USD

2000-01-01 open Assets:Miles:AirAldorra MILESAIRALD
2000-01-01 open Income:Misc

2010-01-01 * "Credit card miles"
        Assets:Miles:AirAldorra 100 MILESAIRALD
        Income:Misc

Running

beancount

fava-miler --help

fava

Add the following to your source and run fava as you normally would.

2010-01-01 custom "fava-extension" "fava_miler" "{
  'accounts_pattern' : '^Assets.*Reward',
  'exclude_currencies' : '(POINTS_ABC)|(POINTS_DEF)',
}"

fava_miler's People

Contributors

dependabot[bot] avatar redstreet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tbm z1n

fava_miler's Issues

Support expiry field

The expiry-months sort of works, but I'd like a much more accurate calculation of the expiration date.

I am thinking of creating a beancount plugin that would calculate the exact expiration date. That could calculate the exact expiry date and set the expiry metadata for the commodity, so fava_miler could make use of it.

Does that sound like a good approach to you? (If so, I can create a patch. I haven't though about the design of the beancount plugin yet, but that's a separate question)

Filter empty balances

fava_miler shows entries for miles where I have a 0 balance. I think they should be filtered out.

Differentiate between no expiration, expiration and unknown

If expiry-months is not define, the date of the last transaction is used. I don't think that's ideal since:

  • Some miles have no expiration. I think in that case the field should be blank
  • It might not be defined, i.e. unknown, in which case it should say "unknown" or something? (or be blank, but then no expiration should say "none")

I tried something like this but then the sorting broke:

        if 'expiry-months' in meta:
            expiry_months = meta['expiry-months']
            if expiry_months:
                expiry = row.latest_transaction + datetime.timedelta(int(expiry_months)*365/12)
            else:
                expiry = ''
        else:
            expiry = 'unknown'

What's the best way to handle this in your view?

Missing dependency on fava_investor

python3 /home/tbm/.local/lib/python3.7/site-packages/fava_miler/miler.py --help
Traceback (most recent call last):
  File "/home/tbm/.local/lib/python3.7/site-packages/fava_miler/miler.py", line 6, in <module>
    import fava_investor.common.beancountinvestorapi as api
ModuleNotFoundError: No module named 'fava_investor'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.