Package: enkanetworkcard
Русская версия|Example|DiscordEnkaNetworkCardWrapper forEnkaNetwork.pyto create character cards in Python.Full Documentation:En:Documentation ENNavigationInstallationDependenciesLaunchRunning AsyncFix bug with asyncGet a character showcaseDescription of argumentsLanguages SupportedSample ResultsInstallation:pip install enkanetworkcardOr you can copy the given repository.Dependencies:Dependencies that must be installed for the library to work:PillowrequestsiomaththreadingdatetimerandomenkanetworkloggingLaunch:fromenkanetworkcardimportencbannerENC=encbanner.EnkaGenshinGeneration()result=ENC.start(uids=724281429)print(result)Running Async:fromenkanetworkcardimportaioenkbannerimportasyncioasyncdefcard():ENC=aioenkbanner.EnkaGenshinGeneration()returnawaitENC.start(uids=724281429)result=asyncio.run(card())print(result)Thank you for this example and advice:Gaurav MandalFix bug with async:Windows users may experience an error:RuntimeError: Event loop is closedif this occurs, then you must set the variableFIX_ASYNCIO_WIN = TrueExamplefromenkanetworkcardimportencbannerENC=encbanner.EnkaGenshinGeneration()ENC.FIX_ASYNCIO_WIN=TrueGet a character showcase:profile- A useful feature for bot developers. Get information about the characters from the showcase, for their further use.ExamplefromenkanetworkcardimportencbannerENC=encbanner.EnkaGenshinGeneration()resultProfile=ENC.profile(uid=724281429,image=False)result=ENC.start(uids=724281429,name=resultProfile["charactersArg"])print(result)Function:profilereturns:characters,charactersArg,imgcharacters- Information about each character.charactersArg- List of character names to quickly pass tostart()img- Showcase generated image.Description of arguments:Main class:EnkaGenshinGenerationContains the following argumentslang,img,charterImg,name,adapt,randomImg,hide,dowload,namecard,splashClass argument description::lang- Takes one value to define the language. Supported languages are listed below in the documentation. The default is Russian.Values: strExample str:EnkaGenshinGeneration(lang = "en")img- If you want to use your image on the card, then pass this argument.Values str: Image link or the path to the file.Values PIL.ImageFile: Image opened with Image.open()Values list: Image link, the path to the file or PIL.ImageFileExample str the path to the file:EnkaGenshinGeneration(img = "img.png")Example str image link:EnkaGenshinGeneration(img = "https//...image.png")Example PIL.ImageFile:EnkaGenshinGeneration(img = Image.open("img.png"))Example list:EnkaGenshinGeneration(img = [Image.open("img.png"), "img.png", "https//...image.png"])- list only works with the argument:randomImg.charterImg- Give each character a custom image.Values dict: Can take all values from the img argument except list.Example dict:EnkaGenshinGeneration(charterImg = {"Klee": Image.open("img.png"), "Albedo": "img.png", "Xiao": "https//...image.png"})name- Needed if you want to get certain characters.Values: strExample str one character:EnkaGenshinGeneration(name = "Klee")Example str two or more characters:EnkaGenshinGeneration(name = "Klee, Albedo, ...")adapt- Adapt background to custom image.Values: boolExample bool:EnkaGenshinGeneration(img = "img.png", adapt = True)randomImg- Random selection of custom images from the list.Values: boolExample bool:EnkaGenshinGeneration(img = [Image.open("img.png"), "img.png"], randomImg = True)- If img is not a list, then randomImg is ignored.hide- Hide the UID on the character card.Values: boolExample bool:EnkaGenshinGeneration(hide = True)dowload- Will return ready images for further work with them. (If not specified, then the finished results will be saved in the directory of the executable file in the folder and return None:EnkaImg)Values: boolExample bool:EnkaGenshinGeneration(dowload = True)namecard- Replaces the background of the player card image with character images. (Used only for the second template.)Values: boolExample bool:EnkaGenshinGeneration(namecard = True)splash- Displays splashes of characters in costumesValues: boolExample bool:EnkaGenshinGeneration(splash= True)The main function of the class:starttakestemplate,uids,nameargumentFunction argument description::uids- Game UID in the game Genshin Impact.Values: int, strExample int:EnkaGenshinGeneration().start(uids = 757562748)Example str one UID:EnkaGenshinGeneration().start(uids = "757562748")Example str two or more UID:EnkaGenshinGeneration().start(uids = "757562748,544523587,874385763")template- Changes the character card template.Values: intExample int:EnkaGenshinGeneration().start(uids = "757562748", template = 2)name- Needed if you want to get certain characters.Values: strExample str one character:EnkaGenshinGeneration(uids = "757562748", name = "Klee")Example str two or more characters:EnkaGenshinGeneration.start(uids = "757562748", name = "Klee, Albedo, ...")Additional class function:profiletakesuid,imageargumentuid- Game UID in the game Genshin Impact.Values: intExample int:EnkaGenshinGeneration().profile(uids = 757562748)image- Generate a showcase image. (Default True)Values: boolExample bool:EnkaGenshinGeneration().profile(uid = 757562748б, image = False)Languages SupportedLanguegeCodeLanguegeCodeEnglishenрусскийruTiếng Việtviไทยthportuguêspt한국어kr日本語jp中文zh中文zhIndonesianidfrançaisfrespañolesdeutschdeTaiwanchtChinesechsSample Results:The result of a custom images and adaptation (template= 1).Usual result (template= 1).The result of a custom images and adaptation (template= 2).Usual result (template= 2).