{"id":15593747,"url":"https://github.com/seven7ty/httpcats","last_synced_at":"2025-04-12T10:31:07.501Z","repository":{"id":57437673,"uuid":"309802432","full_name":"seven7ty/httpcats","owner":"seven7ty","description":"Bringing you closer to your favorite HTTP Cats.","archived":false,"fork":false,"pushed_at":"2020-11-10T19:10:15.000Z","size":36,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T05:22:45.015Z","etag":null,"topics":["cat","cats","http","httpcats","package","pypi","pypi-package","python","python3","python38"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/httpcats/","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/seven7ty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-03T20:42:49.000Z","updated_at":"2024-05-19T12:46:01.000Z","dependencies_parsed_at":"2022-09-19T01:10:09.631Z","dependency_job_id":null,"html_url":"https://github.com/seven7ty/httpcats","commit_stats":null,"previous_names":["paulnewcomer/httpcats","itsmewulf/httpcats","bwv2/httpcats","seven7ty/httpcats"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seven7ty%2Fhttpcats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seven7ty%2Fhttpcats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seven7ty%2Fhttpcats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seven7ty%2Fhttpcats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seven7ty","download_url":"https://codeload.github.com/seven7ty/httpcats/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248553008,"owners_count":21123355,"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":["cat","cats","http","httpcats","package","pypi","pypi-package","python","python3","python38"],"created_at":"2024-10-03T00:21:16.687Z","updated_at":"2025-04-12T10:31:07.151Z","avatar_url":"https://github.com/seven7ty.png","language":"Python","readme":"# httpcats [![Badge](https://img.shields.io/pypi/v/httpcats?color=3776AB\u0026logo=python\u0026style=for-the-badge)](https://pypi.org/project/httpcats/) [![Badge 2](https://img.shields.io/pypi/dm/httpcats?color=3776AB\u0026logo=python\u0026style=for-the-badge)](https://pypi.org/project/httpcats/)\r\nGetting URLs to your favourite HTTP Cats made easy!\r\n\r\n\r\n### Installation\r\n\r\nInstalling `httpcats` is easy, just run `pip install httpcats`!\r\n\r\n### Usage\r\n\r\nI've developed `httpcats` to make using HTTP Cats simple and fun.\r\n\r\nCurrently, you can get your cats using one of two functions - `cat_by_name` and `cat_by_code`\r\n\r\n`cat_by_name(name: str)` takes in a sole parameter - `name`, which is the status code name to get a cat for.\r\nUpon finding a cat matching the name, it returns an `HTTPCat` object. Here's an example -\r\n\r\n```py\r\nfrom httpcats import cat_by_name\r\n\r\nmy_cat = cat_by_name(\"Success\")\r\n\r\nprint(f\"My cat has a code of {my_cat.code} and means {my_cat.name}! The URL is {my_cat.url}\")\r\n# Prints - \r\n# My cat has a code of 200 and means Success! The URL is https://http.cat/200\r\n```\r\n\r\n`cat_by_code(code: int)` is extremely similar to `cat_by_name`, just using a status code value.\r\nUpon finding a cat matching the code, it returns an `HTTPCat` object. Here's an example -\r\n\r\n```py\r\nfrom httpcats import cat_by_code\r\n\r\nmy_cat = cat_by_code(404)\r\n\r\nprint(f\"My cat has a code of {my_cat.code} and means {my_cat.name} :( The URL is {my_cat.url}\")\r\n# Prints - \r\n# My cat has a code of 404 and means Not Found :( The URL is https://http.cat/404\r\n```\r\n\r\n##### The HTTPCat object also has an `image` attribute\r\n\r\nYou can use this attribute to get the image bytes associated with the cat.\r\nYou can then save it or view it, like in the example below -\r\n\r\n```py\r\nfrom httpcats import cat_by_code\r\nfrom PIL import Image\r\nfrom io import BytesIO\r\n\r\nmy_cat = cat_by_code(302)\r\n\r\ncat_image = Image.open(BytesIO(my_cat.image))\r\ncat_image.show()\r\n\r\n# Output below -\r\n```\r\n\r\n\u003cimg src=\"https://http.cat/302\" alt=\"Cat\" width=\"300\"/\u003e\r\n\r\n### Contributing \r\n\r\nThis package is opensource so anyone with adequate python experience can contribute to this project!\r\n\r\n### Report Issues\r\nIf you find any error/bug/mistake with the package or in the code feel free to create an issue and report it [here.](https://github.com/itsmewulf/httpcats/issues)\r\n\r\n### Fix/Edit Content\r\nIf you want to contribute to this package, fork the repository, make your changes and then simply create a Pull Request!\r\n\r\n### Contact\r\nIf you want to contact me -\u003cbr\u003e\r\n**Mail -** ```wulf.developer@gmail.com```\u003cbr\u003e\r\n**Discord -** ```wulf#9716```\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseven7ty%2Fhttpcats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseven7ty%2Fhttpcats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseven7ty%2Fhttpcats/lists"}