{"id":50956443,"url":"https://github.com/zeroflag/yahoo.emacs","last_synced_at":"2026-06-18T07:31:08.609Z","repository":{"id":318748713,"uuid":"1073222754","full_name":"zeroflag/yahoo.emacs","owner":"zeroflag","description":"Portfolio tracking DSL with Yahoo Finance integration, for Emacs","archived":false,"fork":false,"pushed_at":"2025-11-07T23:48:33.000Z","size":555,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-08T01:18:14.042Z","etag":null,"topics":["dsl","emacs","emacs-lisp","emacs-package","factor","forth","interpreter","postfix","yahoo-finance"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeroflag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-09T19:41:20.000Z","updated_at":"2025-11-07T23:48:36.000Z","dependencies_parsed_at":"2025-10-15T01:29:52.895Z","dependency_job_id":"6973302c-a5ea-4405-9ec1-c0dd6109761e","html_url":"https://github.com/zeroflag/yahoo.emacs","commit_stats":null,"previous_names":["zeroflag/yahoo.emacs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zeroflag/yahoo.emacs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroflag%2Fyahoo.emacs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroflag%2Fyahoo.emacs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroflag%2Fyahoo.emacs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroflag%2Fyahoo.emacs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroflag","download_url":"https://codeload.github.com/zeroflag/yahoo.emacs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroflag%2Fyahoo.emacs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34481213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":["dsl","emacs","emacs-lisp","emacs-package","factor","forth","interpreter","postfix","yahoo-finance"],"created_at":"2026-06-18T07:31:07.948Z","updated_at":"2026-06-18T07:31:08.600Z","avatar_url":"https://github.com/zeroflag.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yf.el\n\n![{master}](https://github.com/zeroflag/yahoo.emacs/actions/workflows/ci.yml/badge.svg)\n\n## 📝 Overview\n\n`yf.el` is a DSL and a runtime for Emacs for multi-currency portfolio tracking. \n\nIt's written in Emacs Lisp, with live price fetching from *Yahoo Finance*, memoized caching, and debug overlays.\n\n\u003cimg src=\"imgs/demo.gif\" alt=\"fib\" /\u003e\n\n`yf.el` includes a major mode, a REPL mode and interactive `elisp` functions. \n\nIts DSL uses a syntax similar to `Forth` and `Factor`.\n\n\n## 💡 Example\n\n```Forth\n( Simple portfolio tracker and F.I.R.E calculator )\n2500 EUR 12 * SET EXPENSE ( annual expense )\n\n( Holdings USD )\n$SBUX         300\n$SCHD         3500\n$QQQ          100\n( Holdings EUR )\n$SXR8.DE      750\n$VWCE.DE      1800\n$P911.DE      700\n\nSUMPROD .S\n\n[ TO EUR SHIFT ] DEPTH 1 - TIMES ( convert all to EUR )\n\nSUM ?\n\nEXPENSE / ANY ?\n\n[ 25 \u003e ] [ \"You can retire now.\" ] [ \"Keep working..\" ] IF .\n```\n\nEvaluates your current holdings, converts them into your home currency, and divides by your annual expenses.\n\n## ⚙️ Installation (Doom Emacs)\n\n### packages.el\n\n```elisp\n(package! yf\n  :recipe (:host github :repo \"zeroflag/yahoo.emacs\"))\n```\n\n### config.el\n```elisp\n(use-package! yf-mode :mode \"\\\\.yf\" :defer t)\n\n(use-package! yf-repl\n  :defer t\n  :commands yf-repl-start\n  :init\n  (map! :leader\n        :desc \"Start Yahoo Finace REPL.\"\n        \"y s\" #'yf-repl-start))\n```\n\n## 🔤 Words and Stack Effects\n\nBelow is the current word reference, grouped by category.\n\n### 🌐 Yahoo Finance Integration\n\n| Word                 | Stack Effect    | Description                                                                             |\n| -------------------- | --------------- | --------------------------------------------------------------------------------------- |\n| `$TICKER`            | `— → n`         | Fetches the price of a literal ticker symbol                                            |\n| `PRICE`              | `s → n`         | Fetches the price of a ticker string                                                    |\n| `TO`                 | `n → n`         | Converts an amount from its source currency to the target currency specified after `TO` |\n| `XCHG`               | `n s → n`       | Sames as `TO` but instead of parsing the target currency it takes it from the stack     |\n\nExamples:\n\n```Forth\n$AAPL .             =\u003e 180.25 USD\n10 USD TO EUR .     =\u003e 8.61 EUR\n10 USD \"EUR\" XCHG . =\u003e 8.61 EUR\n```\n\nAll numbers are represented as dotted pairs in the form `(amount . CURRENCY)`, for example `(100.0 . \"USD\")`.\nIf no currency is specified, `\"ANY\"` is used by default.\nArithmetic operations can be performed between numbers that share the same currency, or when one of them has the `\"ANY\"` currency.\n\n### 🔧 Core Stack Manipulation \u0026 Arithmetic Words\n\n| Word          | Stack Effect    | Description                                                           |\n| ------------- | --------------- | --------------------------------------------------------------------- |\n| `DROP`        | `x →`           | Discards the top of the stack                                         |\n| `DUP`         | `x → x x`       | Duplicates top element                                                |\n| `OVER`        | `a b → a b a`   | Copies second element to top                                          |\n| `SWAP`        | `a b → b a`     | Swaps top two elements                                                |\n| `ROT`         | `a b c → b c a` | Rotates top three elements                                            |\n| `-ROT`        | `a b c → c a b` | Inverse rotate                                                        |\n| `TUCK`        | `a b → c a b`   | Copies the top of the stack and inserts it below the 2nd element      |\n| `CLEAR`       | `... → `        | Clears the stack                                                      |\n| `SHIFT`       | `... a → a ...` | Moves the top of the stack to the bottom                              |\n| `DEPTH`       | `— → n`         | Pushes the current number of items on the stack onto the stack        |\n| `TALLY`       | `— → n`         | Pushes the current number of items on the stack until the next WALL   |\n| `+`           | `n1 n2 → n`     | Adds n1 and n2 together                                               |\n| `-`           | `n1 n2 → n`     | Subtracts n2 from n1                                                  |\n| `*`           | `n1 n2 → n`     | Multiplies n1 with n2                                                 |\n| `/`           | `n1 n2 → n`     | Divides n1 by n2                                                      |\n| `DIV`         | `n1 n2 → n`     | Integer division between n1 and n2                                    |\n| `MOD`         | `n1 n2 → nl`    | Modulo division between n2 and n2                                     |\n| `%CHG`        | `n1 n2 → n`     | Computes the percent change from value n1 to n2                       |\n| `SUMPROD`     | `... → total`   | Multiplies each pairs then calculates the sum                         |\n| `SUM`         | `... → total`   | Sums all numbers on the stack                                         |\n| `PROD`        | `... → product` | Multiplies all numbers on the stack                                   |\n| `WALL` / `\\|` | `— → \\|`        | Stack boundary marker used by `SUM`/`SUMPROD` to limit their operation|\n\n\n```forth\n100   $SBUX\n250   $QQQ\n500   $SPY\n\nSUMPROD .\n```\n\n```forth\n1 2 3 | 4 5 SUM .  =\u003e 9\n```\n\n```forth\n1 2 3 | 4 5 TALLY .  =\u003e 2\n1 2 3 | 4 5 DEPTH .  =\u003e 6\n```\n\n### 🧠 Logic \u0026 Control Flow\n\n| Word      | Stack Effect                 | Description                                   |\n| --------- | -----------------------------| --------------------------------------------- |\n| `[`       | ` → NIL`                     | Startas defining a quotation until `]`        |\n| `WHEN`    | `[cond] [then] →`            | Executes `then` quotation if `cond` is true   |\n| `UNLESS`  | `[cond] [then] →`            | Executes `then` if `cond` evaluates false     |\n| `IF`      | `[cond] [then] [else] →`     | Executes `then` if `cond` evaluates true      |\n| `CASE`    | `\\| [cond] [body] ..   →`    | Evaluate `cond` `body` pairs until `\\|`       |\n| `WHILE`\t  | `[cond] [body] →`            | Executes `body` as long as `cond` is true     | \n| `UNTIL`   | `[body] [cond] →`            | Repeats `body` until `cond` becomes true      |\n| `TIMES`   | `[quote] n →`                | Executes quotation `n` times                  |\n| `CALL`    | `[quote] →`                  | Executes quotation                            |\n| `WATCH`   | `seconds [quote] →`          | Periodically calls the given quotation        |\n| `AND`     | `b1 b2 → b`                  | Logical AND                                   |\n| `OR`      | `b1 b2 → b`                  | Logical OR                                    |\n\nExamples:\n\n```forth\n1 [ DUP 10 \u003c ] [ 1 + ] WHILE\n\n( convert all items on the stack to EUR )\n[ TO EUR SHIFT ] DEPTH 1 - TIMES \n\n( select the minimum )\n2 3 [ OVER OVER \u003c ] [ DROP ] [ SWAP DROP ] IF\n\n```\n\n```forth\n60 [ [ $SBUX ? 90 \u003e ] [ \"beep\" SHELL ] WHEN ] WATCH\n```\n\n```forth\n1\n[ DUP 30 \u003c= ]\n[\n  | [ DUP 15 MOD 0 = ] [ \"FIZZBUZZ\" MESSAGE ]\n    [ DUP  3 MOD 0 = ] [ \"FIZZ\"     MESSAGE ]\n    [ DUP  5 MOD 0 = ] [ \"BUZZ\"     MESSAGE ]\n    [ TRUE           ] [  DUP       MESSAGE ] CASE\n  1 +\n] WHILE\n\nDROP\n```\n\n### 👷 Defining words\n\n| Word      | Stack Effect                          | Description                                                                     |\n| --------- | ------------------------------------- | ------------------------------------------------------------------------------- |\n| `SET`     | `value →`                             | Defines a variable with the name specified after `SET`                          |\n| `FORGE`   | `[quote] →`                           | Defines a word with the quotation as body, and the name specified after `FORGE` |\n\nExamples\n```forth\n3.14 SET PI\n\n[ 1 + ] FORGE INC\n\nPI INC        =\u003e 4.14\n```\n\n### 🖨️ Output \u0026 Debugging\n\n| Word     | Stack Effect   | Description                                                   |\n| ---------| -------------- | ------------------------------------------------------------- |\n| `PRINC`  | `x →`          | Pops and prints the top of the stack to stdout                |\n| `MESSAGE`| `x →`          | Pops and prints the top of the stack to the message buffer    |\n| `CLEAN`  | `— →`          | Removes all overlays                                          |\n| `SHELL`  | `str —`        | Runs a shell command                                          |\n| `.`      | `x →`          | Pops and displays the top of the stack as an overlay          |\n| `?`      | `x →`          | Displays the top of stack (without removing it) as an overlay |\n| `.S`     | `— →`          | Displays current stack contents as an overlay                 |\n\n## 📜 License\n\nMIT License © 2025 — Attila Magyar\n\nUse it freely, modify, and share — but please be kind to the Yahoo Finance API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroflag%2Fyahoo.emacs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroflag%2Fyahoo.emacs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroflag%2Fyahoo.emacs/lists"}