{"id":17215724,"url":"https://github.com/akatrevorjay/pysanity","last_synced_at":"2025-03-25T13:22:03.890Z","repository":{"id":62583276,"uuid":"77814060","full_name":"akatrevorjay/pysanity","owner":"akatrevorjay","description":"Emulates sanity for non-pep compliant code via only the dirtiest of means","archived":false,"fork":false,"pushed_at":"2017-07-13T20:24:55.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-01T06:35:46.032Z","etag":null,"topics":["adapter","mmm","pep8","proxy","python","sanity"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akatrevorjay.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2017-01-02T06:01:21.000Z","updated_at":"2022-12-04T01:45:09.000Z","dependencies_parsed_at":"2022-11-03T22:01:33.928Z","dependency_job_id":null,"html_url":"https://github.com/akatrevorjay/pysanity","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/akatrevorjay%2Fpysanity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akatrevorjay%2Fpysanity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akatrevorjay%2Fpysanity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akatrevorjay%2Fpysanity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akatrevorjay","download_url":"https://codeload.github.com/akatrevorjay/pysanity/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245467881,"owners_count":20620264,"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":["adapter","mmm","pep8","proxy","python","sanity"],"created_at":"2024-10-15T03:25:32.604Z","updated_at":"2025-03-25T13:22:03.827Z","avatar_url":"https://github.com/akatrevorjay.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pysanity\n========\n\nEmulates sanity for other people's dirty ass non-pep compliant code via only the /dirtiest/ of means.\n\nTested with Python 2.7, 3.5.\n\n|Test Status| |Coverage Status| |Documentation Status|\n\n-  PyPi: https://pypi.python.org/pypi/pysanity\n\nAnd that means?\n---------------\n\nHi! I'm `pysanity` and I turn:\n\n.. code:: python\n\n    import logging\n    log = logging.getLogger(__name__)\n\nInto the much less brain numbing:\n\n.. code:: python\n\n    from pysanity import logging\n    log = logging.get_logger(__name__)\n\nAll the while keeping your precious code completion working as expected thanks to a not grossly over-dynamic nature.\n\nYou're welcome for my existence on PyPi.\n\nLogging you say?\n----------------\n\n*Hint:* Try this out and stop accepting needless boilerplate in your code, stdlib or not:\n\n.. code:: python\n\n    import logging\n    import logging.config\n    import inspect\n\n\n    def _namespace_from_calling_context():\n        \"\"\"\n        Derive a namespace from the module containing the caller's caller.\n\n        :return str: the fully qualified python name of a module.\n        \"\"\"\n        return inspect.currentframe().f_back.f_back.f_globals['__name__']\n\n\n    def get_logger(name=None):\n        \"\"\"\n        Gets a logger instance with sensible defaults according to caller context.\n\n        :param str name: Logger name. Defaults to caller's `__name__`.\n        :return logging.Logger: Logger instance\n        \"\"\"\n        if not name:\n            name = _namespace_from_calling_context()\n\n        return logging.getLogger(name)\n\n\nInstallation\n------------\n\n.. code:: sh\n\n    pip install pysanity\n\n\nRunning tests\n-------------\n\nTox is used to handle testing multiple python versions.\n\n.. code:: sh\n\n    tox\n\n\n.. |Test Status| image:: https://circleci.com/gh/akatrevorjay/pysanity.svg?style=svg\n   :target: https://circleci.com/gh/akatrevorjay/pysanity\n.. |Coverage Status| image:: https://coveralls.io/repos/akatrevorjay/pysanity/badge.svg?branch=develop\u0026service=github\n   :target: https://coveralls.io/github/akatrevorjay/pysanity?branch=develop\n.. |Documentation Status| image:: https://readthedocs.org/projects/pysanity/badge/?version=latest\n   :target: http://pysanity.readthedocs.org/en/latest/?badge=latest\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakatrevorjay%2Fpysanity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakatrevorjay%2Fpysanity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakatrevorjay%2Fpysanity/lists"}