Re: OFX Importer for Investment Accounts

2020-06-14 Thread Red S
I've added:
1) more specific error checking.
2) A Vanguard test case in the examples directory

This might help you get up and running.

To try it out:
*pip install --upgrade beancount-reds-importers*

On Saturday, June 13, 2020 at 2:46:08 AM UTC-7, Red S wrote:
>
> I can't see anything that's amiss. Unfortunately, this is difficult to 
> debug further without trying to reproduce this using your input file, which 
> is hard to do since it contains private information.
>
> You could try downloading this file, renaming it to OfxDownload.qfx, 
> setting your account_number to "12345678.123456-01" and running your 
> command on it:
>
> https://raw.githubusercontent.com/jseutter/ofxparse/master/tests/fixtures/investment_401k.ofx
>
> It should complain about 'FOO' not being found. This example has an oddity 
> where it also needs 'BAR' and 'BAZ'. These three are cusips you'll need to 
> add. Once you do, this is the expected error you should see (because this 
> is not a Vanguard file):
> AttributeError: 'InvestmentStatement' object has no attribute 
> 'available_cash'
>
> Are you able to get to that point?
>
> See inline for a couple more comments.
>
> On Friday, June 12, 2020 at 5:01:52 PM UTC-7, Joathan Goldman wrote:
>
>> Hi,
>>
>> I'm not a software engineer so might be slow in figuring this out so I 
>> appreciate all your help and creating this importer. I'm still not able to 
>> figure out the issue. Here is what I'm doing:
>>
>> bean-extract jonathan.import ~/staging/OfxDownload.qfx > 
>> ~/staging/OfxDownload.qfx.extract
>>
>> In that same local folder I have a file called "fund_info.py" that I have 
>> edited with the funds and maps. If I delete that file that I get an error 
>> that fund_info is missing. Here is my config file:
>>
>> JONATHANs-MacBook-Pro:beandata jonathan$ more jonathan.import
>>
>> #!/usr/bin/env python3
>>
>> """Import configuration."""
>>
>>
>> import sys
>>
>> from os import path
>>
>>
>> sys.path.insert(0, path.join(path.dirname(__file__)))
>>
>>
>> from beancount_reds_importers import vanguard
>>
>> from fund_info import *
>>
>>
>> # Setting this variable provides a list of importer instances.
>>
>> CONFIG = [
>>
>>
>> # Investments
>>
>> # 
>> --
>>
>>
>> vanguard.Importer({
>>
>> 'main_account'   : 'Assets:US:Investments:Vanguard:Brokerage',
>>
>> 'account_number' : 'XXX',
>>
>> 'transfer'   : 
>> 'Assets:Zero-Sum-Accounts:Transfers:Bank-Account',
>>
>> 'dividends'  : 'Income:Taxable:Dividends:Brokerage',
>>
>> 'cg' : 'Income:Taxable:Capital-Gains:Brokerage',
>>
>> 'fees'   : 'Expenses:Brokerage-Fees:TradIRA',
>>
>> 'rounding_error' : 'Equity:Rounding-Errors:Imports',
>>
>> 'fund_info'   : fund_info,
>>
>> }),
>>
>> ]
>>
>>
>> I tried modifying the the Vanguard importer...the __init__.py file with 
>> the print command and this seemed to confirm that the mapper is not being 
>> created.
>>
>>
>> (
>> /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/beancount_reds_importers/vanguard/__init__.py)
>>
>
>
> Can you copy/paste the output?
>
>  
>
>>
>> I don't see how it would pick up our fund_info.py in the example file but 
>> I haven't looked fully at the code.
>>
>
>
> From the from fund_info import * in jonathan.import.
>
>  
>
>>
>> Anyway, I'll keep investigating when I have some time but if you see 
>> anything obvious I appreciate any help.
>>
>>
>> thanks.
>>
>> On Sunday, June 7, 2020 at 5:40:44 AM UTC+12, Red S wrote:
>>>
>>> Also: are you importing the correct file with your maps? Or are you 
>>> importing the example file that ships with the package by accident?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/fe85b237-fa45-4505-ac5a-3a972d3680d1o%40googlegroups.com.


