coder-firefly-cli 1.1.0__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/PKG-INFO +1 -1
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/setup.py +1 -1
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/accounts.py +13 -3
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/transactions.py +9 -6
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/PKG-INFO +1 -1
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/README.md +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/setup.cfg +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/__init__.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/api_client.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/cli.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/__init__.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/bills.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/budgets.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/categories.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/info.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/insights.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/piggy_banks.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/search.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/tags.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/SOURCES.txt +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/dependency_links.txt +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/entry_points.txt +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/requires.txt +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/top_level.txt +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/__init__.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/accounts.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/bills.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/budgets.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/categories.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/info.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/insights.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/piggy_banks.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/search.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/tags.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/commands/transactions.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/tests/test_api_client.py +0 -0
- {coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/tests/test_commands.py +0 -0
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="coder-firefly-cli",
|
|
5
|
-
version="1.1.
|
|
5
|
+
version="1.1.2",
|
|
6
6
|
description="Firefly III CLI - 个人财务管理命令行工具",
|
|
7
7
|
long_description=open("README.md", encoding="utf-8").read(),
|
|
8
8
|
long_description_content_type="text/markdown",
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/accounts.py
RENAMED
|
@@ -47,22 +47,32 @@ def accounts_get(id):
|
|
|
47
47
|
help="账户类型")
|
|
48
48
|
@click.option("--currency-code", default="USD", help="货币代码 (ISO 4217)")
|
|
49
49
|
@click.option("--opening-balance", default="0", help="初始余额")
|
|
50
|
+
@click.option("--opening-balance-date", help="开户日期 (YYYY-MM-DD),当 --opening-balance 非 0 时必填")
|
|
50
51
|
@click.option("--account-role", help="账户角色 (用于资产账户)")
|
|
51
52
|
@click.option("--iban", help="IBAN")
|
|
52
53
|
@click.option("--bic", help="BIC")
|
|
53
54
|
@click.option("--account-number", help="账户号码")
|
|
54
55
|
@click.option("--notes", help="备注")
|
|
55
|
-
def accounts_create(name, type, currency_code, opening_balance, account_role, iban, bic, account_number, notes):
|
|
56
|
+
def accounts_create(name, type, currency_code, opening_balance, opening_balance_date, account_role, iban, bic, account_number, notes):
|
|
56
57
|
"""创建新账户"""
|
|
57
58
|
client = get_client()
|
|
58
|
-
|
|
59
|
+
|
|
60
|
+
# 当 --opening-balance 非默认值 0 时,要求同时提供 --opening-balance-date
|
|
61
|
+
# Firefly III 后端会拒绝创建带余额但无开户日期的账户 (422)
|
|
62
|
+
if opening_balance and opening_balance != "0" and not opening_balance_date:
|
|
63
|
+
raise click.UsageError(
|
|
64
|
+
"当 --opening-balance 非 0 时,必须同时指定 --opening-balance-date (YYYY-MM-DD)"
|
|
65
|
+
)
|
|
66
|
+
|
|
59
67
|
data = {
|
|
60
68
|
"name": name,
|
|
61
69
|
"type": type,
|
|
62
70
|
"currency_code": currency_code,
|
|
63
71
|
"opening_balance": opening_balance,
|
|
64
72
|
}
|
|
65
|
-
|
|
73
|
+
|
|
74
|
+
if opening_balance_date:
|
|
75
|
+
data["opening_balance_date"] = opening_balance_date
|
|
66
76
|
if account_role:
|
|
67
77
|
data["account_role"] = account_role
|
|
68
78
|
if iban:
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/transactions.py
RENAMED
|
@@ -74,12 +74,15 @@ def transactions_create(description, amount, source_account, destination_account
|
|
|
74
74
|
"""创建新交易"""
|
|
75
75
|
client = get_client()
|
|
76
76
|
|
|
77
|
+
# 始终在 transaction_data 内部设置 group_title="",避免 Firefly III
|
|
78
|
+
# 自动将 description 复制为 group_title,导致首页显示 "xxx: xxx"
|
|
77
79
|
transaction_data = {
|
|
78
80
|
"type": type,
|
|
79
81
|
"date": date,
|
|
80
82
|
"amount": amount,
|
|
81
83
|
"description": description,
|
|
82
84
|
"source_id": source_account,
|
|
85
|
+
"group_title": group_title if group_title else "",
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
if destination_account:
|
|
@@ -101,11 +104,6 @@ def transactions_create(description, amount, source_account, destination_account
|
|
|
101
104
|
"transactions": [transaction_data]
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
# 仅当显式传入 --group-title 时才设置分组标题
|
|
105
|
-
# 不传则避免和 description 重复导致首页显示 "描述: 描述"
|
|
106
|
-
if group_title:
|
|
107
|
-
data["group_title"] = group_title
|
|
108
|
-
|
|
109
107
|
result = client.create_transaction(data)
|
|
110
108
|
output(result)
|
|
111
109
|
|
|
@@ -117,7 +115,9 @@ def transactions_create(description, amount, source_account, destination_account
|
|
|
117
115
|
@click.option("--category", help="分类名称")
|
|
118
116
|
@click.option("--tags", help="标签 (逗号分隔)")
|
|
119
117
|
@click.option("--notes", help="备注")
|
|
120
|
-
|
|
118
|
+
@click.option("--group-title", "group_title", default=None,
|
|
119
|
+
help="分组标题(可选)。传空字符串可清空分组标题,解决首页 '描述: 描述' 冗余问题。")
|
|
120
|
+
def transactions_update(id, description, amount, category, tags, notes, group_title):
|
|
121
121
|
"""更新现有交易"""
|
|
122
122
|
client = get_client()
|
|
123
123
|
|
|
@@ -132,6 +132,9 @@ def transactions_update(id, description, amount, category, tags, notes):
|
|
|
132
132
|
transaction_data["tags"] = [tag.strip() for tag in tags.split(",")]
|
|
133
133
|
if notes:
|
|
134
134
|
transaction_data["notes"] = notes
|
|
135
|
+
# 仅当显式传入 group_title(包含空字符串)时才设置
|
|
136
|
+
if group_title is not None:
|
|
137
|
+
transaction_data["group_title"] = group_title
|
|
135
138
|
|
|
136
139
|
if not transaction_data:
|
|
137
140
|
click.echo("错误: 至少需要提供一个更新字段", err=True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/budgets.py
RENAMED
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/categories.py
RENAMED
|
File without changes
|
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/insights.py
RENAMED
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/piggy_banks.py
RENAMED
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli/commands/search.py
RENAMED
|
File without changes
|
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/requires.txt
RENAMED
|
File without changes
|
{coder_firefly_cli-1.1.0 → coder_firefly_cli-1.1.2}/src/coder_firefly_cli.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|