{"id":17108414,"url":"https://github.com/dotx12/eventfisher","last_synced_at":"2025-03-23T21:15:26.791Z","repository":{"id":119048680,"uuid":"334623911","full_name":"dotX12/EventFisher","owner":"dotX12","description":"⏰🗒 A project that allows you to create decorators to catch some new updates from the API, etc.","archived":false,"fork":false,"pushed_at":"2021-02-05T22:48:28.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T04:41:24.196Z","etag":null,"topics":["api","bot","decorator","event","eventemitter","eventfisher","fisher","pyee","python","python3","rest","rest-api","sender","telebot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotX12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2021-01-31T10:03:35.000Z","updated_at":"2021-02-09T21:23:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0faad16-db63-4ba5-ab8e-233654495631","html_url":"https://github.com/dotX12/EventFisher","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotX12%2FEventFisher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotX12%2FEventFisher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotX12%2FEventFisher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotX12%2FEventFisher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotX12","download_url":"https://codeload.github.com/dotX12/EventFisher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245168899,"owners_count":20571804,"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":["api","bot","decorator","event","eventemitter","eventfisher","fisher","pyee","python","python3","rest","rest-api","sender","telebot"],"created_at":"2024-10-14T16:05:20.093Z","updated_at":"2025-03-23T21:15:26.782Z","avatar_url":"https://github.com/dotX12.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EventFisher\n#### This project is a draft, on the basis of which you can create an asynchronous handler for your API requests and call functions if any handler is triggered.\nThe project is based on a aiohttp, asyncio, custom async scheduler and AsyncEventEmitter.\n\nEvery 30 seconds, the scheduler calls def poll from BlockcypherAPI, poll in turn calls a number of other functions. These functions make emit, which our decorators run.\n\n#### ***How to start?***\n```\n💲 git clone https://github.com/dotX12/EventFisher/\n💲 cd EventFisher\n💲 pip3 install -r requirements.txt\n💲 python3 main.py\n```\n#### Where applicable:\n\nI have implemented a simple but high-quality example.\nEvery 30 seconds we check whether new transactions have come to our wallet, as well as whether the network commission has changed.\nIf any of this is fulfilled, an \"emit\" will be made, which will trigger decorators and call our functions, which in turn will do something. In these functions, you can log, add to the database, send message to users, etc.\n\n```python3\n    async def get_info_medium_fee(self):\n        resp = await self.request('GET', MAIN_INFO_BTC)\n        if self.medium_fee != resp['medium_fee_per_kb']:\n            self.medium_fee = resp['medium_fee_per_kb']\n            self.emit('new_btc_medium_fee')\n            # Will call the event handler that belongs to this decorator \n            # @event.on('new_btc_medium_fee')\n```\n```python3\n@event.on('new_btc_medium_fee')\ndef btc_new_price():\n    print(f'BTC NEW MEDIUM FEE: {event.medium_fee}')\n\n```\n\n\nAn example was also added for the telebot library, which sends information to the user when the decorator is triggered.\n```python3\n@event.on('new_transaction')\ndef new_transaction():\n    bot.send_message(ADMIN_ID, f'New Transaction! TX Hash: {event.tx[\"tx_hash\"]}')\n\n\n@event.on('new_btc_medium_fee')\ndef btc_new_price():\n    bot.send_message(ADMIN_ID, f'BTC NEW MEDIUM FEE: {event.medium_fee}')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotx12%2Feventfisher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotx12%2Feventfisher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotx12%2Feventfisher/lists"}