Re: OFX Importer for Investment Accounts

2020-06-14 Thread Jonathan Goldman
Thanks for the update. Now everything worked fine! Extraction ran perfectly.

On Sun, Jun 14, 2020 at 8:47 PM Red S  wrote:

> I've added:
> 1) more specific error checking.
> 2) A Vanguard test case in the examples directory
>
> This might help you get up and running.
>
> To try it out:
> *pip install --upgrade beancount-reds-importers*
>
> On Saturday, June 13, 2020 at 2:46:08 AM UTC-7, Red S wrote:
>>
>> I can't see anything that's amiss. Unfortunately, this is difficult to
>> debug further without trying to reproduce this using your input file, which
>> is hard to do since it contains private information.
>>
>> You could try downloading this file, renaming it to OfxDownload.qfx,
>> setting your account_number to "12345678.123456-01" and running your
>> command on it:
>>
>> https://raw.githubusercontent.com/jseutter/ofxparse/master/tests/fixtures/investment_401k.ofx
>>
>> It should complain about 'FOO' not being found. This example has an
>> oddity where it also needs 'BAR' and 'BAZ'. These three are cusips you'll
>> need to add. Once you do, this is the expected error you should see
>> (because this is not a Vanguard file):
>> AttributeError: 'InvestmentStatement' object has no attribute
>> 'available_cash'
>>
>> Are you able to get to that point?
>>
>> See inline for a couple more comments.
>>
>> On Friday, June 12, 2020 at 5:01:52 PM UTC-7, Joathan Goldman wrote:
>>
>>> Hi,
>>>
>>> I'm not a software engineer so might be slow in figuring this out so I
>>> appreciate all your help and creating this importer. I'm still not able to
>>> figure out the issue. Here is what I'm doing:
>>>
>>> bean-extract jonathan.import ~/staging/OfxDownload.qfx >
>>> ~/staging/OfxDownload.qfx.extract
>>>
>>> In that same local folder I have a file called "fund_info.py" that I
>>> have edited with the funds and maps. If I delete that file that I get an
>>> error that fund_info is missing. Here is my config file:
>>>
>>> JONATHANs-MacBook-Pro:beandata jonathan$ more jonathan.import
>>>
>>> #!/usr/bin/env python3
>>>
>>> """Import configuration."""
>>>
>>>
>>> import sys
>>>
>>> from os import path
>>>
>>>
>>> sys.path.insert(0, path.join(path.dirname(__file__)))
>>>
>>>
>>> from beancount_reds_importers import vanguard
>>>
>>> from fund_info import *
>>>
>>>
>>> # Setting this variable provides a list of importer instances.
>>>
>>> CONFIG = [
>>>
>>>
>>> # Investments
>>>
>>> #
>>> --
>>>
>>>
>>> vanguard.Importer({
>>>
>>> 'main_account'   : 'Assets:US:Investments:Vanguard:Brokerage',
>>>
>>> 'account_number' : 'XXX',
>>>
>>> 'transfer'   :
>>> 'Assets:Zero-Sum-Accounts:Transfers:Bank-Account',
>>>
>>> 'dividends'  : 'Income:Taxable:Dividends:Brokerage',
>>>
>>> 'cg' : 'Income:Taxable:Capital-Gains:Brokerage',
>>>
>>> 'fees'   : 'Expenses:Brokerage-Fees:TradIRA',
>>>
>>> 'rounding_error' : 'Equity:Rounding-Errors:Imports',
>>>
>>> 'fund_info'   : fund_info,
>>>
>>> }),
>>>
>>> ]
>>>
>>>
>>> I tried modifying the the Vanguard importer...the __init__.py file with
>>> the print command and this seemed to confirm that the mapper is not being
>>> created.
>>>
>>>
>>> (
>>> /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/beancount_reds_importers/vanguard/__init__.py)
>>>
>>
>>
>> Can you copy/paste the output?
>>
>>
>>
>>>
>>> I don't see how it would pick up our fund_info.py in the example file
>>> but I haven't looked fully at the code.
>>>
>>
>>
>> From the from fund_info import * in jonathan.import.
>>
>>
>>
>>>
>>> Anyway, I'll keep investigating when I have some time but if you see
>>> anything obvious I appreciate any help.
>>>
>>>
>>> thanks.
>>>
>>> On Sunday, June 7, 2020 at 5:40:44 AM UTC+12, Red S wrote:

 Also: are you importing the correct file with your maps? Or are you
 importing the example file that ships with the package by accident?
>>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beancount+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beancount/fe85b237-fa45-4505-ac5a-3a972d3680d1o%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CANUAcYcrvvviae2oeFAKqStTZ_8UpaA0jhDUKyXUnwj2NRG-zg%40mail.gmail.com.


Pinto: an interactive CLI for adding transactions to Beancount

2020-06-14 Thread sean . leavey
Hi all,

I'd like to share a small Python project I've been developing on and off 
over the last year or so to scratch my own itch when it comes to Beancount: 
Pinto .
Unlike the developer of Beancount, I log most of my cash transactions 
manually, mainly for my own interest so I can track where I spend the most 
money. Adding these transactions manually became a bit of a pain - having 
to write out or copy-and-paste the same syntax over and over while changing 
only a few fields like dates and values - so I made some CLI scripts to 
make this process easier. I've recently cleaned up the scripts and put them 
on PyPI so others can use them.

The main feature that Pinto provides is a command called pinto add. This is 
an interactive command line interface which prompts the user for various 
information about the new transaction, then enters it into the correct 
position in the accounts file (ordered by date).

In order to be able to write transactions into the correct file, Pinto 
insists on a particular account file structure. There must be a directory 
containing main.beancount and transactions.beancount. I am open to change 
this requirement to some other type later, or allow different types of file 
layout, but this is the one I use so that's what it currently expects. You 
can define an environment variable PINTO_DIR which should point towards the 
directory containing these files, and you then don't need to specify it in 
the calls to pinto.

There is also a templating system where you can define common transactions. 
If you call pinto add with the -t flag, you can specify a template to use 
during the interactive prompt. This pre-populates certain parts of the 
transaction so you don't get asked for them. You can also define lists of 
possible accounts in the template, and you then only get prompted to choose 
from that list. I find this is mainly useful for when I'm adding 
transactions to my beancount transaction file from supermarkets where I've 
maybe got 20 receipts to add. I can quickly run pinto add -t rewe for 
example and fire in the dates and values taking about 5 seconds each, 
limited by the speed of my eyes to find the dates and values on the 
receipts themselves!

See the readme on the PyPI page for some examples of the pinto add process 
with and without templates.

This project is somewhere between alpha and beta, but it has worked for me 
for the past year without too much fuss. I am sure there will be bugs, but 
I am happy to let others play with it now and get any feedback you might 
have. I am also open to integrating this more deeply with Beancount itself 
if there is a will. Please if you do use this, please please ensure your 
account files are backed up on a version control system so that any bugs 
that may be present in the way Pinto writes to your account files do not 
cause irreparable loss.

If you are interested in using it, please see the PyPI page linked above. 
Note that it requires Python 3, so don't install it in shells where Python 
2 is the default interpreter (e.g. on Debian). I personally use a conda 
environment with Python 3.7 to run it. I think it might work with Python 
3.6 too. 

Best wishes,


Sean Leavey

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/8824e024-d979-4ee3-b9cf-d5005408d3b7o%40googlegroups.com.


Re: Pinto: an interactive CLI for adding transactions to Beancount

2020-06-14 Thread Martin Blais
Thanks Sean, added to the contribs list.

On Sun, Jun 14, 2020 at 7:57 AM  wrote:

> Hi all,
>
> I'd like to share a small Python project I've been developing on and off
> over the last year or so to scratch my own itch when it comes to Beancount:
> Pinto .
> Unlike the developer of Beancount, I log most of my cash transactions
> manually, mainly for my own interest so I can track where I spend the most
> money. Adding these transactions manually became a bit of a pain - having
> to write out or copy-and-paste the same syntax over and over while changing
> only a few fields like dates and values - so I made some CLI scripts to
> make this process easier. I've recently cleaned up the scripts and put them
> on PyPI so others can use them.
>
> The main feature that Pinto provides is a command called pinto add. This
> is an interactive command line interface which prompts the user for various
> information about the new transaction, then enters it into the correct
> position in the accounts file (ordered by date).
>
> In order to be able to write transactions into the correct file, Pinto
> insists on a particular account file structure. There must be a directory
> containing main.beancount and transactions.beancount. I am open to change
> this requirement to some other type later, or allow different types of file
> layout, but this is the one I use so that's what it currently expects. You
> can define an environment variable PINTO_DIR which should point towards
> the directory containing these files, and you then don't need to specify it
> in the calls to pinto.
>
> There is also a templating system where you can define common
> transactions. If you call pinto add with the -t flag, you can specify a
> template to use during the interactive prompt. This pre-populates certain
> parts of the transaction so you don't get asked for them. You can also
> define lists of possible accounts in the template, and you then only get
> prompted to choose from that list. I find this is mainly useful for when
> I'm adding transactions to my beancount transaction file from supermarkets
> where I've maybe got 20 receipts to add. I can quickly run pinto add -t
> rewe for example and fire in the dates and values taking about 5 seconds
> each, limited by the speed of my eyes to find the dates and values on the
> receipts themselves!
>
> See the readme on the PyPI page for some examples of the pinto add
> process with and without templates.
>
> This project is somewhere between alpha and beta, but it has worked for me
> for the past year without too much fuss. I am sure there will be bugs, but
> I am happy to let others play with it now and get any feedback you might
> have. I am also open to integrating this more deeply with Beancount itself
> if there is a will. Please if you do use this, please please ensure your
> account files are backed up on a version control system so that any bugs
> that may be present in the way Pinto writes to your account files do not
> cause irreparable loss.
>
> If you are interested in using it, please see the PyPI page linked above.
> Note that it requires Python 3, so don't install it in shells where Python
> 2 is the default interpreter (e.g. on Debian). I personally use a conda
> environment with Python 3.7 to run it. I think it might work with Python
> 3.6 too.
>
> Best wishes,
>
>
> Sean Leavey
>
> --
> You received this message because you are subscribed to the Google Groups
> "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beancount+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beancount/8824e024-d979-4ee3-b9cf-d5005408d3b7o%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhMDumAAq2c%3Dk6gGRbgN%2BU53nzy542eq%2BnjeD0bY52%3D6XQ%40mail.gmail.com.


Re: Expenses paid with external account

2020-06-14 Thread jitinweb
I think an equity account is of good use for this:

For example, 

  2017-01-01  *  "Group Dinner"
   Expenses:Food  -100 USD
   Equity:GroupContributions

This way the expenses get accounted towards your food purchases in your 
ledger. And if you ever wanted to find out how much the group as a whole 
has spent on all of these expenses in total, you could use the 
Equity:GroupContributions account for that.

Regards,
Jitin
   


On Wednesday, June 10, 2020 at 7:18:30 PM UTC+5:30, Travis wrote:
>
> So I have a Beancount file for shared expenses and we add a specific 
> amount each month. Sometimes one of us has to pay for something with their 
> own creditcard/cash. These are shared expenses, that I would like to book 
> in our shared ledger. I do not care who paid it (let's assume we split the 
> cost externally), but I don't want to track these accounts. Is it possible 
> to track these expenses, without calculating the extra money as income?
>
> My goal is that the profit graphs correctly represent our expenses without 
> inflating the income.  Does this even make sense from an accounting 
> perspective? 
>
> Could I use an equity account for this? How do you solve this?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/94e18051-53ff-4803-a073-805298dff11co%40googlegroups.com.


Re: OFX Importer for Investment Accounts

2020-06-14 Thread Red S
Great!

I'm not sure what made it work -- I only touched code that is run after an 
exception occurs (not what makes it occur) -- but I'm glad it's works for 
you now.

Feel free to post here or open bugs on github if you run into other issues 
or have feature requests.

