{"id":17161908,"url":"https://github.com/gkbrk/bunnylog-py","last_synced_at":"2025-03-24T15:44:18.231Z","repository":{"id":62560527,"uuid":"191841545","full_name":"gkbrk/bunnylog-py","owner":"gkbrk","description":"Parse BunnyCDN log files with Python","archived":false,"fork":false,"pushed_at":"2019-06-13T22:38:08.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T00:37:35.304Z","etag":null,"topics":["bunnycdn","cdn","log","parser"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gkbrk.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}},"created_at":"2019-06-13T22:31:19.000Z","updated_at":"2022-08-16T08:48:44.000Z","dependencies_parsed_at":"2022-11-03T14:30:43.828Z","dependency_job_id":null,"html_url":"https://github.com/gkbrk/bunnylog-py","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/gkbrk%2Fbunnylog-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkbrk%2Fbunnylog-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkbrk%2Fbunnylog-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkbrk%2Fbunnylog-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gkbrk","download_url":"https://codeload.github.com/gkbrk/bunnylog-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245302290,"owners_count":20593352,"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":["bunnycdn","cdn","log","parser"],"created_at":"2024-10-14T22:44:11.170Z","updated_at":"2025-03-24T15:44:18.210Z","avatar_url":"https://github.com/gkbrk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"  - [NAME](#NAME)\n  - [SYNOPSIS](#SYNOPSIS)\n  - [DESCRIPTION](#DESCRIPTION)\n  - [MODEL](#MODEL)\n      - [LogEntry](#LogEntry)\n  - [INTERFACE](#INTERFACE)\n      - [parse\\_line](#parse_line)\n\n# NAME\n\nbunnylog - Python module to parse BunnyCDN log files\n\n# SYNOPSIS\n\n``` \n  import bunnylog\n\n  bw = 0\n\n  with open('server.log') as logfile:\n    for line in logfile:\n      log = bunnylog.parse_line(line)\n\n      bw += log.length\n\n  print(f\"Used {bw} bytes of bandwidth\")\n```\n\n# DESCRIPTION\n\nThis module aims to parse the log files generated by BunnyCDN. You can\nthen take these and input them to your database or convert them to other\nlog formats.\n\n# MODEL\n\n## LogEntry\n\nThis module parses the log entries into *LogEntry* objects. Each object\nhas the following values.\n\n  - **hit** - *bool*  \n    This value indicates if a request was a cache hit\n\n  - **status\\_code** - *int*  \n    The status code returned by the server\n\n  - **timestamp** - *int*  \n    The timestamp of the request\n\n  - **length** - *int*  \n    The length of the response in bytes\n\n  - **pull\\_server** - *str*  \n    The ID of the pull server on BunnyCDN\n\n  - **ip** - *str*  \n    The IP address of the visitor\n\n  - **referrer** - *str*  \n    The referrer page, indicated by the referer header\n\n  - **url** - *str*  \n    The URL for the request\n\n  - **cdn\\_country** - *str*  \n    The country code for the CDN node that served this request\n\n  - **user\\_agent** - *str*  \n    The User-Agent header of the request\n\n  - **content\\_hash** - *str*  \n    The hash of the content that was sent to the client\n\n  - **visitor\\_country** - *str*  \n    The country code of the visitor\n\n# INTERFACE\n\n## parse\\_line\n\nTakes a log line as a string and returns a parsed LogEntry.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkbrk%2Fbunnylog-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgkbrk%2Fbunnylog-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkbrk%2Fbunnylog-py/lists"}