Chris Bond wrote:
> ------=_Part_10662_427767134.1701975257612
> Content-Type: multipart/alternative;
> boundary="----=_Part_10663_1945899272.1701975257612"
>
> ------=_Part_10663_1945899272.1701975257612
> Content-Type: text/plain; charset="UTF-8"
>
> I have what I think may be a very simple CSV file:
>
> Column headers are these:
> Date,Description,Amount,Unapplied,Balance
>
> Corresponding data fields look like this:
> Dec 1, 2023,PAYMENT,$951.28,$951.28,$25,000.62
you have a comma in the first field, you don't want to use
dates with commas in them if you are using csv format.
sorry i don't have the time to look into this further but
i noticed this and thought it worth a comment. :)
good luck,
keep on trying, i learned a lot by doing a lot of
experiments and writing my own importers.
> I have had some success using Red's ofx importer framework, but am really
> struggling to figure out the CSV importer from the examples in the git
> repo. I started with the Discover example that looks like this:
>
> from beancount_reds_importers.libreader import csvreader
> from beancount_reds_importers.libtransactionbuilder import banking
>
> class Importer(csvreader.Importer, banking.Importer):
> IMPORTER_NAME = """ Discover credit card .csv importer."""
>
> def custom_init(self):
> self.max_rounding_error = 0.04
> self.filename_pattern_def = 'Discover.*'
> self.header_identifier = 'Trans. Date,Post
> Date,Description,Amount,Category'
> self.date_format = '%m/%d/%Y'
> self.header_map = {
> "Category": 'payee',
> "Description": 'memo',
> "Trans. Date": 'date',
> "Post Date": 'postDate',
> "Amount": 'amount',
> }
>
> def skip_transaction(self, ot):
> return False
>
> def prepare_processed_table(self, rdr):
> # Need to invert numbers supplied by Discover
> rdr = rdr.convert('amount', lambda x: -1 * x)
> return rdr
>
> I'm pretty sure I don't need the def skip_transaction(self, ot) and def
> prepare_processed_table(self, rdr): bits, but am at a loss to figure out
> what fields I need to modify in the def custom_init(self) for my situation.
> There is not an example CSV file for that importer in the repo so it makes
> it a little more challenging for me to hack on it. I think I don't need the
> "Unapplied" column but am not sure. Even just some hints would be really
> helpful.
>
> Thank you in advance!
> Chris
>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/32vc4k-hk9.ln1%40anthive.com.