Re: Seeking beta-testers/devs for crypto tax tools

2024-02-17 Thread Eric Altendorf
It's 2024, so, time to dust off Magicbeans and prepare 2023 taxes -- hope
folks don't mind me bumping this thread.  If anyone else is interested in
using Beancount to track crypto transactions, take a look below and if
you're willing to beta-test and help develop, feel free to reach out to me.

best,
eric

On Wed, Nov 1, 2023 at 3:49 AM Chary Chary  wrote:

> Ok,
>
> thanks for clarification
>
> On Tuesday, October 31, 2023 at 5:30:39 PM UTC+1 erical...@gmail.com
> wrote:
>
>> No worries.  I suspect that a lot of crypto traders/investors fall into
>> these categories:
>>
>> - Casual users who make minimal trades on one or two exchanges.  These
>> are probably adequately served by existing commercial offerings like
>> cointracker.io etc.
>> - Professional traders who already have some other professional
>> commercial trade recording/reporting software.
>>
>> For people in between, who are doing something more complex (multiple
>> exchanges, offline wallets, mining income, large numbers of transactions or
>> lots) but are not professional traders, I suspect that probably most tax
>> returns are full of errors that neither the filers nor the IRS are readily
>> able to untangle.  If the amounts are low, then it's not worth either of
>> their time.  If the amounts are large, I am not sure.  I talked to a tax
>> preparer, asking how one would verify the numbers, and he said that
>> probably you'd have to engage a mid-to-large accounting firm and hand them
>> your raw data -- not sure how they would analyze it.  He also said that
>> with the IRS it would probably be a bit hit and miss how an auditor would
>> handle or analyze it -- they probably wouldn't be reading one's Python
>> code, no :)
>>
>> My goal with Magicbeans was to generate PDF reports which lay out the
>> lots in both inventories and transactions such that one could actually
>> manually match everything up, even if it would be tedious.  The goal was to
>> be able to walk into an IRS office with that report and be able to justify
>> the cap gains/losses of any sale someone questions.
>>
>> On Thu, Oct 26, 2023 at 1:11 PM Chary Chary  wrote:
>>
>>> I know this is an offtopic, but I am just wondering: if it takes that
>>> much efforts plus python programming skills to file a tax return, then:
>>>
>>>
>>>- How do other people (mortals) do it?
>>>- How on the earth someone is able to verify it? One can't imagine a
>>>tax officer debugging a Python code?
>>>
>>>
>>> On Thursday, October 26, 2023 at 8:57:27 PM UTC+2 erical...@gmail.com
>>> wrote:
>>>
 I recently filed my 2022 tax return using Magicbeans
  to do detailed lot
 tracking and capital gains/losses reporting for my crypto assets.
 Magicbeans is a set of tools (importers and report generation tools) built
 around Beancount.  I wrote it because I was not satisfied with the accuracy
 or transparency of existing commercial services for crypto tax reporting.

 Although I was confident enough in the numbers to file my return, I am
 equally confident there's a lot of latent issues in the software.  I am
 looking for folks who (1) are interested in better tools for crypto
 transaction tracking, (2) are willing to beta-test and debug some rough
 software, and (3) are skilled enough devs (Python) to also contribute 
 fixes.

 Hope to hear from someone out there... :)

 --eric

>>> --
>>> 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+...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/beancount/bf16b50b-efe9-463a-a176-ce53960ef347n%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/075e009b-e7f6-4120-a602-21a8f3d2c431n%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/CAFXPr0tEQMVJesOnKevQow%2Bo9S7iyvOegrk9ki3h7PrRhHif1A%40mail.gmail.com.


Re: Using Custom directives from importer script

