mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-01-15 05:33:26 +01:00
Cannot import transactions with comma as amount separator #53
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Rdlgrmpf on GitHub (Aug 14, 2025).
It seems that the import of a csv with amounts like "-2,29" fails.
[2025-08-14 21:13:26] - ERROR - apps.import_app.services.v1 - Fatal error processing row 3
Traceback (most recent call last):
File "/usr/src/app/apps/import_app/services/v1.py", line 623, in _process_row
File "/usr/src/app/apps/import_app/services/v1.py", line 592, in _map_row
File "/usr/src/app/apps/import_app/services/v1.py", line 483, in _coerce_type
File "/usr/src/app/apps/import_app/services/v1.py", line 503, in _coerce_single_type
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]
@eitchtee commented on GitHub (Aug 14, 2025):
You might need to use a transformation for this, replacing the comma with a dot, e.g.:
If you csv also has a dot as a thousand separator, remove the dot then replace the comma with a dot (1.234,40):
Let me know if this fixes your issue.
@Rdlgrmpf commented on GitHub (Aug 14, 2025):
That worked! Thank you very much and also for the lightning fast reply. Next I will have a look into the rules. So far your tool looks really nice :)
@eitchtee commented on GitHub (Aug 14, 2025):
Thank you, hope you like it. Feel free to create new issues or discussions if you have any problem or suggestions.
About rules, by design they can get really complex as you're running python in a very limited environment, I always recommend taking a look at https://github.com/eitchtee/WYGIWYH/discussions/230#discussioncomment-12795562 as it shows how to push the system farther than most other applications would allow.
@avier99 commented on GitHub (Nov 27, 2025):
@eitchtee I am having major trouble in importing, i constantly get an error that "amount" field is required, where i do have it!!
here is my yaml and csv
CSV :
And my YAML :
@eitchtee commented on GitHub (Nov 28, 2025):
@avier99 try removing the comma thousand-separator from your value using a transformation:
Let me know if it works.
@avier99 commented on GitHub (Nov 28, 2025):
i guess progress however :
also why does it check 3 rows and not 4?
@eitchtee commented on GitHub (Nov 28, 2025):
Ohh, I didn't catch this earlier, remove the
skip_lines: 1configuration fromsettings. This is meant to be used when your csv has something at the top that isn't a header, like:You were skipping the header and the engine was getting confused, trying to use
8/22/2023,Dad,"300,000.00",Fees,DBS Bankas the column names (source), which is why it stops after 3 rows.Also, you'll need to change the format on the date and reference_date, use
"%m/%d/%Y"instead of what's there. Click here for available format options.@avier99 commented on GitHub (Nov 28, 2025):
ohh it did work
thanks a ton
@avier99 commented on GitHub (Nov 28, 2025):
also on another note
for the yaml on
typeandis_paidi tried detection method with sign and even using always_income ; it defaults goes to expense for some reason!!
@eitchtee commented on GitHub (Nov 28, 2025):
For "sign" to work you need to set a source (usually the same as amount), if the value starts with "-" it will be considered an expense, otherwise Income.
Now, for always_income and always_expense, it shouldn't require a source, but it seems like it does require one to work. If you could create a new issue about this, please.
In short, add a source to type, even if it is always_*. This also extends to is_paid.
@avier99 commented on GitHub (Nov 28, 2025):
Another stupid scenario :
how would i achieve importing bulk transfers?
i have 2 specific types : one with same currency; and one with different currencies.
i am guessing the diff currencies can we mixed with exchange rates?
another question was related to Investments - do you have a specific way for handling investment accounts, maybe multiple sub portfolios within, but and sell of assets in the portfolio, etc?
@eitchtee commented on GitHub (Nov 28, 2025):
@avier99 I've moved this discussion to #414 to avoid further hijacking this issue, let's keep talking there.