{"id":13577521,"url":"https://github.com/ploomber/debuglater","last_synced_at":"2025-04-05T12:30:33.287Z","repository":{"id":47544350,"uuid":"516175994","full_name":"ploomber/debuglater","owner":"ploomber","description":"Store Python traceback for later debugging. 🐛","archived":false,"fork":true,"pushed_at":"2024-01-25T01:11:22.000Z","size":98,"stargazers_count":59,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T11:24:49.779Z","etag":null,"topics":["coredump","debug","debugging","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"elifiner/pydump","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ploomber.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2022-07-21T00:42:10.000Z","updated_at":"2024-12-10T00:24:18.000Z","dependencies_parsed_at":"2023-02-12T03:05:12.671Z","dependency_job_id":null,"html_url":"https://github.com/ploomber/debuglater","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ploomber%2Fdebuglater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ploomber%2Fdebuglater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ploomber%2Fdebuglater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ploomber%2Fdebuglater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ploomber","download_url":"https://codeload.github.com/ploomber/debuglater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247338481,"owners_count":20922985,"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":["coredump","debug","debugging","python"],"created_at":"2024-08-01T15:01:22.185Z","updated_at":"2025-04-05T12:30:28.266Z","avatar_url":"https://github.com/ploomber.png","language":"Python","readme":"\u003c!-- #region --\u003e\n# `debuglater`: Store Python traceback for later debugging\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://ploomber.io/community\"\u003eCommunity\u003c/a\u003e\n  |\n  \u003ca href=\"https://share.hsforms.com/1E7Qa_OpcRPi_MV-segFsaAe6c2g\"\u003eNewsletter\u003c/a\u003e\n  |\n  \u003ca href=\"https://twitter.com/ploomber\"\u003eTwitter\u003c/a\u003e\n  |\n  \u003ca href=\"https://www.linkedin.com/company/ploomber/\"\u003eLinkedIn\u003c/a\u003e\n  |\n  \u003ca href=\"https://ploomber.io/\"\u003eBlog\u003c/a\u003e\n  |\n  \u003ca href=\"https://www.ploomber.io\"\u003eWebsite\u003c/a\u003e\n  |\n  \u003ca href=\"https://www.youtube.com/channel/UCaIS5BMlmeNQE4-Gn0xTDXQ\"\u003eYouTube\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e [!TIP]\n\u003e Deploy AI apps for free on [Ploomber Cloud!](https://ploomber.io/?utm_medium=github\u0026utm_source=debuglater)\n\n- `debuglater` writes the traceback object so you can use it later for debugging\n- Works with `pdb`, `pudb`, `ipdb` and `pdbpp`\n- You can use it to debug on a different machine, no need to have access to the source code\n\nFor support, feature requests, and product updates: [join our community](https://ploomber.io/community), subscribe to our [newsletter](https://share.hsforms.com/1E7Qa_OpcRPi_MV-segFsaAe6c2g) or follow us on [Twitter](https://twitter.com/ploomber)/[LinkedIn](https://www.linkedin.com/company/ploomber/).\n\n![demo](https://ploomber.io/images/doc/debuglater-demo/debug.gif)\n\n\n[Click here to tell your friends on Twitter!](https://twitter.com/intent/tweet?text=I%20just%20discovered%20debuglater%20on%20GitHub%3A%20serialize%20Python%20tracebacks%20for%20later%20debugging%21%20%F0%9F%A4%AF\u0026url=https://github.com/ploomber/debuglater/)\n\n[Click here to tell your friends on LinkedIn!](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/ploomber/debuglater/)\n\n## Installation\n\n```sh\n\npip install debuglater\n\n# for better serialization support (via dill)\npip install 'debuglater[all]'\n\n# ..or with conda\nconda install debuglater -c conda-forge\n```\n\n## Usage\n\n```python\nimport sys\nimport debuglater\n\nsys.excepthook = debuglater.excepthook_factory(__file__)\n```\n\nFor more details and alternative usage, keep reading.\n\n\u003c!-- #endregion --\u003e\n\n## Example\n\n```sh\n# get the example\ncurl -O https://raw.githubusercontent.com/ploomber/debuglater/master/examples/crash.py\n```\n\n```sh tags=[\"raises-exception\"]\n# crash\npython crash.py\n```\n\n\u003c!-- #region --\u003e\nDebug:\n\n```sh\ndltr crash.dump\n```\n\nUpon initialization, try printing the variables `x` and `y`:\n\n```\nStarting pdb...\n\u003e /Users/ploomber/debuglater/examples/crash.py(5)\u003cmodule\u003e()\n-\u003e x / y\n(Pdb) x\n1\n(Pdb) y\n0\n(Pdb) quit\n```\n\n*Note: you can also use:* `debuglater crash.py.dump`\n\n\u003c!-- #endregion --\u003e\n\n\u003c!-- #region --\u003e\n## Integration with Jupyter/IPython\n\n\u003e **Note**\n\u003e For an integration with papermill, see [ploomber-engine](https://github.com/ploomber/ploomber-engine)\n\nAdd this at the top of your notebook/script:\n\n```python\nfrom debuglater import patch_ipython\npatch_ipython()\n```\n\u003c!-- #endregion --\u003e\n\n```sh\n# get sample notebook\ncurl -O https://raw.githubusercontent.com/ploomber/debuglater/master/examples/crash.ipynb\n\n# install package to run notebooks\npip install nbclient\n```\n\n```sh tags=[\"raises-exception\"]\n# run the notebook\njupyter execute crash.ipynb\n```\n\nDebug:\n\n```\ndltr jupyter.dump\n```\n\nUpon initialization, try printing the variables `x` and `y`:\n\n```\nStarting pdb...\n-\u003e x / y\n(Pdb) x\n1\n(Pdb) y\n0\n(Pdb) quit\n```\n\n\n*Note: you can also use:* `debuglater jupyter.dump`\n\n## Motivation\n\nThe [Ploomber team](https://github.com/ploomber/ploomber) develops tools for\ndata analysis. When data analysis code executes non-interactively\n(example: a daily cron job that generates a report), it becomes hard to debug\nsince logs are often insufficient, forcing data practitioners to re-run the\ncode from scratch, which can take a lot of time.\n\nHowever, `debuglater` is a generic tool that can be used for any use case to facilitate post-mortem debugging.\n\n## Use cases\n\n* Debug long-running code (e.g., crashed Machine Learning job)\n* Debug multiprocessing code (generate one dump file for each process)\n\n## Credits\n\nThis project is a fork of [Eli Finer's pydump](https://github.com/elifiner/pydump).\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fploomber%2Fdebuglater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fploomber%2Fdebuglater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fploomber%2Fdebuglater/lists"}