rienafairefr / pynYNAB

a python client for the new YNAB
MIT License
138 stars 12 forks source link

pynYNAB.Entity.UnknowEntityFieldValueError Exception #19

Closed tovolkmar closed 7 years ago

tovolkmar commented 8 years ago

Hi,

i've tested to connect to ynab with the following code:

import configargparse

from pynYNAB.Client import clientfromargs
from pynYNAB.schema.budget import Payee, Transaction
from pynYNAB.scripts.config import get_logger, test_common_args
parser = configargparse.getArgumentParser('pynYNAB')
args = parser.parse_args()
args.email = "My Email"
args.password = "My Password"
args.budgetname = "My Budget"

client = clientfromargs(args)

When i run the script i get the following error:

Encountered field rolling_balance in a dictionary to create an entity of type <class 'pynYNAB.schema.budget.MonthlyAccountCalculation'>, value 500000 Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/pynYNAB-0.1-py3.5.egg/pynYNAB/Entity.py", line 74, in obj_from_dict field = obt.AllFields[key] KeyError: 'rolling_balance'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "Desktop/ynab.py", line 13, in client = clientfromargs(args) File "/usr/local/lib/python3.5/site-packages/pynYNAB-0.1-py3.5.egg/pynYNAB/Client.py", line 16, in clientfromargs client = nYnabClient(connection, budget_name=args.budgetname) File "/usr/local/lib/python3.5/site-packages/pynYNAB-0.1-py3.5.egg/pynYNAB/Client.py", line 43, in init self.sync() File "/usr/local/lib/python3.5/site-packages/pynYNAB-0.1-py3.5.egg/pynYNAB/Client.py", line 67, in sync self.budget.sync(self.connection, 'syncBudgetData') File "/usr/local/lib/python3.5/site-packages/pynYNAB-0.1-py3.5.egg/pynYNAB/roots.py", line 34, in sync obj = obj_from_dict(self.ListFields[name].type, entityDict) File "/usr/local/lib/python3.5/site-packages/pynYNAB-0.1-py3.5.egg/pynYNAB/Entity.py", line 78, in obj_from_dict raise UnknowEntityFieldValueError(msg) pynYNAB.Entity.UnknowEntityFieldValueError: Encountered field rolling_balance in a dictionary to create an entity of type <class 'pynYNAB.schema.budget.MonthlyAccountCalculation'>, value 500000

Do you have an Idea how i can fix that?

Thanks in advance

Tobias

rienafairefr commented 8 years ago

Hi, This is a typical problem of the pypy release, it's a bit behind, I should get a new release out there. In a few days prob. If you know how to do it, you can try installing from the master branch, that should be up to date and include the rolling_balance amount field ^^ Cheers and thanks for your feedback,

scottrobertson commented 8 years ago

https://github.com/rienafairefr/nYNABapi/pull/20

tovolkmar commented 7 years ago

Fixed with current version, but getting another error. I will create a new issue for that