{"id":13502099,"url":"https://github.com/lobocv/crashreporter","last_synced_at":"2025-04-14T10:04:15.478Z","repository":{"id":32467203,"uuid":"36047075","full_name":"lobocv/crashreporter","owner":"lobocv","description":"Store and send crash reports directly to the devlopers","archived":false,"fork":false,"pushed_at":"2021-03-19T21:29:18.000Z","size":739,"stargazers_count":73,"open_issues_count":6,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T23:13:02.183Z","etag":null,"topics":["bug-tracker","bugreport","crash-reports","developer-tools","python"],"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/lobocv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-22T02:06:21.000Z","updated_at":"2024-06-07T09:31:40.000Z","dependencies_parsed_at":"2022-08-30T10:11:32.006Z","dependency_job_id":null,"html_url":"https://github.com/lobocv/crashreporter","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobocv%2Fcrashreporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobocv%2Fcrashreporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobocv%2Fcrashreporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobocv%2Fcrashreporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lobocv","download_url":"https://codeload.github.com/lobocv/crashreporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246258864,"owners_count":20748573,"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":["bug-tracker","bugreport","crash-reports","developer-tools","python"],"created_at":"2024-07-31T22:02:01.749Z","updated_at":"2025-03-29T23:32:58.618Z","avatar_url":"https://github.com/lobocv.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"CrashReporter\n=============\n\nCrashReporter creates reports from the traceback if your python code crashes. The reports can be uploaded directly\nto the developers via email or web server. If no internet connection is available, crash reporter stores offline reports\nand later sends them when possible.\n\n\nFeatures\n--------\nFeatures of crashreporter include:\n\n    - Uploading of crash reports via email or to a web server (HQ).\n    - Offline crash reporting that stores crash reports until they are uploaded.\n    - Traceback and variable inspection output\n\n\nInstallation\n------------\nTo install:\n\n    pip install crashreporter\n\n\nUsage\n-----\n\nImplementing the crash reporter is easy. Just create a CrashReporter object. Configure the SMTP or HQ accounts for\nuploading of reports (optional) and you are good to go!\n\nIn the following example, we wil create a Person class that has an optional age  attribute. We will then create two\nPerson objects, one with an age and one without. When we attempt to combine their ages we get the following error:\n\n    TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'\n\n\nexample.py\n\n```python\n    \n    from crashreporter import CrashReporter\n    \n    class Person(object):\n    \n        def __init__(self, name, age=None):\n            self.name = name\n            self.age = age\n    \n    def combine_ages(person_a, person_b):\n        a_local_variable = 134\n        return person_a.age + person_b.age, Person.__name__\n    \n    if __name__ == '__main__':\n        # Note I have used a configuration file for setting up SMTP and HQ accounts but you can also call functions\n        # cr.setup_smtp() and cr.setup_hq() with your credentials to configure SMTP/HQ respectively.\n        cr = CrashReporter(report_dir='/home/calvin/crashreporter',\n                           check_interval=10,\n                           config='./crashreporter.cfg')\n    \n        cr.application_name = 'My App'\n        cr.application_version = '1.1.350'\n    \n        calvin = Person('calvin', age=25)\n        bob = Person('bob')\n        combine_ages(calvin, bob)\n    \n        while 1:\n            pass\n\n```\n\nWhen the crash occurs, the crash reporter will attempt to send it by email or upload it to the HQ server, if both methods\nfail, the crash is written to file in `report_dir`. The next time the script is run, the crash reporter will look for\nany offline reports and attempt to send them every `check_interval` seconds. After a sucessful upload, the stored reports\nare deleted.\n\n\nConfiguration File\n------------------\nIf you don't want to keep your SMTP and HQ credentials in your scripts you can alternatively use a configuration file.\nSimple pass the path to the configuration file as the `config` argument in CrashReporter or call the `load_configuration(path)`\nmethod with the path. The format of the configuration file should have two sections, SMTP and HQ. Under each section are parameters\nthat are passed to the setup_smtp and setup_ftp functions:\n\nExample:\n\n    [SMTP]\n    user = mycrashreporter@gmail.com\n    passwd = mypasswordissupersecret\n    recipients = developer1@gmail.com, developer2@gmail.com\n    host = smtp.gmail.com\n    port = 587\n\n    [HQ]\n    api_key = ar923086wkjsldl235dfgdf32\n    server = http://www.crashreporter-hq.com\n\n\n\nAttributes\n----------\n\nThe CrashReporter has several attributes that can be changed:\n\n    offline_report_limit:\n            The maximum number of offline reports to save before overwriting\n            the oldest report.\n\n    application_version:\n            Application version as a string to be included in the report.\n\n    application_name:\n            Application name as a string to be included in the report.\n\n    source_code_line_limit:\n            The number of source code lines to include before and after the error\n            as a tuple (before, after)\n\n\n\n\n\nExample Report\n--------------\n\n![alt tag](https://raw.githubusercontent.com/lobocv/crashreporter/master/example.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flobocv%2Fcrashreporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flobocv%2Fcrashreporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flobocv%2Fcrashreporter/lists"}