I do something similar when importing from Tiller. I run a ledger command to dump out all the Tiller IDs that are in my ledger and then parse that list into a set in my Ruby script. The script checks against the set when deciding whether to print a transaction or not.
The ledger command I use is here: https://github.com/peterkeen/ledger_tiller_export/blob/master/lib/ledger_tiller_export.rb#L132 You should just have to replace tiller_id with your tag and convert the parsing to python. Yours should be a little simpler because mine allows for multiple tiller ids per transaction fir silly reasons. Be aware that if you try to run that command in a shell you have to put single quotes around the format string and the query. —Pete On Wed, Jul 15, 2020 at 2:18 AM <[email protected]> wrote: > Hello, > > I started to use ledger recently for tracking finances and the primary > inputs > my ledger is my checking account and credit card statement. Using a > rudimentary > python script, I parse out these statements to populate the ledger. > > For credit card bill payment transactions, I have duplicate transactions > and I use > UUID metadata to drop of them. My script uses a UUID format of > <date>:<cc-bill> > while parsing the statement. > > See suggestion here from reddit Dealing with Duplicate Transactions > <https://www.reddit.com/r/plaintextaccounting/comments/c17kfc/dealing_with_duplicate_transactions_from/> > > I'd like to therefore double check at any time, I had same UUID used more > than > twice. Does ledger allow for reporting transactions based on UUID > filtering? > > Any other options to make sure UUIDs are not duplicate for more than one > pair > of transactions? > > An example of the transactions that I am talking about > > 2020/01/09 * BANK OF AMERICA CREDIT CARD Bill Payment >> ; bofacc >> ; UUID: 2020.01.09-cc-ma:bofa >> Liabilities:cc-ma:bofa $563.85 >> Assets:checking:bofa >> >> 2019/01/09 * PAYMENT - THANK YOU >> ; payment to CC >> ; UUID: 2020.01.09:cc-ma:bofa >> Liabilities:cc-ma:bofa $-$563.85 >> Assets:checking:bofa > > -- > > --- > You received this message because you are subscribed to the Google Groups > "Ledger" 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/ledger-cli/639d1c41-e35e-4475-a50c-0625064a127ao%40googlegroups.com > <https://groups.google.com/d/msgid/ledger-cli/639d1c41-e35e-4475-a50c-0625064a127ao%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- --- You received this message because you are subscribed to the Google Groups "Ledger" 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/ledger-cli/CAFxm1P%3D4bKp%3Dr9LrskD2Dpr25oJW5gL2%3DFvUzkCqHetqc6aDCA%40mail.gmail.com.
