{"id":28429561,"url":"https://github.com/mkrd/superpy","last_synced_at":"2025-07-04T18:30:55.721Z","repository":{"id":57472397,"uuid":"334886723","full_name":"mkrd/SuperPy","owner":"mkrd","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-13T12:29:57.000Z","size":76,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T13:47:55.780Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkrd.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}},"created_at":"2021-02-01T08:52:29.000Z","updated_at":"2024-02-08T08:56:29.000Z","dependencies_parsed_at":"2024-08-02T13:16:32.618Z","dependency_job_id":"ac7a95c8-eec1-4b82-bbd7-189675f8975a","html_url":"https://github.com/mkrd/SuperPy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mkrd/SuperPy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkrd%2FSuperPy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkrd%2FSuperPy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkrd%2FSuperPy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkrd%2FSuperPy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkrd","download_url":"https://codeload.github.com/mkrd/SuperPy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkrd%2FSuperPy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263596587,"owners_count":23486170,"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":"2025-06-05T13:38:26.248Z","updated_at":"2025-07-04T18:30:55.708Z","avatar_url":"https://github.com/mkrd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SuperPy\n\n[![Downloads](https://pepy.tech/badge/super-py)](https://pepy.tech/project/super-py)\n[![Downloads](https://pepy.tech/badge/super-py/month)](https://pepy.tech/project/super-py)\n[![Downloads](https://pepy.tech/badge/super-py/week)](https://pepy.tech/project/super-py)\n\nThere are 5 sub modules:\n- sp.logging\n- sp.testing\n- sp.concurrency\n- sp.dicts\n- sp.disk\n- sp.string\n\n\n## sp.logging\n\nSuperPy's logging system is a simple abstraction from the standard library logging module.\nIt also provides some nice extra functionalities.\nHere are some examples:\n\n### Logging messages\n\n``` python\nimport super_py as sp\n\nlog = sp.logging.Logger(\"info\",\n    ts_color=\"bright_green\",\n    terminal=True,\n    files=[\"info.log\", \"combined.log\"],\n)\n\nlog(\"This is a simple log!\")\n```\n\nThis will write the following log line to the terminal, and the files `info.log` and `comnined.log`:\n```\n[info        ] 2022-10-04 15:53:09            This is a simple log!\n```\nwhere the name and timestamp will be colored in `bright_green`.\n\n### Logging function benchmarks\n\nYou can also use the provided decorator to log benchmarks of your functions:\n\n``` python\nimport super_py as sp\n\nlog = sp.logging.Logger(\"benchmark\",\n    ts_color=\"bright_green\",\n    terminal=True,\n)\n\n@log.benchmark(with_args=[0])\ndef wait(seconds):\n    time.sleep(seconds)\n\nfor i in range(10):\n    wait(i / 10)\n```\n\nThis will write the following log lines:\n```\n[benchmark   ] 2022-10-04 16:03:39     0.0ms  wait((0.0))\n[benchmark   ] 2022-10-04 16:03:39   105.1ms  wait((0.1))\n[benchmark   ] 2022-10-04 16:03:39   205.1ms  wait((0.2))\n[benchmark   ] 2022-10-04 16:03:40   308.3ms  wait((0.3))\n[benchmark   ] 2022-10-04 16:03:40   403.5ms  wait((0.4))\n[benchmark   ] 2022-10-04 16:03:40   505.1ms  wait((0.5))\n[benchmark   ] 2022-10-04 16:03:41   605.1ms  wait((0.6))\n[benchmark   ] 2022-10-04 16:03:42   705.1ms  wait((0.7))\n[benchmark   ] 2022-10-04 16:03:43   804.1ms  wait((0.8))\n[benchmark   ] 2022-10-04 16:03:43   903.3ms  wait((0.9))\n```\n\nYou can use benchmark without calling the decorator, it will still work:\n``` python\n@log.benchmark\ndef wait(seconds):\n    time.sleep(seconds)\n```\n\nThe benchmark decorator takes the following keyword arguments:\n- `with_args: list[int]`: The list of indices of function arguments which should be logged.\n- `with_kwargs: list[str]`: The list of keyword argument names of the function which should be logged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkrd%2Fsuperpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkrd%2Fsuperpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkrd%2Fsuperpy/lists"}