2024-02-17 Thread fin
Mason H wrote:
> Hello,
>
...
> (To prevent an XYZ problem) I have a small number of rental properties 
> which are run on a short term basis. I wanted to have a custom directive 
> define a 'stay' so I could keep some relevant metadata for transactions 
> (i.e. OTA platform, dates and length of stay, address of the property) , 
> but I don't want to reference this metadata multiple times when there are 
> multiple transactions involving a single stay. I was then hoping to link 
> '^' all the transactions involving a single stay with a unique code, 
> including this custom directive. I could do the same thing with the first 
> transaction for a stay, but when 9/10 times I only want to know the 
> property which a transaction was for, I don't want ten other metadata 
> fields showing up in fava when I don't want them.
>
...
> 1970-01-01 * "Vendor" "Narration"
>   Income:Example  10 USD
>   Assets:Example

  why not just use the overall Account Root (or a parent part
of a subaccount) as a holder for some of the metadata?  and
then you could do the occupancy flag as one of the values of
subaccount.  like:


1970-01-01 * "Fredder Building" ""
  address1: "101 Fredder St"
  address2: "City, State, Country"
  superphone: "(123) 567-9801"
  Assets:Building:Fredder  1
  Equity:Buildings -1
  Assets:Apartments:Fredder 12
  Equity:Apartments

1970-03-11 * "Apartment Rental" "Fredder, Apt 3"
  Assets:Fredder:Apt3 1
  Equity:Apartments

etc?


  fin

-- 
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/q6k7ak-hbc.ln1%40anthive.com.


Re: Using Custom directives from importer script

2024-02-17 Thread Daniele Nicolodi

On 16/02/24 22:51, Mason H wrote:

Hello,

I've recently been trying to write an importer script and was trying to 
use a Custom directive. There isn't a lot of documentation on this, and I haven't 
been able to figure out what the problem is from the source, and was 
wondering if anyone here had any ideas. I'm not sure if I'm using 
beancount.core.data.Custom wrong or if you're supposed to use a 
different object entirely.


Issue occurs when there is a beancount.core.data.Custom object in the 
list returned by the extract() function


[...]


ret.append(data.Custom(meta, date, "example", ["value1", "value2", "value3"]))


The fourth field in a beancount.core.data.Custom() object is a list of 
beancount.parser.grammar.ValueType() instances. ValueType() instances 
are initialized with a value and a data type (a Python class). 
Therefore, your code should read something like:


ret.append(data.Custom(
meta, date, "example", [
grammar.ValueType("value1", str),
grammar.ValueType("value2", str),
grammar.ValueType("value3", str),
])
)

An easy way to figure out this kind of things is to run the parser on 
the Beancount format representation of the directive you want to obtain:


from beancount.parser import parser
entries, errors, options = parser.parse_string(
'''2024-02-17 custom "example" "value1" "value2" "value3"'''
)
print(entries)

Cheers,
Dan

--
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/c1dd361c-3b5c-4f2a-8289-dc4692930899%40grinta.net.


Re: Setting up first Beancount file - should I separate LLC partnership and personal finances

2024-02-17 Thread Martin Blais
On Fri, Feb 16, 2024, 08:51 CDT  wrote:

> Hello,
>
> I'm setting up my first Beancount file and will start with 2024.
>
> Currently I have all of my ledgers in Gnucash but I will probably not
> export the existing items (yet).
>
> My wife and I have an LLC partnership for a property we rent and we have
> always kept that in our general Gnucash file that has all our personal
> items, but we are able to pull an income statement pretty easily from that
> file for accounting and tax purposes.
>
> My questions are:
>
> 1. Should I create two text files - one for the LLC and one for personal
> items?
>

Yes

2. If I don't create separate files and keep everything in one file, will I
> be able to easily pull out an income statement for just the LLC items like
> I can on Gnucash?
>

Use appropriate account names you can filter on and it should be fine



> Thanks in advance.
>
>
> --
> 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/70085993-bdc6-4960-9c63-8d5bf6aad7c2n%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%2BhNOnciyMswNEYPy7A1M0LJHVLTmHPG_pdD1j4H7Ty5kMg%40mail.gmail.com.


Using Custom directives from importer script

2024-02-17 Thread Mason H
Hello,

I've recently been trying to write an importer script and was trying to use 
a Custom 
 
directive. There isn't a lot of documentation on this, and I haven't been 
able to figure out what the problem is from the source, and was wondering 
if anyone here had any ideas. I'm not sure if I'm using 
beancount.core.data.Custom wrong or if you're supposed to use a different 
object entirely.

