aldanor / pynab Goto Github PK
View Code? Open in Web Editor NEWA minimalistic library designed to provide native access to YNAB data from Python
License: Other
A minimalistic library designed to provide native access to YNAB data from Python
License: Other
I realise this is an artefact of the way the data is structured but it would be good to have a note in the docs to make people aware of this. IMHO it would be even nicer if when iterating over transactions in a category (or even always) the sub-transactions relevant to said category also appeared in the list just as any other normal transaction.
>>> t = budget.transactions.filter('date', date(2014, 10, 28))[-2]
>>> # t in this case is a transaction with sub transactions (in my budget file)
>>> # t is not in any of the transactions when iterating by category
>>> print any([t in c.transactions for c in budget.categories])
False
>>> print t.category
None
>>> print len(t.sub_transactions)
7
The new YNAB (aka YNAB 5, release imminent) is going to be web-based, with all the data hosted on their servers. Do you have any idea whether this will work with nYNAB?
£ sign in category names is causing an error in category handling.
Removing the £ sign from category names is a workaround.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/ynab/models.py", line 326, in __str__
return str(self._elements)
File "/usr/lib64/python2.7/site-packages/ynab/models.py", line 248, in __repr__
info += ' ({})'.format(self.category.name)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 16: ordinal not in range(128)
The line of credit account type is mis-capitalized in the AccountType class. Here's a fix:
diff --git a/ynab/models.py b/ynab/models.py
index 6013a3e..9ab79b0 100644
--- a/ynab/models.py
+++ b/ynab/models.py
@@ -17,7 +17,7 @@ class AccountType(Enum):
SAVINGS = 'Savings'
CREDIT_CARD = 'CreditCard'
CASH = 'Cash'
- LINE_OF_CREDIT = 'LineOfCredit'
+ LINE_OF_CREDIT = 'LineofCredit'
PAYPAL = 'Paypal'
MERCHANT_ACCOUNT = 'MerchantAccount'
INVESTMENT_ACCOUNT = 'InvestmentAccount'
Hello,
This project looks great - I am trying to get the remaining $ from a category. Is that possible?
Thank you
Hi, didn't think it was worth branching just for this. Very quick patch for another bit of functionality, just made it by poking around. See what you think. The methods of Transaction work too. Thanks
diff --git a/ynab/models.py b/ynab/models.py
index 1e0b3b4..4f9bf53 100644
--- a/ynab/models.py
+++ b/ynab/models.py
@@ -182,6 +182,10 @@ class Category(CategoryModel):
def full_name(self):
return '{}/{}'.format(self.master_category.name, self.name)
+ @property
+ def transactions(self):
+ return self._ynab.transactions.filter('category', self)
+
class MasterCategory(CategoryModel):
_entity_type = schema.MasterCategory
In models.py, in transactions.between line 450 produces an error: 'Transaction' object has no attribute 'end'. Should that say t.date?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.