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

Balances 0 #2

Open
smseidl opened this issue Jul 31, 2017 · 5 comments
Open

Balances 0 #2

smseidl opened this issue Jul 31, 2017 · 5 comments

Comments

@smseidl
Copy link

smseidl commented Jul 31, 2017

I just got the software to run after getting pynYNAB installed, but all my category balances in the email are 0. Any ideas?

@smseidl
Copy link
Author

smseidl commented Aug 1, 2017

I've been able to track down the issue a bit. The problem is that none of the entities_monthly_subcategory_budget_id are containing the current month. They are only containing the first few months that I started nYNAB, but the most recent 3 or 4 months.

if b.entities_monthly_subcategory_budget_id[4:11]==(datetime.datetime.now().strftime('%Y-%m')): - this is never true.

I'm thinking that this for loop is wrong, but haven't figured out the functions/collections available to use instead. for b in client.budget.be_monthly_subcategory_budget_calculations:

@jtsmith2
Copy link
Owner

jtsmith2 commented Aug 1, 2017

Hum, that's interesting.

The client.budget.be_monthly_subcategory_budget_calculations is a collection of all your budget calculations, broken up by year and month. IDs for those monthly calculations look like this:

mcb/2016-11/*GUID* so that if statement is only looking at the date part of that ID and matching it to the current date.

It looks like for some reason pynYNAB isn't returning all of your subcategories. Do you have your budget name set correctly in the settings file? If you had originally used the default 'My Budget' name and then renamed it later, maybe it would only pull from those original months?

You can try running the following script to see all of the subcategories you're getting back from pynYNAB to see when they are cutting off:

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')

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

print('Printing category IDs')

for b in client.budget.be_monthly_subcategory_budget_calculations:
        print(b.entities_monthly_subcategory_budget_id)

@smseidl
Copy link
Author

smseidl commented Aug 6, 2017

Attached you will find the output of the script you posted.

output.txt

@smseidl
Copy link
Author

smseidl commented Aug 6, 2017

Also, the setting files, I have the budget name set to exactly the same thing that shows in the nYNAB open budget screen. It may have been named something earlier, but I can't remember for sure.

@rienafairefr
Copy link

I cannot reproduce that problem with my own ynab account. All subcategories are returned for all months. I'll try to debug that with you in the other issue

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

3 participants