{"id":21569395,"url":"https://github.com/aweirddev/aweird","last_synced_at":"2025-10-12T13:18:27.176Z","repository":{"id":162941987,"uuid":"496185057","full_name":"AWeirdDev/aweird","owner":"AWeirdDev","description":"Python text-detecting, routine functions all-in-one","archived":false,"fork":false,"pushed_at":"2022-05-26T09:33:44.000Z","size":41,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T12:32:29.773Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/AWeirdDev.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}},"created_at":"2022-05-25T10:32:06.000Z","updated_at":"2024-05-25T14:28:53.000Z","dependencies_parsed_at":"2024-04-28T12:44:05.906Z","dependency_job_id":"2060498d-df43-45c0-bec0-acb8ed1ad092","html_url":"https://github.com/AWeirdDev/aweird","commit_stats":null,"previous_names":["aweirddev/aweird"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Faweird","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Faweird/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Faweird/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Faweird/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AWeirdDev","download_url":"https://codeload.github.com/AWeirdDev/aweird/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166677,"owners_count":20409178,"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":[],"created_at":"2024-11-24T11:09:24.775Z","updated_at":"2025-10-12T13:18:27.117Z","avatar_url":"https://github.com/AWeirdDev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWeirdKit\nA weird, but useful python routine, text-detecting kit, all-in-one.\n\n\n## Installation\n```sh\npip install -U git+https://github.com/AWeirdScratcher/aweird\n```\nor\n```sh\npython -m pip install git+https://github.com/AWeirdScratcher/aweird\n```\n\n## Basic Usage\n\u003e *Hey, are you looking for `Routine`?* Click here: [Jump!](#Routine)\n\nTerminal (Console) colors:\n```py\nfrom aweird.kit import bcolors\nprint(bcolors.fail + \"Red colors usually mean something is wrong\" + bcolors.end) # end the color\n```\n\u003e And you should see the text becomes `red`\n\nMarkdown Link Detector:\n\u003e *BETA*: We're planning to release `custom detectors`\n```py\nfrom aweird.kit import detect_format\nresult = detect_format(\"[markdown links like this](https://discord.com/jobs)\")\nprint(result)\n```\n\u003e And the result will be: `True`\n\nAdd Something in the text:\n```py\nfrom aweird.kit import add_at\nresult = add_at(\"I'm a bad person\", \"not \", 6)\nprint(result)\n```\n\u003e And the result will be: `I'm not a bad person`\n\n## Routine\nRoutine (object) - Tasks \u0026 Routines function\n\n## Basic\n```py\nfrom aweird.kit import Routine\n\nroutine = Routine()\n\n@routine.routine\ndef yay():\n  print(\"A: I like chocolate\")\n  \n@routine.routine\ndef wow():\n  print(\"B: I like chocolate, too!\")\n\nroutine.start(seconds=1) # run a task every 1 second\n```\nAnd the console will be like this in 1 second:\n```\nA: I like chocolate\nB: I like chocolate, too!\n```\nIf you want to run this routine forever, just simply add `forever=True` in `routine.start()` function:\n```py\nroutine.start(seconds=1, forever=True)\n```\nFor discord bot hosting:\n\u003e Note: this will run with `routine.start()`, but it's executed in a `Thread`.\n```py\n@routine.get(\"https://discord.com/jobs\")\ndef hosted(response) -\u003e None:\n  print(\"I just hosted discord.com/jobs!\")\n```\nTo receive hosting errors:\n```py\nfrom .aweirdkit import Routine, HostError\nroutine = Routine()\n\n@routine.get(\"???.com\")\ndef __RandomWebsite():\n  print(\"Will you print this?\")\n\n@routine.error(HostError)\ndef _hostError():\n  print(\"Something went wrong!\")\n```\n\u003e Info: If the `@routine.error` was not set, by default it just prints a failing message.\n\n## Events\nIf you want to trigger events, try this out:\n```py\nfrom aweird.kit import Routine\n\nroutine = Routine()\n\n@routine.event\ndef on_ready(something: str) -\u003e None: # on_[EVENT NAME]\n  print(\"Wow, this is cool! And I received: \" + something)\n\nroutine.emit(\"ready\", something=\"I like chocolate\")\n```\nTo make it run `async` functions, just add `async_mode=True` in `routine.emit()` function.\n\nExample usage for `async` functions:\n```py\nfrom aweird.kit import Routine\n\nroutine = Routine()\n\n@routine.event\nasync def on_ready(something: str) -\u003e None: # on_[EVENT NAME]\n  print(\"Wow, this is cool! And I received: \" + something)\n\nroutine.emit(\"ready\",  async_mode=True, something=\"I like chocolate\")\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faweirddev%2Faweird","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faweirddev%2Faweird","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faweirddev%2Faweird/lists"}