Package: requestez
RequestEZRequestEZ is a Python library that simplifies web scraping, provides basic parsing utilities, AES encryption/decryption, and some useful logging utilities.InstallationYou can install RequestEZ usingpip. Make sure you have Python 3.9 or later installed.pipinstallrequestezUsage1. Basic Web Scraping:RequestEZ provides a simple interface for making HTTP requests. You can create a session and use it to fetch web pages.fromrequestezimportSessionsession=Session()response:str=session.get("https://example.com")# refer to inline documentation for more optionsprint(response)2. AES Encryption/Decryption:You can use RequestEZ to perform AES encryption and decryption of data.fromrequestez.encryptionimportaes_enc,aes_deckey:bytes=b"your_32_byte_secret_key"iv:bytes=b"your_16_byte_initialization_vector"data:str="your_data_to_encrypt"encrypted_data:str=aes_enc(key,iv,data)decrypted_data:str=aes_dec(key,iv,encrypted_data)print("Encrypted:",encrypted_data)print("Decrypted:",decrypted_data)# you need to do from requestez.encryption.unpack import PACKER to find and decrypt p.a.c.k.e.r. encrypted data# read code to find out more3. Parsing Utilities:RequestEZ provides some basic parsing utilities. You can use them to parse HTML, JSON, and XML data.fromrequestez.parsersimporthtml,loadhtml_data="<html><body><h1>Hello World</h1></body></html>"json_data='{"name": "John Doe", "age": 30}'# Parse HTML dataparsed_html=html(html_data)# returns a BeautifulSoup object# Parse JSON dataparsed_json=load(json_data)# returns a dict if valid json otherwise returns the string itsefThere are other parsing utilities available as well. Please read the inline documentation for those.
some of them arem3u8_masterfor parsing a M3U8 master playlistm3u8for parsing M3U8 data > returnsm3u8.parse(playlist)reg_replacebasicallyre.subjust don't have to import resecondsToReadfor converting seconds to human-readable format likex day(s) x hour(s)...secondsToTimefor converting seconds to(DD):HH:MM:SSformatstringifyfor converting a dict to a string with optional escapingloadfor loading JSON data which can handle escaped json but is iterative to handle escaped json4. Logging Utilities:RequestEZ provides some useful and colorful logging utilities. You can use them to log data to a file or to the console.# it works similar to the logging module but with some extra features# Logging to a file not supported yet# Color compatibility depends on the terminal# Works on windows cmd, powershell, and linux terminal (tested)# others not testedimporttimefromrequestez.helpersimportlog,set_log_level,pbarset_log_level("debug")log("Hello World",color="green",log_level="debug")# logs hello worldset_log_level("info")# sets log level to debuglog("Hello World",color="green",log_level="info")# logs red hello world to consolelog("Hello World",color="red",log_level="debug")# logs nothing to console# Refer to inline documentation for more optionsprogress_printer=pbar(total=10,prefix='Progress:',suffix='',length=35,color="green",unit="seconds")foriinrange(11):time.sleep(1)# Simulate some workprogress_printer.update(i)# it is equivalent to# progress_printer.update(plus=1) -> this is done by default in the tqdm module# Refer to inline documentation for more optionsthe order of level priority is as follows:priority level (alias)CRITICAL (c)ERROR (e)WARNING (w)INFO (i)DEBUG (d)