{"id":22574800,"url":"https://github.com/thoth-station/common","last_synced_at":"2025-04-10T16:10:36.702Z","repository":{"id":29890497,"uuid":"123088748","full_name":"thoth-station/common","owner":"thoth-station","description":"A common library for the Thoth project","archived":false,"fork":false,"pushed_at":"2023-10-18T00:15:05.000Z","size":2732,"stargazers_count":4,"open_issues_count":5,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-24T13:51:23.007Z","etag":null,"topics":["artificial-intelligence","hacktoberfest","thoth"],"latest_commit_sha":null,"homepage":"https://thoth-station.github.io/","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/thoth-station.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","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":"2018-02-27T07:13:09.000Z","updated_at":"2022-11-02T12:26:56.000Z","dependencies_parsed_at":"2024-06-18T15:26:05.799Z","dependency_job_id":"c29914bd-f0d3-4761-827a-ab3a00e52112","html_url":"https://github.com/thoth-station/common","commit_stats":null,"previous_names":[],"tags_count":178,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fcommon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fcommon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fcommon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fcommon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoth-station","download_url":"https://codeload.github.com/thoth-station/common/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248250794,"owners_count":21072683,"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":["artificial-intelligence","hacktoberfest","thoth"],"created_at":"2024-12-08T03:08:02.189Z","updated_at":"2025-04-10T16:10:36.685Z","avatar_url":"https://github.com/thoth-station.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Thoth Common\n------------\n\n.. image:: https://img.shields.io/github/v/tag/thoth-station/common?style=plastic\n  :target: https://github.com/thoth-station/common/releases\n  :alt: GitHub tag (latest by date)\n\n.. image:: https://img.shields.io/pypi/v/thoth-common?style=plastic\n  :target: https://pypi.org/project/thoth-common\n  :alt: PyPI - Module Version\n\n.. image:: https://img.shields.io/pypi/l/thoth-common?style=plastic\n  :target: https://pypi.org/project/thoth-common\n  :alt: PyPI - License\n\n.. image:: https://img.shields.io/pypi/dm/thoth-common?style=plastic\n  :target: https://pypi.org/project/thoth-common\n  :alt: PyPI - Downloads\n\nA library used in project `Thoth \u003chttps://thoth-station.ninja\u003e`_. It's aim is\nto provide core utilities for logger setup, manipulation with datetimes and\nsimilar handy helpers. Namely, you can find:\n\n* operations used for cluster object management (e.g. obtaining logs of pods)\n* operations used for scheduling workload using Argo Workflows\n* Thoth's configuration abstraction used for serialization/deserialization of\n  Thoth's config file across all the components\n* application logging setup\n* manipulation with date and time\n\nInstallation\n============\n\nThis project is released on `PyPI \u003chttps://pypi.org/project/thoth-common\u003e`_, so\nthe latest release can be installed via pip or `Pipenv\n\u003chttps://pipenv.readthedocs.io\u003e`_ as shown below:\n\n.. code-block:: console\n\n  pipenv install thoth-common\n\nThis library will automatically discover installed packages and enable `Sentry\nintegrations \u003chttps://docs.sentry.io/platforms/python/\u003e`_ if you use Flask,\nSQLAlchemy or AIOHTTP. An exception is for Flask applications, that need to\nexplicitly install ``sentry-sdk[flask]`` due to integrations dependencies.\n\nLogging setup\n=============\n\nTo setup a logger in any of Thoth's component (component that are namespaced\nwith ``thoth``), you can simply set an environment variable. The name of\nenvironment variable is constructed from module name. Let's say you want to\ndebug ``thoth.adviser.pipeline`` module, in that case you can set environment\nvariable ``THOTH_LOG_ADVISER_PIPELINE=DEBUG`` which will cause loggers\n``thoth.adviser.pipeline`` to be set to ``DEBUG`` mode. See `log-levels\ndocumentation \u003chttps://docs.python.org/3/library/logging.html#logging-levels\u003e`_\nfor more info. If a module has underscore in its name, replace it with double\nunderscore in the environment variable name.\n\nTo setup a logger that is not introduced by a Thoth's component, you can set\n``THOTH_ADJUST_LOGGING`` environment variable. The format of this environment\nvariable ``THOTH_ADJUST_LOGGING`` is a comma separated list where each entry is\nmade out of a logger name and a corresponding log-level (\"``DEBUG``\",\n\"``INFO``\", \"``WARNING``\", \"``ERROR``\" as for standard Python's logging). These\ntwo are delimited by a colon, an example:\n\n.. code-block:: console\n\n  THOTH_ADJUST_LOGGING=\"flask:WARNING,alembic.migrations:ERROR\"\n\nStructured logging\n==================\n\nThe library will automatically detect when it is running inside an OpenShift\ncluster (based on ``STI_SCRIPTS_PATH`` environment variable that is inserted\ninto the container if build the container was built in an OpenShift cluster),\nIn such case, the library will setup structured logging suitable for automated\nlogs aggregation (e.g. automated logs aggregation using the ELK stack). This\nbehavior can be suppressed by setting environment variable\n``THOTH_LOGGING_NO_JSON=1``.\n\nIgnoring reports from a logger\n==============================\n\nIn some cases it's expected to turn off reporting of some logger to Sentry. You\ncan provide ``THOTH_SENTRY_IGNORE_LOGGER`` environment variable which holds a\ncomma separated list of loggers that should be ignored when reporting errors to\nSentry:\n\n.. code-block:: console\n\n  THOTH_SENTRY_IGNORE_LOGGER=\"thoth.adviser.resolver,thoth.adviser.run\"\n\n\nThis is helpful if you want to report errors to users but not to Thoth\napplication itself.\n\nIf you want some certain classes of error not to be reported to Sentry, you can\ncan provide ``THOTH_SENTRY_IGNORE_EXCEPTION`` environment variable which holds\na comma-separated list of exception classes to be ignored when reporting to\nSentry:\n\n.. code-block:: console\n\n  THOTH_SENTRY_IGNORE_EXCEPTION=\"connexion.decorators.validation,builtins.ValueError\"\n\nRemember all builtin exception classes need to be specified as in the same\nmanner as ``ValueError`` is specified above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Fcommon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoth-station%2Fcommon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Fcommon/lists"}