Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformation map for payee names #404

Open
ThomDietrich opened this issue Nov 16, 2021 · 13 comments
Open

Transformation map for payee names #404

ThomDietrich opened this issue Nov 16, 2021 · 13 comments

Comments

@ThomDietrich
Copy link
Contributor

ThomDietrich commented Nov 16, 2021

Hey all, I am already a big fan of this script. Thanks.

One problem... let's call it nuisance... I came across is the fact that many of my recurring payees have names like "PAYPAL (EUROPE) S.A.R.L ET CIE,S.C.A." which I would like to rename. Is this a feature you would accept a Pull Request for? A decision I need your guidance with would certainly be where to provide this transformation list. Is a new section in user_configuration.conf okay with you or will it collide with the banks?

(Btw ever consider to transition the config files to yaml?)

@nocalla
Copy link
Member

nocalla commented Nov 16, 2021

Hi @ThomDietrich , this is something we discussed but it's actually a feature built into ynab already so it's not something we're going to implement. If you select "Manage Payees" when you're looking at the payee selection for a transaction (on the web app only I think), you can have rules for payee name processing.

@nocalla
Copy link
Member

nocalla commented Nov 16, 2021

What's the benefit of yaml over conf?

@ThomDietrich
Copy link
Contributor Author

ThomDietrich commented Nov 16, 2021

Yes! You are right, I didn't know the feature. I still wonder if I would prefer to do the transformation before the import in YNAB. The new payees clutter my selection list in YNAB, setting up those renames in YNAB takes a lot longer and it seems like those renames can not be applied after import, which is an issue. I propose to implement it and users can still use the YNAB function on top as the prefer?
Does that make sense?

Yaml: It's better scalable. In your conf format you only have two levels of structure (variables and categories). As you already use categories for banks it would actually be difficult to mix in the proposed transformation map. Yaml would be better suited (and is used be a majority of new projects for good reason)

@nocalla
Copy link
Member

nocalla commented Nov 16, 2021

Interesting. I started a bit of a project restructure last night, so I'll look into that. If you're going to implement this feature, I would have the transformation map in a separate file - maybe user_payee_transforms.conf or something similar.

@ThomDietrich
Copy link
Contributor Author

ThomDietrich commented Nov 16, 2021

Btw I am a fond user of https://www.dynaconf.com/ (with yaml)
Don't get me wrong, I don't think you have to switch but it would certainly be a nice improvement from my humble point of view ;)

I started a bit of a project restructure last night

I will work on a PR this evening. Please let me know if you plan major restructuring

@nocalla
Copy link
Member

nocalla commented Nov 16, 2021

It won't be major (I don't think). I'm switching the CSV input and output to rely on Pandas instead of our home rolled iterative approach. I also want to handle the API error responses a bit better. I may then also split up the files a bit for ease of maintenance.

@ThomDietrich
Copy link
Contributor Author

Sounds great.
Just to confirm... I will follow your preference here: Shall I give a dynaconf example with the PR for the transformation map? Either you like it or we drop it for conf.

@nocalla
Copy link
Member

nocalla commented Nov 16, 2021 via email

@ThomDietrich
Copy link
Contributor Author

ThomDietrich commented Nov 16, 2021

I looked into this. I can hardly solve this in a clean way.
The existing config is tightly tailored to bank config data. If I wanted to introduce a new file, I would need to duplicate quite a few steps, add it as another parameter of B2YBank etc. This doesn't feel meaningful. Alternative would be to load the file inside Bank2Ynab which is anything but clean.

Edit: found an acceptable solution.

@nocalla
Copy link
Member

nocalla commented Nov 29, 2021

It won't be major (I don't think). I'm switching the CSV input and output to rely on Pandas instead of our home rolled iterative approach. I also want to handle the API error responses a bit better. I may then also split up the files a bit for ease of maintenance.

The project restructure ended up being pretty major. If you point your pull request at the branch #401 it might be better! Very much still a work in progress.

@nocalla
Copy link
Member

nocalla commented Jan 7, 2022

I closed #405 because of the scope of the refactor in #406, but it should be a bit easier to integrate the payee mapping functionality now.

@ThomDietrich
Copy link
Contributor Author

Hey,
what's the current state with this? After the apparent changes in #406 any hints what to do here? The method as I implemented it worked quite well. Would you like to receive another PR or could you implement this yourself?

@nocalla
Copy link
Member

nocalla commented Aug 13, 2022

I don't currently have much time to put into this project, but I'd happily accept another PR. I promise I won't refactor everything this time!

I would suggest adding a "transform_payees" function in dataframe_handler.py and calling it in the parse_data function. The function for loading the mapping file can be managed by config_handler.py and called in bank_handler.py, passing "payee_mapping" (as a dictionary, I assume?) as a variable into the dataframe handler, similar to how the various config parameters are currently passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants