项目作者: Nimaebrazeh

项目描述 :
Bestoon python client.
高级语言: Python
项目地址: git://github.com/Nimaebrazeh/bestoon-python-client.git
创建时间: 2019-03-05T19:55:32Z
项目社区:https://github.com/Nimaebrazeh/bestoon-python-client

开源协议:MIT License

下载


Bestoon python client

A simple python client for Bestoon Project

How to run

  1. Install python in your system.
  2. Clone the project using: git clone https://github.com/Nimaebrazeh/bestoon-python-client.
  3. Install requirements package using pip install -r requirements.txt

Usage

You can set your API token key first with instance of client:

  1. bestoon = Bestoon(YOUR-TOKEN) # make an Bestoon object and set API token to YOUR-TOKEN

If you forgot API token key, use login() method instead of above way (This method returns your API token):

  1. bestoon = Bestoon() # make an Bestoon object
  2. bestoon.login(YOUR-USERNAME, YOUR-PASSWORD) # return API token
  3. bestoon.set_token(YOUR-TOKEN) # set API token to YOUR-TOKEN

Set expense

Set your expense with amount and text in arguments

  1. bestoon.set_expense('30000', 'Test')

Set income

Set your income with amount and text in arguments

  1. bestoon.set_income('50000', 'Test')

Get expenses

Get your expenses with number(optional) in arguments

  1. bestoon.get_expenses() # return all expenses as json format
  2. bestoon.get_expenses(5) # return last 5 expenses as json format

Get incomes

Get your incomes with number(optional) in arguments

  1. bestoon.get_incomes() # return all incomes as json format
  2. bestoon.get_incomes(5) # return last 5 incomes as json format

Get general status

You can manage your general status of expenses and incomes.

  1. bestoon.get_general_status() # return amount count and amount sum of all incomes and expenses

TODO

  • add fromdate and todate arguments to get_general_status() method
  • export data to csv
  • export data to chart

License

The MIT License (MIT). Please see License File for more information.