Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avifenesh/theanimalprinter
scrape wiki page, and find all the animal in it, for each, download his pic, and output the name, Collateral adjective and local path to the img, into html file
https://github.com/avifenesh/theanimalprinter
Last synced: 2 days ago
JSON representation
scrape wiki page, and find all the animal in it, for each, download his pic, and output the name, Collateral adjective and local path to the img, into html file
- Host: GitHub
- URL: https://github.com/avifenesh/theanimalprinter
- Owner: avifenesh
- Created: 2022-07-06T11:51:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-07T05:25:27.000Z (over 2 years ago)
- Last Synced: 2024-02-19T07:25:55.111Z (9 months ago)
- Language: Python
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## How to use:
you can find the requirements for create the env file in the requirements.txt file
the program take url path as an argument, check for animal table there, for
each animal download the relevant image into tmp folder, and output the
name, the collateral adjective and the local path to the image.Im trying to avoid comment in my code and write self-explained code instead.
I've been trying to do that in this project also.
I'll explain the code here and the train of thought, in case that it doesnt
clear in the code itself.The main file take the arguments from the user, validate it and provide it to
the printer functionThe printer function is the big-boss function, that call to the other
function to do there job in their timefirst we create the file and directory we'll need for later - the tmp directory
and the html file with some opening contentUsing requests and bs4 the program get the html from the page and process it
"find table" function find the desirable table, by searching for the
key-word in the headeroutput_animals_and_pic function go over the table find the data we looking for
and create threads-array of download-pic and output to html file processesthen we run all the threads and letting the user know that everything worked
finein the tests file i've created few unit-test to check the small parts work
fine and can handle with edge-casesthat about all, more or less