{"id":30705084,"url":"https://github.com/eshaffer321/monarchmoney-go","last_synced_at":"2025-09-02T18:08:20.902Z","repository":{"id":312565151,"uuid":"1047904713","full_name":"eshaffer321/monarchmoney-go","owner":"eshaffer321","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-31T14:13:02.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"feature/initial-implementation","last_synced_at":"2025-08-31T16:10:21.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eshaffer321.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-31T13:52:39.000Z","updated_at":"2025-08-31T13:58:33.000Z","dependencies_parsed_at":"2025-08-31T16:10:42.397Z","dependency_job_id":"705e6705-505c-4161-9aed-3d5a500a5877","html_url":"https://github.com/eshaffer321/monarchmoney-go","commit_stats":null,"previous_names":["eshaffer321/monarchmoney-go"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/eshaffer321/monarchmoney-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Fmonarchmoney-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Fmonarchmoney-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Fmonarchmoney-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Fmonarchmoney-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eshaffer321","download_url":"https://codeload.github.com/eshaffer321/monarchmoney-go/tar.gz/refs/heads/feature/initial-implementation","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaffer321%2Fmonarchmoney-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273326059,"owners_count":25085666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-02T18:08:17.262Z","updated_at":"2025-09-02T18:08:20.879Z","avatar_url":"https://github.com/eshaffer321.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MonarchMoney Go Client\n\n[![CI](https://github.com/eshaffer321/monarchmoney-go/actions/workflows/ci.yml/badge.svg)](https://github.com/eshaffer321/monarchmoney-go/actions/workflows/ci.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/eshaffer321/monarchmoney-go)](https://goreportcard.com/report/github.com/eshaffer321/monarchmoney-go)\n[![GoDoc](https://pkg.go.dev/badge/github.com/eshaffer321/monarchmoney-go)](https://pkg.go.dev/github.com/eshaffer321/monarchmoney-go)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nA production-grade Go client library for the [Monarch Money](https://www.monarchmoney.com/) API, providing a clean, idiomatic interface for managing personal finances programmatically.\n\n## Features\n\n- 🔐 **Full Authentication Support** - Login, MFA, TOTP, and session management\n- 📊 **Complete API Coverage** - Accounts, transactions, budgets, and more\n- 🚀 **High Performance** - Concurrent operations, connection pooling, and smart caching\n- 🛡️ **Production Ready** - Comprehensive error handling, retries, and rate limiting\n- 🧪 **Well Tested** - Extensive test coverage with mocked responses\n- 📝 **Fully Documented** - Complete GoDoc documentation and examples\n\n## Installation\n\n```bash\ngo get github.com/eshaffer321/monarchmoney-go\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n    \n    \"github.com/eshaffer321/monarchmoney-go/pkg/monarch\"\n)\n\nfunc main() {\n    // Create client\n    client, err := monarch.NewClient(\u0026monarch.ClientOptions{\n        // Option 1: Use token directly\n        Token: \"your-auth-token\",\n        \n        // Option 2: Login with credentials\n        // Email: \"your-email@example.com\",\n        // Password: \"your-password\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    \n    ctx := context.Background()\n    \n    // Get all accounts\n    accounts, err := client.Accounts.List(ctx)\n    if err != nil {\n        log.Fatal(err)\n    }\n    \n    for _, account := range accounts {\n        fmt.Printf(\"%s: $%.2f\\n\", account.DisplayName, account.CurrentBalance)\n    }\n}\n```\n\n## Authentication\n\n### Login with Credentials\n\n```go\nclient, _ := monarch.NewClient(\u0026monarch.ClientOptions{})\n\n// Basic login\nerr := client.Auth.Login(ctx, \"email@example.com\", \"password\")\n\n// Login with MFA\nerr := client.Auth.LoginWithMFA(ctx, \"email@example.com\", \"password\", \"123456\")\n\n// Login with TOTP secret\nerr := client.Auth.LoginWithTOTP(ctx, \"email@example.com\", \"password\", \"TOTP_SECRET\")\n```\n\n### Session Management\n\n```go\n// Save session to file\nerr := client.Auth.SaveSession(\"~/.monarch_session.json\")\n\n// Load session from file\nerr := client.Auth.LoadSession(\"~/.monarch_session.json\")\n\n// Use session file automatically\nclient, _ := monarch.NewClient(\u0026monarch.ClientOptions{\n    SessionFile: \"~/.monarch_session.json\",\n})\n```\n\n## Services\n\n### Accounts\n\n```go\n// List all accounts\naccounts, err := client.Accounts.List(ctx)\n\n// Get account details\naccount, err := client.Accounts.Get(ctx, \"account-id\")\n\n// Create manual account\naccount, err := client.Accounts.Create(ctx, \u0026monarch.CreateAccountParams{\n    Type:           monarch.AccountTypeCredit,\n    Name:           \"My Credit Card\",\n    CurrentBalance: -1500.00,\n})\n\n// Refresh accounts\njob, err := client.Accounts.Refresh(ctx, \"account-id-1\", \"account-id-2\")\nerr = job.Wait(ctx, 30*time.Second)\n```\n\n### Transactions\n\n```go\n// Query transactions with filters\nresult, err := client.Transactions.Query().\n    Between(startDate, endDate).\n    WithAccounts(\"account-id\").\n    WithCategories(\"category-id\").\n    WithMinAmount(100).\n    Execute(ctx)\n\n// Get transaction details\ntransaction, err := client.Transactions.Get(ctx, \"transaction-id\")\n\n// Update transaction\nerr := client.Transactions.Update(ctx, \"transaction-id\", \u0026monarch.UpdateTransactionParams{\n    Category: \"new-category-id\",\n    Notes:    \"Updated note\",\n})\n\n// Stream transactions for real-time updates\ntxnChan, errChan := client.Transactions.Stream(ctx, startDate, endDate)\nfor {\n    select {\n    case txn := \u003c-txnChan:\n        fmt.Printf(\"New transaction: %s - $%.2f\\n\", txn.Merchant, txn.Amount)\n    case err := \u003c-errChan:\n        log.Printf(\"Stream error: %v\", err)\n    }\n}\n```\n\n### Budgets\n\n```go\n// Get all budgets\nbudgets, err := client.Budgets.List(ctx)\n\n// Update budget amount\nerr := client.Budgets.SetAmount(ctx, \"budget-id\", 500.00)\n\n// Get budget details with spending\nbudget, err := client.Budgets.Get(ctx, \"budget-id\")\nfmt.Printf(\"Spent $%.2f of $%.2f\\n\", budget.ActualAmount, budget.PlannedAmount)\n```\n\n### Cash Flow\n\n```go\n// Get cash flow summary\nsummary, err := client.Cashflow.GetSummary(ctx, startDate, endDate)\nfmt.Printf(\"Income: $%.2f, Expenses: $%.2f\\n\", summary.Income, summary.Expenses)\n\n// Get detailed cash flow by category\ndetails, err := client.Cashflow.GetByCategory(ctx, startDate, endDate)\n```\n\n## Advanced Features\n\n### Rate Limiting\n\n```go\nimport \"golang.org/x/time/rate\"\n\nclient, _ := monarch.NewClient(\u0026monarch.ClientOptions{\n    RateLimiter: rate.NewLimiter(rate.Every(time.Second), 10), // 10 requests/second\n})\n```\n\n### Retry Configuration\n\n```go\nclient, _ := monarch.NewClient(\u0026monarch.ClientOptions{\n    RetryConfig: \u0026monarch.RetryConfig{\n        MaxRetries: 3,\n        RetryWait:  1 * time.Second,\n        MaxWait:    10 * time.Second,\n    },\n})\n```\n\n### Hooks for Observability\n\n```go\nclient, _ := monarch.NewClient(\u0026monarch.ClientOptions{\n    Hooks: \u0026monarch.Hooks{\n        OnRequest: func(ctx context.Context, req *http.Request) {\n            log.Printf(\"Request: %s %s\", req.Method, req.URL)\n        },\n        OnResponse: func(ctx context.Context, resp *http.Response, duration time.Duration) {\n            log.Printf(\"Response: %d in %v\", resp.StatusCode, duration)\n        },\n        OnError: func(ctx context.Context, err error) {\n            log.Printf(\"Error: %v\", err)\n        },\n    },\n})\n```\n\n## Examples\n\nSee the [examples](examples/) directory for complete working examples:\n- [Full Example](examples/full_example.go) - Demonstrates all available features\n\n## Development\n\n### Prerequisites\n\n- Go 1.20 or higher\n- Make\n\n### Building\n\n```bash\n# Run tests\nmake test\n\n# Build binary\nmake build\n\n# Run linter\nmake lint\n\n# Format code\nmake fmt\n```\n\n### Project Structure\n\n```\nmonarchmoney-go/\n├── pkg/monarch/       # Public API package\n├── internal/          # Internal implementation\n│   ├── auth/         # Authentication logic\n│   ├── graphql/      # GraphQL queries and loader\n│   └── transport/    # HTTP/GraphQL transport\n├── cmd/              # Command-line tools\n├── examples/         # Usage examples\n└── tests/           # Integration tests\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. See our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Disclaimer\n\nThis is an unofficial client library and is not affiliated with Monarch Money. Use at your own risk.\n\n## Acknowledgments\n\n- Inspired by the [Python Monarch Money client](https://github.com/hammem/monarchmoney)\n- Built with modern Go best practices","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshaffer321%2Fmonarchmoney-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feshaffer321%2Fmonarchmoney-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshaffer321%2Fmonarchmoney-go/lists"}