enhancement/csv-output-and-refactor #2

Merged
nick merged 2 commits from enhancement/csv-output-and-refactor into master 2025-04-23 08:19:18 -04:00
Showing only changes of commit 2411eeef0a - Show all commits

View File

@ -2,16 +2,18 @@
Wallos Fetcher is a command-line utility designed to retrieve and export subscription data from a self-hosted [Wallos](https://github.com/WallosApp/Wallos) instance—an open-source personal subscription tracker. Wallos Fetcher is a command-line utility designed to retrieve and export subscription data from a self-hosted [Wallos](https://github.com/WallosApp/Wallos) instance—an open-source personal subscription tracker.
This script helps you keep track of all your recurring expenses and share that information in human-readable or machine-readable formats, making it especially useful for budgeting, personal finance planning, and digital legacy preparation for family members. This script helps you keep track of all your recurring expenses and share that information in human-readable or machine-readable formats. It's especially useful for budgeting, personal finance planning, and digital legacy preparation for family members.
--- ---
## ✨ Features ## ✨ Features
- 📄 **Markdown output by default** easy to read, easy to share - 📄 **Markdown output by default** clean, readable reports
- 📊 **CSV output** spreadsheet-friendly for Excel, Numbers, etc.
- 💾 Export as **Markdown**, **CSV**, or **JSON** - 💾 Export as **Markdown**, **CSV**, or **JSON**
- 🔍 Optionally include **full subscription details** (e.g., cycle, auto-renew, currency) - 🔍 Optionally include **full subscription details** (e.g., cycle, auto-renew, currency)
- 🗃 Output to a custom file - 🗃 Output to a custom file
- 🧼 Modular, readable Bash script using secure temp file handling
- 🧰 Lightweight, portable, and dependency-minimal (requires `curl` and `jq`) - 🧰 Lightweight, portable, and dependency-minimal (requires `curl` and `jq`)
--- ---
@ -44,6 +46,8 @@ chmod +x wallos-fetch.sh
./wallos-fetch.sh [options] ./wallos-fetch.sh [options]
``` ```
> This script requires `curl` and `jq`. Run `./wallos-fetch.sh --help` to see all options.
### ✅ Example Commands ### ✅ Example Commands
| Purpose | Command | | Purpose | Command |
@ -90,11 +94,34 @@ Structured export for use in spreadsheets or data processing tools.
- Default fields: `id,name,price,next_payment,category_name,payment_method_name` - Default fields: `id,name,price,next_payment,category_name,payment_method_name`
- `--full` option adds: `currency_id,cycle,auto_renew`, etc. - `--full` option adds: `currency_id,cycle,auto_renew`, etc.
```csv
"id","name","price","next_payment","category_name","payment_method_name"
"1","Netflix","17.99","2025-04-21","Entertainment","Credit Card"
"2","Spotify","9.99","2025-05-01","Music","PayPal"
```
### 📦 JSON ### 📦 JSON
Raw response data from the Wallos API—useful for backups or integrations. Raw response data from the Wallos API—useful for backups, custom reporting, or integrations.
```json
{
"subscriptions": [
{
"id": 1,
"name": "Netflix",
"price": 17.99,
"currency_id": "USD",
"next_payment": "2025-04-21",
"category_name": "Entertainment",
"payment_method_name": "Credit Card"
}
]
}
```
--- ---
## 🔐 Authentication ## 🔐 Authentication
You can set your API key in one of two ways: You can set your API key in one of two ways:
@ -125,6 +152,8 @@ API_KEY="your_api_key_here"
> ⚠️ Be cautious: hardcoding secrets in scripts can pose a security risk if the file is shared or version-controlled. > ⚠️ Be cautious: hardcoding secrets in scripts can pose a security risk if the file is shared or version-controlled.
---
## 📜 License ## 📜 License
This project is licensed under the [GNU General Public License v3.0 or later](https://www.gnu.org/licenses/gpl-3.0.html). This project is licensed under the [GNU General Public License v3.0 or later](https://www.gnu.org/licenses/gpl-3.0.html).
@ -134,7 +163,7 @@ This project is licensed under the [GNU General Public License v3.0 or later](ht
## 🤝 Contributions ## 🤝 Contributions
Feedback, bug reports, and pull requests are welcome! Feedback, bug reports, and pull requests are welcome!
Submit issues or improvements via your Gitea repository. Submit issues or improvements via the Gitea repository.
--- ---