Package: txtstr
TxtStrEdit text file, encrypt and decrypt with python!Explore the docs »Report Bug·Request FeatureAbout The ProjectIf you want the explanation ask me inTwitchlinkRelease notesHi!, the new update oftxtstrbrings new commands that were necessary for this library to be useful, some commands have been modified to make it even easier to obtain the information they give you, below you will see the list of new and updated commands, Thanks so much for welcomingtxtstr, good luck coding!Bug fixWe have fixed a bug that causes the word encrypt to be displayed in the console while decrypting, all fixed!Getting StartedPrerequisitesYou need to make sure you have installed the following modules.The requirements are installed automatically, but for any errors here are the commands to install each dependencyCryptographypipinstallcryptographyDocxpipinstalldocxFpdfpipinstallfpdfInstallationpipinstalltxtstrUsagetxtstr.__init__()importtxtstrtxtstr.__init__()This starts all the functions to encrypt and decrypt the txt files, it creates a folder for you and the decryption key also starts the modulestxtstr.newkey(name)importtxtstrtxtstr.newkey(name)Create a new UNIQUE key to be able to encrypt and decrypt the files if you want someone to decrypt your files you have to pass them this keytxtstr.loadkey(name)importtxtstrkey=txtstr.loadkey(name)print(key)Here you can see your UNIQUE key to share it and use it in your programs when you think it is necessarytxtstr.encrypt(file, CUSTOM_KEY, times)importtxtstrfile="file.txt"txtstr.encrypt(file,None,5)That this function can encrypt your file, the FILE section is where you can find the path of your .TXT file, CUSTOM_KEY if you put None it is because you want to use the default txtstr key, it is always advisable to create yours beforehand, to locate yours just type the name of the key (if it is in the same folder), but if it is in another folder, use the path of said file. Remember not to lose these keys since without this it will be IMPOSSIBLE to decrypt it. TIMES indicates the number of times you want this file to be encrypted remember the number as it will be the same number of times to decrypt them.txtstr.decrypt(file, CUSTOM_KEY, times)importtxtstrfile="file.txt"txtstr.decrypt(file,None,5)Here you can decrypt your file, the FILE section is for the path of your file and the CUSTOM_KEY if you put None it is because you want to use the default txtstr key, it is always advisable to create yours beforehand, to locate yours just type the name of the key (if it is in the same folder), but if it is in another folder, use the path of said file. TIMES here you must put the number of times you want to decrypt it this must be the same as the time you encrypted it.txtstr.write(name,text,add)importtxtstrtext="the develpoer of txtstr is the best UnU"name="isTRUE"txtstr.write(name,text,True)If ADD is True the text will be added to the file but if it is False it will be rewrittentxtstr.newtxt(name)importtxtstrname="file.txt"txtstr.newtxt(name)This will create a new text file, you can change the name to an address where this file will be savedtxtstr.search(name,searchfor,advanced)importtxtstrname="file.txt"searchfor="hi"info=txtstr.search(name,searchfor,True)If ADVANCED isTrue, you must define asingle variableas in this case "info" will return a dictionary where "isin" is if it was found, "quantity" is the number of times it appears, "linesamount" the number of lines your file has, "lineappear" is a list where you will find the line number where it is locatedimporttxtstrname="file.txt"searchfor="hi"IsIn,quantity,linesamount,lineappear=txtstr.search(name,searchfor,False)If ADVANCED isFalse, you must definethree variables to give the following values​​"isin" is if it was found, "quantity" is the number of times it appears, "linesamount" the number of lines your file has, "lineappear" is a list where you will find the line number where it is locatedtxtstr.read(file)importtxtstrfile="file.txt"text=txtstr.read(file)print(text)txtstr.readlines(file)importtxtstrfile="file.txt"text=txtstr.readlines(file)print(lines)This is similar totxtstr.read()but here each line of your file will be saved to a list remember that it starts counting from zero if you want to print a specific line you can doprint(lines[ 10])txtstr.addline(name,line)importtxtstrline="Hi ty for supporting txtstr!"txtstr.addline(name,line)txtstr.rename(file,new_name)importtxtstrfile="file.txt"new_name="txtstr"txtstr.rename(file,new_name)Experimental functionstxtstr.toword(file)importtxtstrfile="file.txt"txtstr.toword(file)txtstr.topdf(file)importtxtstrfile="file.txt"txtstr.topdf(file)txtstr.checkupdate()importtxtstrtxtstr.checkupdate()With this you can automatically install any new version oftxtstrLicenseDistributed under the MIT License. SeeLICENSEfor more information.ContactDiscord:PingüiMaya14#2055WebSite:pingui.tk