On Sunday, June 14, 2020 at 3:53:21 AM UTC-7, Jonathan Goldman wrote:
>
> Thanks for the update. Now everything worked fine! Extraction ran 
> perfectly.
>
> On Sun, Jun 14, 2020 at 8:47 PM Red S > 
> wrote:
>
>> I've added:
>> 1) more specific error checking.
>> 2) A Vanguard test case in the examples directory
>>
>> This might help you get up and running.
>>
>> To try it out:
>> *pip install --upgrade beancount-reds-importers*
>>
>> On Saturday, June 13, 2020 at 2:46:08 AM UTC-7, Red S wrote:
>>>
>>> I can't see anything that's amiss. Unfortunately, this is difficult to 
>>> debug further without trying to reproduce this using your input file, which 
>>> is hard to do since it contains private information.
>>>
>>> You could try downloading this file, renaming it to OfxDownload.qfx, 
>>> setting your account_number to "12345678.123456-01" and running your 
>>> command on it:
>>>
>>> https://raw.githubusercontent.com/jseutter/ofxparse/master/tests/fixtures/investment_401k.ofx
>>>
>>> It should complain about 'FOO' not being found. This example has an 
>>> oddity where it also needs 'BAR' and 'BAZ'. These three are cusips you'll 
>>> need to add. Once you do, this is the expected error you should see 
>>> (because this is not a Vanguard file):
>>> AttributeError: 'InvestmentStatement' object has no attribute 
>>> 'available_cash'
>>>
>>> Are you able to get to that point?
>>>
>>> See inline for a couple more comments.
>>>
>>> On Friday, June 12, 2020 at 5:01:52 PM UTC-7, Joathan Goldman wrote:
>>>
 Hi,

 I'm not a software engineer so might be slow in figuring this out so I 
 appreciate all your help and creating this importer. I'm still not able to 
 figure out the issue. Here is what I'm doing:

 bean-extract jonathan.import ~/staging/OfxDownload.qfx > 
 ~/staging/OfxDownload.qfx.extract

 In that same local folder I have a file called "fund_info.py" that I 
 have edited with the funds and maps. If I delete that file that I get an 
 error that fund_info is missing. Here is my config file:

 JONATHANs-MacBook-Pro:beandata jonathan$ more jonathan.import

 #!/usr/bin/env python3

 """Import configuration."""


 import sys

 from os import path


 sys.path.insert(0, path.join(path.dirname(__file__)))


 from beancount_reds_importers import vanguard

 from fund_info import *


 # Setting this variable provides a list of importer instances.

 CONFIG = [


 # Investments

 # 
 --


 vanguard.Importer({

 'main_account'   : 'Assets:US:Investments:Vanguard:Brokerage',

 'account_number' : 'XXX',

 'transfer'   : 
 'Assets:Zero-Sum-Accounts:Transfers:Bank-Account',

 'dividends'  : 'Income:Taxable:Dividends:Brokerage',

 'cg' : 'Income:Taxable:Capital-Gains:Brokerage',

 'fees'   : 'Expenses:Brokerage-Fees:TradIRA',

 'rounding_error' : 'Equity:Rounding-Errors:Imports',

 'fund_info'   : fund_info,

 }),

 ]


 I tried modifying the the Vanguard importer...the __init__.py file with 
 the print command and this seemed to confirm that the mapper is not being 
 created.


 (
 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/beancount_reds_importers/vanguard/__init__.py)

>>>
>>>
>>> Can you copy/paste the output?
>>>
>>>  
>>>

 I don't see how it would pick up our fund_info.py in the example file 
 but I haven't looked fully at the code.

>>>
>>>
>>> From the from fund_info import * in jonathan.import.
>>>
>>>  
>>>

 Anyway, I'll keep investigating when I have some time but if you see 
 anything obvious I appreciate any help.


 thanks.

 On Sunday, June 7, 2020 at 5:40:44 AM UTC+12, Red S wrote:
>
> Also: are you importing the correct file with your maps? Or are you 
> importing the example file that ships with the package by accident?

 -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Beancount" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to bean...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/fe85b237-fa45-4505-ac5a-3a972d3680d1o%40googlegroups.com
>>  
>>