Package: aplustools
aplustoolsDescriptionaplustools is a simple, user-friendly Python library for performing amazing tasks. It simplifies complex processes, allowing you to achieve more with less code. Developed with a focus on ease of use and efficiency, aplustools is the go-to solution for Python developers looking to enhance their projects.FeaturesEasy to useHighly efficientSupports multiple platformsRegular updates and supportComprehensive documentationInstallationYou can install aplustools via pip:pipinstallaplustoolsOr clone the repository and install manually:gitclonehttps://github.com/Adalfarus/aplustools.gitcdaplustools
python-mbuildUsageHere are a few quick examples of how to use aplustools:Search Engine usagefromaplustools.webimportwebtoolsaswt# Call the `google_search` with a queryresult=wt.search.google_provider.google_search("Cute puppies",wb.get_useragent(),1)# Print the resultprint(result)Loggerfromaplustools.ioimportenvironmentasenvfromaplustools.ioimportloggers# Set the current working directory to the main script or executableenv.set_working_dir_to_main_script_location()# Create an instance of Loggerp_logger=loggers.PrintLogger("my_logs_file.log",show_time=True,capture_print=False,overwrite_print=True,print_passthrough=False,print_log_to_stdout=True)# Shows the time in the logs (Like this [12:33:21]) and overwrites the normal sys.stdout# Call the `monitor_stdout` method and pass the logger object, this will overwrite sys.stdout from Text I/O to the logger objectlogger=loggers.monitor_stdout(logger=p_logger)# Return sys.stdout, so you can make sure it worked# Log somethingp_logger.log("Hello, world!")# Print something, it won't get captured or displayedprint("Hello, beautiful world!")# Close the Logger object (returns sys.stdout to it's normal state)p_logger.close()OnlineImagefromaplustools.utilsimportimagetoolsfromaplustools.io.environmentimportPath# Download the image to the current working directoryimagetools.OnlineImage("someImage.url",True)# Making sure that folder_path existsfolder_path=Path(".\\images")folder_path.create_directory()# Converting the image and moving it to a specified pathimage=imagetools.OfflineImage("data:image/jpeg;base64,/9j...")success=image.base64(str(folder_path),"Image","png")# Make sure this directory exists# Download the image to a specified pathimage2=imagetools.OnlineImage("someImage.url")_,img_name,img_path=image.download_image(str(folder_path))# Make sure this directory existsGit-Updaterfromaplustools.dataimportupdatersfromaplustools.io.environmentimportset_working_dir_to_main_script_location,Pathimportosimportthreadingimportsysset_working_dir_to_main_script_location()__version__="0.0.1"# Initialize an updaterupdater=updaters.gitupdater("exe")latest_version=updaters.get_latest_version("Adalfarus","unicode-writer")[1]# Gives back two values, use whichever applicable# Check if an update is neededifnotupdaters.gitupdater.compare_release_numbers(__version__,latest_version):sys.exit()# Define the arguments for the updater methodhost,port,path="localhost",1264,Path(os.path.join(updaters.get_temp(),"update")gui_toggle,cmd_toggle=False,Falsepath.create_directory()update_args=(os.path.join(os.getcwd(),"update"),str(path),latest_version,"Adalfarus","unicode-writer",gui_toggle,cmd_toggle,host,port)# Start the update in a seperate threadupdate_thread=threading.Thread(target=updater.update,args=update_args)update_thread.start()# Receive the update status generator and print themprogress_bar=1foriinupdater.receive_update_status(host,port):print(f"{i}%",end=f" PB{progress_bar}\n")ifi==100:progress_bar+=1# Switch to second progress bar, when the downloading is finishedWebtools...# Continuing the first example# Print the resultprint(result)fromaplustools.web.webtoolsimportcheck_url,is_crawlableimportrequestsifcheck_url(result,''):# Not really nessesary, search does this automaticallyresponse=requests.get(result)...Environment...# Continuing the image example_,img_name,img_path=image.download_image(str(folder_path))# Make sure this directory existsfromaplustools.io.environmentimportabsolute_path,remv,copyfromaplustools.childsplayimportImportClass# Could be switched out to adultswork, but the string would need to get convertedimporter=ImportClass(hard=True)importer.import_all()# Destroys your runtime pythona_imgpath=absolute_path(img_path)try:copy(a_imgpath,str(folder_path)+str(img_name).remove(".png")+str(" - Copy.png"))exceptValueError:copy(a_imgpath,str(folder_path)+str(img_name.split(".")[-1])+str(" - Copy.png"))remv(a_imgpath)# Remove the original imageremv(str(folder_path))# Remove the base directoryFakerfromaplustools.data.fakerimportTestDataGeneratortest_data=TestDataGenerator()print(test_data.generate_random_identity())print("\n",end="")print(test_data.generate_random_name())print(test_data.generate_random_email())print(test_data.generate_random_password())print(test_data.generate_random_phone_number())print(test_data.generate_random_address())print(test_data.generate_random_birth_date())Dummyfromaplustools.utils.dummyimportDummy3# Dummy3 is for Python 3importmath,sysdummy=Dummy3()# Do a bunch of operations that would normally throw errorsdummy.attr.func("",int3="")dummy["Hello"]deldummy[1]reversed(dummy)"Dummy"indummydummy.keys()dummy.keys=["1"]print(dummy.keys+dummy)+dummy-dummy~dummyhash(dummy)abs(dummy)round(dummy)complex(dummy)oct(dummy)repr(dummy)bytes(dummy)format(dummy,"DD")math.trunc(dummy)dummy<<dummydummy>>dummydummy-=1_000_000num=1num*=dummyifdummy:print(True)else:print(False)forxindummy:print(x)type(dummy)print(dummy,"->",int(dummy),list(dummy),tuple(dummy),float(dummy))Hasherfromaplustools.utils.hasherimporthashed_latest,hashed_wrapper_latest,reducer,big_reducer,num_hasherinp="Hello beautiful world, how are you today, lovely star?"inp2="Hello World, kitty"desired_length=64hashed_inp=hashed_wrapper_latest(inp,desired_length,hash_func=hashed_latest)hashed_inp2=hashed_wrapper_latest(inp2,desired_length,hash_func=hashed_latest)print(f"{inp}({len(inp)}) ->{hashed_inp}({len(hashed_inp)})\n{inp2}({len(inp2)}) ->{hashed_inp2}({len(hashed_inp2)})")num_hashed_inp=num_hasher(inp,desired_length)num_hashed_inp2=num_hasher(inp2,desired_length)print(f"{inp}({len(inp)}) ->{num_hashed_inp}({len(num_hashed_inp)})\n{inp2}({len(inp2)}) ->{num_hashed_inp2}({len(num_hashed_inp2)})")acceptable_chars=range(100,200)num_hashed_inp_uni=num_hasher(inp,desired_length,acceptable_chars)num_hashed_inp_uni=num_hasher(inp2,desired_length,acceptable_chars)print(f"{inp}({len(inp)}) ->{num_hashed_inp_uni}({len(num_hashed_inp_uni)})\n{inp2}({len(inp2)}) ->{num_hashed_inp_uni}({len(num_hashed_inp_uni)})")(Correct shortform for aplustools is apt, so please useimport aplustools as aptfor consistency)For more detailed usage and examples, check out ourdocumentation.Naming convention, dependencies and morePEP 8 -- Style Guide for Python CodeFor modules I use 'lowercase', classes are 'CapitalizedWords' and functions and methods are 'lower_case_with_underscores'.Dependencies (except standart libraries) are:adultswork - datetimechildsplay - datetimedata.database - noneio.environment - nonedata.gitupdater-cmd & data.integrated-gitupdater-cmd - requestsdata.gitupdater-gui & data.integrated-gitupdater-gui - requests, PySide6data.gitupdater - requestsutils.imagetools - Pillowio.loggers - nonedata.updaters - requestsweb.webtools - requests, duckduckgo_search, bs4 - duckduckgo_search is only used for Search.duckduckgo_provider, if you don't want to use it use Search._duckduckgo_provider instead.utils.genpass - pycryptodome, richutils.mappers - noneweb.new_webtools - requests, duckduckgo_search, bs4 - duckduckgo_search is only used for Search.duckduckgo_provider, if you don't want to use it use Search._duckduckgo_provider instead.ContributingWe welcome contributions! Please see ourcontributing guidelinesfor more details on how you can contribute to aplustools.Fork the repositoryCreate your feature branch (git checkout -b feature/AmazingFeature)Commit your changes (git commit -m 'Add some AmazingFeature')Push to the branch (git push origin feature/AmazingFeature)Open a pull requestLicenseaplustools is licensed under the GPL-3.0 License - see theLICENSEfile for details.