https://github.com/seven7ty/httpdogs
Bringing you closer to your favorite HTTP Dogs.
https://github.com/seven7ty/httpdogs
dog dogs http httpdogs package pypi pypi-package python python3 python38
Last synced: 6 months ago
JSON representation
Bringing you closer to your favorite HTTP Dogs.
- Host: GitHub
- URL: https://github.com/seven7ty/httpdogs
- Owner: seven7ty
- License: mit
- Created: 2020-12-23T17:07:34.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-30T13:38:35.000Z (almost 5 years ago)
- Last Synced: 2025-03-09T18:04:43.123Z (7 months ago)
- Topics: dog, dogs, http, httpdogs, package, pypi, pypi-package, python, python3, python38
- Language: Python
- Homepage: https://pypi.org/project/httpdogs/
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# httpdogs [](https://pypi.org/project/httpdogs/) [](https://pypi.org/project/httpdogs/)
Getting URLs to your favourite HTTP dogs made easy!### Installation
Installing `httpdogs` is easy, just run `pip install httpdogs`!
### Usage
I've developed `httpdogs` to make using HTTP dogs simple and fun.
Currently, you can get your dogs using one of two functions - `dog_by_name` and `dog_by_code`
`dog_by_name(name: str)` takes in a sole parameter - `name`, which is the status code name to get a dog for.
Upon finding a dog matching the name, it returns an `HTTPDog` object. Here's an example -```py
from httpdogs import dog_by_namemy_dog = dog_by_name("Success")
print(f"My dog has a code of {my_dog.code} and means {my_dog.name}! The URL is {my_dog.url}")
# Prints -
# My dog has a code of 200 and means Success! The URL is https://http.dog/200
````dog_by_code(code: int)` is extremely similar to `dog_by_name`, just using a status code value.
Upon finding a dog matching the code, it returns an `HTTPDog` object. Here's an example -```py
from httpdogs import dog_by_codemy_dog = dog_by_code(404)
print(f"My dog has a code of {my_dog.code} and means {my_dog.name} :( The URL is {my_dog.url}")
# Prints -
# My dog has a code of 404 and means Not Found :( The URL is https://http.dog/404
```##### The HTTPDog object also has an `image` attribute
You can use this attribute to get the image bytes associated with the dog.
You can then save it or view it, like in the example below -```py
from httpdogs import dog_by_code
from PIL import Image
from io import BytesIOmy_dog = dog_by_code(302)
dog_image = Image.open(BytesIO(my_dog.image))
dog_image.show()# Output below -
```
### Contributing
This package is opensource so anyone with adequate python experience can contribute to this project!
### Report Issues
If you find any errors/bugs/mistakes with the package or in the code feel free to create an issue and report them [here.](https://github.com/itsmewulf/httpdogs/issues)### Fix/Edit Content
If you want to contribute to this package, fork the repository, make your changes and then simply create a Pull Request!### Contact
If you want to contact me -
**Mail -** ```wulf.developer@gmail.com```
**Discord -** ```wulf#9716```