none
Idea for PocketSense scrubber elements (Scrublets) RRS feed

  • Question

  • I am thinking of writing PocketSense scrubber element, to be called within scrubbers:

    Behavior: If there is a <NAME> in a credit card transaction, consult a list of RegEx. With the first match, if any, replace the <NAME> field with the corresponding entry. Then create a <Memo> with the original Name content if there was no Memo already. If there was a <MEMO>, concatenate to the content up to a 255 character max.

    Thus
    THE HOME DEPOT #2036 JOHNSTOWN
    THE HOME DEPOT #3917 SMITHVILLE
    THE HOME DEPOT 130
    THE HOME DEPOT 2036 JOHNSTOWN
    THE HOME DEPOT 3917 SMITHVILLE

    etc could all become "THE HOME DEPOT" or "HOME DEPOT", as you wish. The store info could be put into a <MEMO>

    This would only affect new transactions, but you could consolidate in Money.

    I am thinking that defining the interface first would be best. Something along these lines:
    1. There would be a file (working name ps_scrublets.py or some such). There would be initially a function defined there called maybe PS_payee_meld(ofx) which returns the modified ofx file.
    2. User modifies ps_scrublets.py with the appropriate data with method according to agreed plan.
    3. In the scrubber.py, the user inserts the appropriate include(ps_scrublets).
    4. At the appropriate spot in scrubber.py, the user adds this line with appropriate indent:
    ofx=PS_payee_meld(ofx) #merge payees

    I currently use a function called remove_unwanted_OFX_transactions. In my scrubber routine, I have these lines at appropriate places:
    from  x_trans  import remove_unwanted_OFX_transactions
    ofx = remove_unwanted_OFX_transactions(ofx) #from x_trans.py

    I wrote that for my own use, and it is not made to be universal. The table is hard-coded into the file as a constant structure (tuple), rather than using a separate data translation+configuration file. I am not sure which way would be better for other users. Everything in one *.py file has its advantages. Having the Python file unchanged by users allows things like md5 or sha1 checks of the file. So just throwing this out as food for thought.

    I mention my x_trans function here mainly as a something that works for me, and can explain the idea of the scrublet. If this scrublet things happened and used by more than two people, I may also put my x_trans function into ps_scrublets.py, at least if there would be a second person who might use it. That was the reason for the proposed ps_scrublets filename -- to facilitate further user-generated but specialized scrubber enhancements. If you don't invoke the x_trans() function, its presence would have no effect.

    So, at this point, looking for suggestions on the plan/spec to work to. Note this Payee melding is probably going to be of limited interest, but will have more interest than the x_trans function

    Feel free to comment and/or indicate that you think you might find this useful to you.

    If Robert were to incorporate this right into PocketSense, or incorporate hooks, that would be welcome.



    Monday, October 21, 2019 8:31 PM
    Moderator