.
项目描述
懒惰的财务(lbud 为“懒惰的预算”)
lbud旨在帮助构建一个简单的、数据驱动的个人使用预算解决方案。
有关数据示例,请参阅example-data/。
设置
python3.9 -m pip install lazy-budget
工作流程
lbud以一种非常具体的方式工作:你声明
- 预算期间(开始和结束日期)
- 你有多少钱(截至预算期的第一天),
- 您想节省多少(截至预算期的最后一天),
- 您的财务运作。
提供上述数据后,lbud您可以查看一段时间内的某些统计数据,回答以下问题:
- 我今天实际上还能花多少钱?
- 我平均每天花多少钱?
- 当我花太多钱时,我应该将支出限制在多少天才能保留我打算保留的钱?
要开始使用lbud来管理您的预算,您需要创建并维护至少 2 个文本文件。
预算文件
budget.yml是描述单个预算周期的 YAML 文件。建议保持较短的时间,但我确信lbud可以处理很长的预算。例子:
# total amount of money to use
total: 2000
# the part of the total
# that you aim to keep this month
keep: 1500
# budgeting period
start: 2021-04-25
end: 2021-05-10
# currency is optional
# USD is the default and
# the operations themselves can
# specify the currency (lbud add "-10 CAD" taxi), as well
# as the config file and CLI options
currency: USD
历史文件
history.csv是一个 CSV 文件,其中列出了您的所有财务操作。您的所有预算可能只有一个历史记录文件,在执行计算时,历史记录会按预算期过滤。它必须具有以下列:
money_value- 运营价值;可能包括多货币设置中的货币,格式:-10.99 CAD;description- 操作说明;可能包括类别、格式:[category] description;dttm- 操作日期和时间,ISO 格式。
例子:
-10,[food] snacks,2021-04-26T00:00:00
-1.95,[food] bubblegum,2021-04-27T17:20:31
-9.95,[food] hot dog,2021-04-27T00:00:00
-3.33,donation,2021-04-28T00:00:00
-30,[medicine] cardiologist,2021-04-29T00:00:00
使用lbud示例文件
$ lbud ls
today : 2021-05-01
total days : 16
days left : 9
available / day : $31.25
CAN spend today : $163.52
spent today : $0.00
avg spent / day : $7.89
kept : $1,663.52
$ lbud add -200 "club night"
$ cat history.csv # added operation to history file
-10,[food] snacks,2021-04-26T00:00:00
-1.95,[food] bubblegum,2021-04-27T17:20:31
-9.95,[food] hot dog,2021-04-27T00:00:00
-3.33,donation,2021-04-28T00:00:00
-30,[medicine] cardiologist,2021-04-29T00:00:00
-200,club night,2021-05-01T00:00:00
$ lbud ls
today : 2021-05-01
total days : 16
days left : 9
days until can spend : 2
available / day : $31.25
CANNOT spend today : $36.48
spent today : $200.00
avg spent / day : $36.46
kept : $1,463.52
$ lbud cats
medicine : -30,00 USD
food : -21,90 USD
<no category> : -3,33 USD
图表
燃尽图
提供预算如何进行的鸟瞰图。
$ lbud bd
类别图表
允许确定哪个类别花费/赚了多少钱。
$ lbud catc
命令行帮助
注意:所有默认值都可以从~/.lbudrc.yml. 要覆盖该位置,请指定LBUDRC环境变量。
usage: main.py [-h] [-f HISTORY_FILE] [-c BUDGET_FILE] [-L LOCALE] [-C CURRENCY] [-t TODAY] {add,a,new,n,list-stats,ls,now,today,list,stats,s,get,burndown,bd,categories,cats,category-chart,catsc,catc,cat-chart} ...
positional arguments:
{add,a,new,n,list-stats,ls,now,today,list,stats,s,get,burndown,bd,categories,cats,category-chart,catsc,catc,cat-chart}
budget operation to perform
add (a, new, n) add a new financial operation
list-stats (ls, now, today, list, stats, s, get)
list statistics
burndown (bd) shows a burndown chart of the budget
categories (cats) display money flow by category
category-chart (catsc, catc, cat-chart)
display money flow by category in a chart
optional arguments:
-h, --help show this help message and exit
-f HISTORY_FILE, --history-file HISTORY_FILE
history file to use (default is /Users/oleksandr/finance/history.csv)
-c BUDGET_FILE, --budget-file BUDGET_FILE
budget file to use (default is /Users/oleksandr/finance/budget.yml)
-L LOCALE, --locale LOCALE
locale to use (default is pl_PL)
-C CURRENCY, --currency CURRENCY
default currency to use in uncertain situations (default is PLN)
-t TODAY, --today TODAY
a date used as "today" during stats, useful for seeing old budget info
奇怪的配置
有很多配置选项lbud
(CLI 参数、配置文件、默认值),并且由于它已经过测试并以非常特定的方式使用,因此它可能不适合您。
随意提交票证或拉取请求(idk,如果它有效,我是这个开源事物的新手,请张贴关于它的票证)。
为了清楚起见,发布它正在积极使用的方式:
- 预算/历史文件在
~/finances/ - 配置文件位于
~/.lbudrc.yml:history_file: /Users/oleksandr/finances/history.csv budget_file: /Users/oleksandr/finances/budget.yml locale: pl_PL currency: PLN lbud任何地方
项目详情
关
lazy_budget -0.16.8-py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 9f768ef98cdfe24a71b456d3eb0000cd896d931a095097db7788664a39610350 |
|
| MD5 | d208d198837d72ad5db2956bb488ef97 |
|
| 布莱克2-256 | 5adcb7b5c255bbe6e59696207a9740308d4659cf826c3227708991e1dc592cad |