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

pynYNAB isn't returning all subcategories?? #53

Open
smseidl opened this issue Aug 14, 2017 · 6 comments
Open

pynYNAB isn't returning all subcategories?? #53

smseidl opened this issue Aug 14, 2017 · 6 comments

Comments

@smseidl
Copy link

smseidl commented Aug 14, 2017

I'm trying to use the ynab-email script (https://github.com/jtsmith2/ynab-email) that is written on top of pynYNAB to send an email of category balances each day, but the script keeps sending out 0's for all the current balances. I've openned an issue with them, and they responding "It looks like for some reason pynYNAB isn't returning all of your subcategories."

Can you please review the issue over there (jtsmith2/ynab-email#2) and see if you feel this is an issue with pynYNAB, or their script?

I've attempted adding in some debug lines, and it seems like pynYNAB isn't returning the current month's subcategories, but I haven't spent much time understanding the options of pynYNAB to confirm.

@rienafairefr
Copy link
Owner

OK, cannot reproduce, we have to see what happens for your situation:

Next step would be digging in the JSON data that is received by pynYNAB before it's treated and incorporated in the collection client.budget.be_monthly_subcategory_budget_calculations and other collections.

checkout out latest 24c230b commit
Run this script adapted from the one in the ynab-email issue :

import logging
from pynYNAB.Client import nYnabClient
from pynYNAB.connection import nYnabConnection

ynabUser = #TYPE YOUR USERNAME HERE
ynabPassword = #TYPE YOUR PASSWORD HERE
ynabBudgetName = #TYPE YOUR BUDGET NAME HERE, MIGHT NOT BE 'My Budget' 

print('Getting YNAB info')

LOG = logging.getLogger('pynYNAB.connection')
LOG.setLevel(logging.DEBUG)

connection = nYnabConnection(ynabUser, ynabPassword)
connection.init_session()
client = nYnabClient(nynabconnection=connection, budgetname=ynabBudgetName)

The script should spit out massive amount of data, some of it is sensitive, don't post it. I just need lines containing the string mcb/, to see if they contain the recent months

@smseidl
Copy link
Author

smseidl commented Aug 22, 2017

Struggling with getting the new commit. Tried pip and setup.py and both are giving this error:

Conversion of long_description from markdown to reStructuredText failed, skipping.

Also, with the setup.py, I also get this error at the end:

Running ruamel.yaml-0.15.32/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0ZHj74/ruamel.yaml-0.15.32/egg-dist-tmp-ptErjF
sys.argv ['/tmp/easy_install-0ZHj74/ruamel.yaml-0.15.32/setup.py', '-q', 'bdist_egg', '--dist-dir', '/tmp/easy_install-0ZHj74/ruamel.yaml-0.15.32/egg-dist-tmp-ptErjF']
error: Setup script exited with error in ruamel.yaml setup command: Invalid environment marker: platform_python_implementation=="CPython" and python_version<="2.7"

@smseidl
Copy link
Author

smseidl commented Aug 22, 2017

Got installed by removing what I had and using multiple pip commands for dependencies and the setup.py. But I'm getting 0 useful output:

scott@raspberrypi-pihole:~/ynab-email $ python debug.py
Getting YNAB info
No handlers could be found for logger "pynYNAB.connection"

scott@raspberrypi-pihole:~/ynab-email $ cat debug.py
import logging
from pynYNAB.Client import nYnabClient
from pynYNAB.connection import nYnabConnection

ynabUser = '##################'
ynabPassword = '#####################'
ynabBudgetName = '##############'

print('Getting YNAB info')

LOG = logging.getLogger('pynYNAB.connection')
LOG.setLevel(logging.DEBUG)

connection = nYnabConnection(ynabUser, ynabPassword)
connection.init_session()
client = nYnabClient(nynabconnection=connection, budgetname=ynabBudgetName)

@rienafairefr
Copy link
Owner

rienafairefr commented Aug 22, 2017

Sorry, you need to add a logging.basicConfig() (doc here) line to add basic streamhandler to the logging facility before the logging works. Add it anywhere in the script, before the client = ... line

@smseidl
Copy link
Author

smseidl commented Aug 27, 2017

Please find the attached file for all lines matching "mcb/"
mcb.txt

@rienafairefr
Copy link
Owner

rienafairefr commented Aug 27, 2017 via email

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

No branches or pull requests

2 participants