Issue occurs when there is a beancount.core.data.Custom object in the list 
returned by the extract() function of a subclass of 
beancount.ingest.importer.ImporterProtocol. This is being ran by the 
'bean-extract' command. The exception appears to be raised when printing 
the formatted beancount directives. I've written a test file which 
hopefully reproduces the issue on other machines below.

(To prevent an XYZ problem) I have a small number of rental properties 
which are run on a short term basis. I wanted to have a custom directive 
define a 'stay' so I could keep some relevant metadata for transactions 
(i.e. OTA platform, dates and length of stay, address of the property) , 
but I don't want to reference this metadata multiple times when there are 
multiple transactions involving a single stay. I was then hoping to link 
'^' all the transactions involving a single stay with a unique code, 
including this custom directive. I could do the same thing with the first 
transaction for a stay, but when 9/10 times I only want to know the 
property which a transaction was for, I don't want ten other metadata 
fields showing up in fava when I don't want them.

. . . At this point though I'm rather curious why I'm getting the 
exception, regardless of my use of the directive. 

Other notes:

   - I am running a python virtual environment for my beancount and fava 
   executables, plus the modules used for importers.
   - python version is 3.11.7. Binary is from Arch Linux repo.
   - I am running the beancount version pulled from pip; Beancount 2.3.6 
   (git:d77540c4; 2023-10-05)
   - (I'm unsure whether I should post this type of thing to github issues, 
   mostly because I don't know if I'm doing something wrong or if this is a 
   bug. Assuming I don't see an issue already I'm assuming I'm doing something 
   wrong, so I'm posting this here).
   - pdb identifies entry.values to be the last argument of the 
   beancount.core.data.Custom, which is a list of arbitrary values.


Other questions involving custom directive:

   - If I want to add links, tags to the directive, do I just append a str 
   starting with '^' and '#' respectively to the values list?

Below is output with the exception:

;; -*- mode: beancount -*-
 /home/mason/Documents/beancount/Test/test.txt

1970-01-01 * "Vendor" "Narration"
  Income:Example  10 USD
  Assets:Example

Traceback (most recent call last):
  File "/home/mason/.local/bin/bean-extract", line 8, in 
sys.exit(extract_main())
 ^^
  File 
"/home/mason/Documents/beancount/beancount-bin/lib/python3.11/site-packages/beancount/ingest/
scripts_utils.py", line 36, in extract_main
return trampoline_to_ingest(extract)
   ^
  File 
"/home/mason/Documents/beancount/beancount-bin/lib/python3.11/site-packages/beancount/ingest/
scripts_utils.py", line 198, in trampoline_to_ingest
return run_import_script_and_ingest(parser)
   
  File 
"/home/mason/Documents/beancount/beancount-bin/lib/python3.11/site-packages/beancount/ingest/
scripts_utils.py", line 246, in run_import_script_and_ingest
return ingest(importers_list)
   ^^
  File 
"/home/mason/Documents/beancount/beancount-bin/lib/python3.11/site-packages/beancount/ingest/
scripts_utils.py", line 140, in ingest
args.command(args, parser, importers_list, abs_downloads, hooks=hooks)
  File 
"/home/mason/Documents/beancount/beancount-bin/lib/python3.11/site-packages/beancount/ingest/
extract.py", line 243, in run
extract(importers_list, files_or_directories, sys.stdout,
  File 
"/home/mason/Documents/beancount/beancount-bin/lib/python3.11/site-packages/beancount/ingest/
extract.py", line 214, in extract
print_extracted_entries(new_entries, output)
  File 
"/home/mason/Documents/beancount/beancount-bin/lib/python3.11/site-packages/beancount/ingest/
extract.py", line 137, in print_extracted_entries
entry_string = printer.format_entry(entry)
   ^^^
  File 
"/home/mason/Documents/beancount/beancount-bin/lib/python3.11/site-packages/beancount/parser/
printer.py", line 374, in format_entry
return EntryPrinter(dcontext, render_weights, prefix=prefix)(entry)
   
  File 
"/home/mason/Documents/beancount/beancount-bin/lib/python3.11/site-packages/beancount/parser/
printer.py", line 124, in __call__
method(obj, oss)