Closed hhamud closed 2 years ago
@hhamud It doesn't look like it comes from beancount-ethereum. Please check your importer list, some of its items are tuples:
[<importers.custom_importers.BinanceImporter object at 0x7f9267dc8850>, <importers.custom_importers.KrakenImporter object at 0x7f9267dc87f0>, <beancount.ingest.importers.csv.Importer object at 0x7f926790b520>, <beancount.ingest.importers.csv.Importer object at 0x7f926790ba60>, (<importers.custom_importers.ETHImporter object at 0x7f926790ba90>,), (<importers.custom_importers.ETHImporter object at 0x7f926790b9d0>,), (<importers.custom_importers.ETHImporter object at 0x7f926790b9a0>,)]
@hhamud It doesn't look like it comes from beancount-ethereum. Please check your importer list, some of its items are tuples:
[<importers.custom_importers.BinanceImporter object at 0x7f9267dc8850>, <importers.custom_importers.KrakenImporter object at 0x7f9267dc87f0>, <beancount.ingest.importers.csv.Importer object at 0x7f926790b520>, <beancount.ingest.importers.csv.Importer object at 0x7f926790ba60>, (<importers.custom_importers.ETHImporter object at 0x7f926790ba90>,), (<importers.custom_importers.ETHImporter object at 0x7f926790b9d0>,), (<importers.custom_importers.ETHImporter object at 0x7f926790b9a0>,)]
I had to go directly into the beancount package and print out what was being processed in the function find_imports
in identify.py
. Only the beancount-ethereum package importers are being coupled in a tuple and I don't really understand why?
I don't know. importers.custom_importers.ETHImporter
is not beancount-ethereum importer (unless you somehow wrap it). The python import path of the importer from beancount-ethereum package should look like beancount_ethereum.importer.Importer
.
I don't know.
importers.custom_importers.ETHImporter
is not beancount-ethereum importer (unless you somehow wrap it). The python import path of the importer from beancount-ethereum package should look likebeancount_ethereum.importer.Importer
.
Printed snippet from using the Importer class straight from the package:
[<importers.custom_importers.BinanceImporter object at 0x7fa4a0530700>, <importers.custom_importers.KrakenImporter object at 0x7fa4a05306d0>, <beancount.ingest.importers.csv.Importer object at 0x7fa4a00ae860>, <beancount.ingest.importers.csv.Importer object at 0x7fa4a00ae9b0>, (<beancount_ethereum.importer.Importer object at 0x7fa4a00ae9e0>,), (<beancount_ethereum.importer.Importer object at 0x7fa4a00ae920>,), (<beancount_ethereum.importer.Importer object at 0x7fa4a00ae8f0>,)]
I was having the same problems and what I did was I copied the importer into its own individual file to try and debug and I am still getting the same error.
How do you run bean-identify? Could you show your importer configuration file?
sure,
I run bean-identify via bash
bean-identify config.py data/
All data files are either json or csv. config.py file
import os
from beancount.ingest.importers.csv import Importer as CSVImporter, Col
from importers.custom_importers import BinanceImporter, KrakenImporter
from beancount_ethereum import Importer as ETHImporter
config_dir = os.path.join(os.path.dirname(__file__), 'chain_configs')
binance_importer = BinanceImporter(
'Income:Cash', # account
)
kraken_importer=KrakenImporter("Income:Cash", "Expenses:Fees:Kraken")
tide_importer = CSVImporter({
Col.DATE: 'Date',
Col.NARRATION1: 'Transaction description',
Col.ACCOUNT: 'From',
Col.PAYEE: 'To',
Col.AMOUNT: 'Amount',
},
'Assets:Cash', # account
'GBP', # currency
)
amazon_importer = CSVImporter({
Col.DATE: 'Order Date',
Col.NARRATION1: 'Title',
Col.ACCOUNT: 'Account Group',
Col.PAYEE: 'Seller Name',
Col.AMOUNT: 'Item Net Total',
},
'Expenses:Amazon', # account
'GBP', # currency
)
eth_importer = ETHImporter(config_path=os.path.join(config_dir, 'ethereum.json')),
gnosis_importer = ETHImporter(config_path=os.path.join(config_dir, 'gnosis.json')),
arb_importer = ETHImporter(config_path=os.path.join(config_dir, 'arbitrum.json')),
# beancount's scripts use this
CONFIG = [binance_importer, kraken_importer, tide_importer, amazon_importer, eth_importer, gnosis_importer, arb_importer]
Look at this part:
eth_importer = ETHImporter(config_path=os.path.join(config_dir, 'ethereum.json')),
gnosis_importer = ETHImporter(config_path=os.path.join(config_dir, 'gnosis.json')),
arb_importer = ETHImporter(config_path=os.path.join(config_dir, 'arbitrum.json')),
There's a comma at the end of each line. In Python x = y,
is the same as x = (y,)
that's why you've got tuples
The indentify function in the importer class cannot be called.
here is the traceback: