Skip to content
New issue

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

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

Already on GitHub? # to your account

Add Docker support and Missing rc file error handling #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CaseyLabs
Copy link

Hi @andrewscwei, thanks for creating this statement parser! It's just what I was looking for today for my own purposes.

I ran into a few small issues while setting up the repo, so I've created this Pull Request to make it a bit easier to setup the project on new machines.

Fixes:

  • If .rc does not exist in the repo, the following error message is displayed:
❯ python main.py ~/git/kc/statements/personal-cheque
Traceback (most recent call last):
  File "/home/user/sync/git/kc/statements/parser/main.py", line 94, in <module>
    main()
  File "/home/user/sync/git/kc/statements/parser/main.py", line 71, in main
    for tx in parse_pdf(file, config.get("categories"), config.get("excludes"))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/sync/git/kc/statements/parser/main.py", line 57, in parse_pdf
    return parse_chequing(file_path, categories, excludes)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/sync/git/kc/statements/parser/app/chequing.py", line 142, in parse_chequing
    tx["category"] = match_category(tx.get("description"), categories)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/sync/git/kc/statements/parser/app/utils.py", line 47, in match_category
    for category in lookup:
                    ^^^^^^
TypeError: 'NoneType' object is not iterable
  • I've added some error handling to main.py to use a simple default config if no .rc file is provided

  • I've added a Dockerfile to be able to build and run the parser without needing to modify a user's system

  • Updated the Readme to clarify the install process on a new machine

Thank you once again for creating this project!

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

Successfully merging this pull request may close these issues.

1 participant