{"id":24189294,"url":"https://github.com/minimal-scouser/trny","last_synced_at":"2025-09-21T12:33:15.787Z","repository":{"id":48872061,"uuid":"348645084","full_name":"minimal-scouser/trny","owner":"minimal-scouser","description":"A javascript package that extracts transactional info from a bank alert","archived":false,"fork":false,"pushed_at":"2022-10-23T11:02:45.000Z","size":237,"stargazers_count":15,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-28T22:33:24.865Z","etag":null,"topics":["account","angular","balance","cash","extract","extracts-transactional-info","javascript","money","money-library","react","transaction"],"latest_commit_sha":null,"homepage":"https://minimal-scouser.github.io/trny-demo","language":"JavaScript","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/minimal-scouser.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}},"created_at":"2021-03-17T09:10:26.000Z","updated_at":"2024-04-02T11:18:14.000Z","dependencies_parsed_at":"2022-08-29T04:31:32.521Z","dependency_job_id":null,"html_url":"https://github.com/minimal-scouser/trny","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minimal-scouser%2Ftrny","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minimal-scouser%2Ftrny/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minimal-scouser%2Ftrny/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minimal-scouser%2Ftrny/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minimal-scouser","download_url":"https://codeload.github.com/minimal-scouser/trny/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233754686,"owners_count":18725044,"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","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":["account","angular","balance","cash","extract","extracts-transactional-info","javascript","money","money-library","react","transaction"],"created_at":"2025-01-13T14:24:20.698Z","updated_at":"2025-09-21T12:33:15.230Z","avatar_url":"https://github.com/minimal-scouser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trny\r\n\r\n🛠 A newer version of this package is in the works\r\n\r\nA javascript package that extracts transactional info like account number, money spent, balance and type of transaction from a string\r\n\r\nDemo [here](https://minimal-scouser.github.io/trny-demo)\r\n\r\nNote: After developing this I was very excited and tested it on some bank alerts. The results were disappointing(I should have seen this coming). \r\n\r\nThe parsing logic is weak. There are soooo many different formats of bank alerts out there. \r\n\r\nSo if you want to improve this or doing something like this you may find the following steps useful\r\n\r\n1. Collect as much varied data as you can.\r\n2. Then work on parsing logic.\r\n\r\nData is king here. Without that your parser/engine will fail.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install trny\r\n```\r\n\r\n## Usage\r\n\r\n```javascript\r\nimport { getTransactionInfo } from \"trny\";\r\n\r\nconst message = \"Your a/c XX0413 is debited on 15/12/2020 by INR 3,211.00 towards purchase. Avl Bal: INR 5,603.54.\";\r\n\r\nconst info = getTransactionInfo(message);\r\n \r\n/* \r\ninfo = {     \r\n   account: {\r\n    type: \"account\",\r\n    no: \"0413\"\r\n   },\r\n   balance: 5603.54,\r\n   money: 3211.00,\r\n   typeOfTransaction: \"debited\" \r\n}\r\n*/\r\n\r\n```\r\n\r\n## Methods\r\n\r\n1. [getTransactionInfo](#gettransactioninfo)\r\n2. [getAccount](#getaccount)\r\n3. [getMoneySpent](#getmoneyspent)\r\n4. [getBalance](#getbalance)\r\n\r\n#### `getTransactionInfo`\r\n\r\n```typescript \r\nimport { getTransactionInfo } from \"trny\";\r\n\r\nconst message = \"Dear Customer, Rs.248,759.00 is debited from A/c XXXX6791 for BillPay/Credit Card payment via Example Bank NetBanking. Call XXXXXXXX161XXX if txn not done by you\";\r\n\r\nconst info = getTransactionInfo(string: string)\r\n/*\r\n{\r\n    account: {type: \"account\", no: \"6791\"},\r\n    balance: \"\",\r\n    money: \"248759.00\",\r\n    typeOfTransaction: \"debited\"\r\n}, \r\n*/\r\n```\r\n\r\n#### `getAccount`\r\n\r\n```javascript \r\n\r\nimport { getAccount } from \"trny\";\r\n\r\nconst message = \"INR Rs. 399 debited from A/c no. 098900 on Avl Bal-INR Rs. 57575\";\r\n\r\nconst account = getAccount(message);\r\n// \"098900\"\r\n```\r\n\r\n#### `getMoneySpent`\r\n\r\n```javascript\r\n\r\nimport { getMoneySpent } from \"trny\";\r\n\r\nconst message = \"Your sb a/c XXX00981 is debited for rs.80 on 22-02-2021 by transfer avl bal rs:6802.04\";\r\n\r\nconst money = getMoneySpent(message);\r\n// \"00981\"\r\n\r\n```\r\n\r\n#### `getBalance`\r\n\r\n```javascript\r\n\r\nimport { getBalance } from \"trny\";\r\n\r\nconst message = \"Avbl Bal for A/c XXXX0377  as on 30-06-2019 is INR 21719.25. Combined Avbl Bal is INR 21719.25. Use Mobile Banking App to track A/c (app.kotak.com)\";\r\n\r\nconst balance = getBalance(message);\r\n// \"21719.25\"\r\n\r\n```\r\n\r\n## Contribute\r\n\r\nPlease submit a PR\r\n\r\n## Visitors\r\n\r\n![visitor badge](https://visitor-badge.glitch.me/badge?page_id=minimal-scouser.visitor-badge)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminimal-scouser%2Ftrny","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminimal-scouser%2Ftrny","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminimal-scouser%2Ftrny/lists"}