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

Add ability to import categories from CSV #1801

Closed
wants to merge 1 commit into from

Conversation

ScottFries
Copy link

Picking up from PR #82

Summary

  • Added category parsing to CSV imports to detect category and map to existing categories

Evidence

Recording 2023-10-15 221320

Notes

  • It is currently possible to enable this functionality with rules, however, one would need to be made for each category and another field would need to be used to hold category identifiers, such as Notes
  • Currently category IDs are not explicitly stated in the UI as far as I'm aware
  • A checkbox could be added to the Import Options section to toggle this functionality on and off, though this is functionality only works with existing category names and all other values are ignored; this could be easily changed to create unrecognized categories, like the Payee field

@netlify
Copy link

netlify bot commented Oct 16, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 509f595
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/652cce28f3b5380008e7c781
😎 Deploy Preview https://deploy-preview-1801.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
16 2.82 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/main.js 1.12 MB 0%
static/js/848.chunk.js 760.98 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/713.chunk.js 156.56 kB 0%
static/js/wide-components.chunk.js 126.84 kB 0%
static/js/231.chunk.js 117.37 kB 0%
static/js/narrow-components.chunk.js 43.06 kB 0%
static/js/reports.chunk.js 29.92 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/389.chunk.js 12.77 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 903 B 0%

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
2 2.22 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.23 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@ScottFries ScottFries force-pushed the master branch 2 times, most recently from 06956b6 to f732053 Compare October 16, 2023 05:36
@MatissJanis
Copy link
Member

👋 Looks very exciting! But there is a small bug: the categories import preview column is populated with categories that do not exist.

Demo import:
n26-csv-transactions.csv

Reproduction steps:

  1. open the import file in actual
  2. notice that "category" dropdown is correctly set to "Category" and the table also shows "Groceries"
  3. click "import 1 transaction"
  4. notice that the imported transaction is not categorized (this is as-expected because "Groceries" category does not exist in the demo budget)

Suggested change: if the category does not exist - do not show it in the transaction import preview table.

@ScottFries
Copy link
Author

👋 Looks very exciting! But there is a small bug: the categories import preview column is populated with categories that do not exist.

Demo import: n26-csv-transactions.csv

Reproduction steps:

  1. open the import file in actual
  2. notice that "category" dropdown is correctly set to "Category" and the table also shows "Groceries"
  3. click "import 1 transaction"
  4. notice that the imported transaction is not categorized (this is as-expected because "Groceries" category does not exist in the demo budget)

Suggested change: if the category does not exist - do not show it in the transaction import preview table.

Sorry for the delay getting back to this; it's still on my list of things to get back to!

That's definitely doable! I didn't want to jump to that approach though since it requires pulling and passing around the relevant data of what categories exist through more of the pipeline. If that's not a concern I'll get that change made when I get some time.

@youngcw
Copy link
Member

youngcw commented Nov 13, 2023

Would it be possible to add an option to create the missing categories? This alongside #1788 would, I think, make importing Mint csv files fully possible if the accounts get stored in the notes field or something.

@ScottFries
Copy link
Author

Would it be possible to add an option to create the missing categories? This alongside #1788 would, I think, make importing Mint csv files fully possible if the accounts get stored in the notes field or something.

I'd briefly considered this, but figured it was out of scope for this PR since it requires changing the dynamic of defining your budgets.
Personally I also think it'd make more since to have this functionality as an isolated "Import budgets" feature so that users don't accidentally create budgets they didn't expect to have suddenly been added to their Mint, bank, credit card, etc. exports.

@heyboots
Copy link

Hey just wanted to chime in to say this specific feature is what has been holding me back from migrating over to Actual so I super appreciate the work you're doin here Scott. Lookin forward to this getting merged in so I can pull my old register in from financier.io

@Kidglove57
Copy link

Just an aside but I was intrigued to see that YNAB cannot import categories!

@ScottFries
Copy link
Author

Hey just wanted to chime in to say this specific feature is what has been holding me back from migrating over to Actual so I super appreciate the work you're doin here Scott. Lookin forward to this getting merged in so I can pull my old register in from financier.io

Thanks for the appreciation! I know it's not ideal, but if you're eager to get moving like I was: this change is functional as is (it just has the small bug @MatissJanis pointed out), so you can build and run this version to do the import, then export the result and import it in to your regular Actual instance.

Copy link
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Dec 21, 2023
Copy link
Contributor

This PR was closed because it has been stalled for 5 days with no activity.

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

Successfully merging this pull request may close these issues.

5 participants