Skip to main content

用于访问 YNAB v1 API 的 Python API

项目描述

pynab 客户端

用于与 You Need a Budget (YNAB) v1 API 交互的 Python API 模块

仅在 python >3.6 上运行 .....#sorrynotsorry

安装

简单的方法

pip install pynab-client

不太容易的方法

git clone https://github.com/irunasroot/pynab-client.git
cd pynab-client
python setup.py install

用法

from pynabapi import YnabClient

client = YnabClient("my-api-token")

my_budgets = client.get_budget()

API

YnabClient.get_budget()

The mother load. By default you'll get a summary list of all Budgets you have on your account. If you're looking
for a single budget you can specify the budget_id or by default it will pull data for the last opened budget.

:param summary: Set summary to False if you want an entire payload of a single budget
    :default: True
:param budget_id: The budget id of the budget you want to view data from.
    :default: last-used which is your last opened budget.
:return: Returns Budgets object as a list of Budget objects or a single Budget object

YnabClient.get_account()

:param account_id: Provide account_id to retrieve a single known account.  
    :default: None
:param budget_id: The budget id of the budget you want to view data from.  
    :default: last-used which is your last opened budget.  
:return: Returns Accounts object as a list of Account objects or a single Account object  

YnabClient.get_budgetmonth()

Get budget month or months. If specifying the month then a list of categories are also provided.

:param month: Provide month to retrieve a single known month.
    :default: None
:param budget_id: The budget id of the budget you want to view data from.
    :default: last-used which is your last opened budget.
:return: Returns BudgetMonths object as a list of BudgetMonth objects or a single BudgetMonth object

YnabClient.get_category()

Get budget category or categories. If specifying the month then you also need to specify a category_id

:param category_id: The category ID of the specific category you want to retrieve
    :default: None
:param month: The month of the category you want to retrieve format: yyyy-MM-dd
    :default: None
:param budget_id: The budget id of the budget you want to view data from.
    :default: last-used which is your last opened budget.
:return: Returns BudgetCategories object as a list of BudgetCategory objects or a single BudgetCategory object

YnabClient.get_payee()

Get budget payee or payees.

:param payee_id: Provide payee_id to retrieve a single known payee.
:param budget_id: The budget id of the budget you want to view data from.
    :default: last-used which is your last opened budget.
:return: Returns Payees object as a list of Payee objects or a single Payee object

YnabClient.get_transaction()

Get budget transaction or transactions.

:param transaction_id: Provide transaction_id to retrieve a single known transaction.
    :default: None
:param budget_id: The budget id of the budget you want to view data from.
    :default: last-used which is your last opened budget.
:return: Returns Transactions object as a list of Transaction objects or a single Transaction object

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

pynab-client-0.2.tar.gz (6.8 kB 查看哈希

已上传 source

内置分布

pynab_client-0.2-py3-none-any.whl (22.7 kB 查看哈希

已上传 py3