Package: team13hackertype
Team 13 - HackertypeA little exercise to create a Python package, build it, test it, distribute it, and use it. Seeinstructionsfor details.Team MembersKedan ZhaBruce WuEvan HuangAmaan KhwajaProject DescriptionHackertype lets you pretend you are the elite hacker you always you knew you were in your heart of hearts, right from the CLI.CLI ToolsHackertypepython-mteam13hackertypehackertype<language:[python|java]>Run the classic hackertype app from the old internet days. Press keys to generate programming snippets from the given language and pressescto finish. Currently supported languages arepythonandjava.Penetratepython-mteam13hackertypepenetrate<language><text:optional>Simulate a penetration hack. The program will display your text in a scary looking font before launching into hackertype of your given language. The supported language and usage is the same as hackertype. When done, the program will tell you that you are logging out.Helppython-mteam13hackertype-hView a description of the functions and the parameters provided by the package.Happy hacking!Usage in a Python projectWhile hackertype is meant to be, for the most part, a fun, whimsical command line app, there are a few functionalities that may be imported into your project.hackertype.looping_stringlooping_string(string:str,chunk_size:int)->Iterator[str]Creates an iterator that loops over a string forever. Each iteration returns the next chunk of the string of length 'chunk_size'.Parametersstring: strThe string that is being looped.chunk_size: intThe size of the substring that is returned.ReturnsIterator[str]An iterator of substrings ofstringwhere each substring has sizechunk_size. This iterator has no stop.hackertype.get_code_snippetget_code_snippet(language:str)->strGiven a coding language, returns a large code snippet written in that language as a string. Currently, supported values for lanuage are'python'and'java'. The code snippet for Python was borrowed fromTensorFlowand the snippet for Java was borrowed fromSpring.Parameterslanguage: 'python' | 'java'The language of the code snippet.ReturnsstrThe code snippet written in thelanguageprogramming language.RaisesNotImplementedErrorRaised if we do not have a snippet for the language provided. Right now, we support python and java.IOErrorRaised if there was another IO problem with opening the file.ExceptionRaised for any other miscellaneous exceptions occuring when opening the file.hackertype.hackertypehackertype(language:str,speed:int=20)->NoneStarts listening for keyboard presses. On key press, prints outspeedamount of characters from a code snippet written in thelanguagecoding language, until theEsckey is pressed. Note that this function isnotasynchronous. This means that after running, it will wait for theEsckey before continuing program execution.Parameterslanguage: 'python' | 'java'The coding language of the hacker snippet to be printed.Supported values include'python'and'java'.speed: int, optional, default: 20The number of characters to print out on a single key press.ReturnsNoneRaisesSame ashackertype.get_code_snippet.penetrate.penetratepenetrate(language:str,text:str="DARKWEB",loading_bar_speed:float=1.0,emphasis_style:str="bold red",notification_style:str="bold green")->NoneSimulates a penetration hacking attempt in the standard output. Logs outtextin ASCII text before launching into hackertype. Upon escaping, displays a logging out message. Note that this function utilizeshackertype.hackertypeand is alsonotasynchronous.Parameterslanguage: strThe coding language of the hacker type to be printed.Supported values include'python'and'java'. Seehackertype.hackertype.text: str, optional, default: "DARKWEB"The text shown in the banner. Length of string must be less than 8.loading_bar_speed: float, optionalThe speed of loading bar progress.emphasis_style: str, optional, default: "bold red"The style for Console print of emphasized text. For options, seeRich docs.notification_style: str, optional, default: "bold green"The style for Console print of emphasized text, used inshow_header. For options, seeRich docs.ReturnsNoneRaisesNotImplementedErrorRaised if we do not have a snippet for the language provided. Right now, we support python and java. Seehackertype.hackertype.ValueErrorRaised if the given style is not provided.ExceptionUnexpected exception that may arise from IO or console issues.Example UsageView an example usage of the functionshere.Contributing RunbookClone the project. (git clone https://github.com/software-students-fall2022/python-package-exercise-project-3-team-13.git)Change directories into the project. (cd python-package-exercise-project-3-team-13)Set up and activate your virtual environment. (python -m venv venv && source venv/bin/activate)Install the requirements. (python -m pip install -r requirements.txt)The package is now available to you insrc/team13hackertype.Run the tests. (python -m pytest ./tests)To build, runpython -m build.