spltools has been deployed as a Streamlit app!

in #hive-133235 days ago

image.png

Following @beaker007's awesome example, I have launched parts of spltools as a Streamlit app. You can now use some of the functionality in a browser without worrying about the underlying python code at all!

Current functionality:

  • Battle summarizer, with copyable markdown to use in hive posts.
  • Battle log parser.

spltools app

url: https://spltools.streamlit.app/

Over time, I plan to add more functionality to the site!

separator.png

Battle summarizer

The front page of the app contains a single entry field for a battle id:

image.png

Here, you should enter a battle id, which you will find by looking at the url of a Splinterlands battle page:

image.png

You can also enter the full url. This is convenient because you can access it from the Splinterlands frontpage by pressing the share battle button.

After inserting the battle id or url, press Enter or the Run button, and the app will fetch the battle details and produce a summary:

Battle summary example

At the bottom of the page you will find copyable markdown text, that you can directly insert in a hive post:

Markdown text

In the upper right corner of the markdown text block, there is a button to copy the contents:

Copy button

When I paste the copied content into the hive post, it produces the following:

kalkulus vs. sc456
TypeTournament
FormatWild
Mana33
ElementsBlack
RulesUp to Eleven, Shades of Gray, Earthquake
Winnerkalkulus
kalkulus's team:

sc456's team:


separator.png

Battle log parser

Just below the battle id entry field, you will find three tab selectors:

Tab selectors

Tabs two and three contain the battle log in two different formats. The rightmost tab has markdown text for copying into hive posts or other markdown display software:

image.png

The second tab displays the battle log:

Battle log display

As a small note about the battle logs, the two final columns contain the fields Hit chance and RNG (Random Number Generator output). The two work in a Splinterlands battle in the following way: The RNG output must be smaller than the hit chance for a hit to land.

separator.png

Final words

I hope the spltools app will be of interest to you. If you find any bugs or have suggestions, please reach out to me here, or find me in the Splinterlands discord server. Thank you for your attention!

If you are interested in more posts about the spltools python package, you can find the previous ones here:

spltools update posts:

7. spltools functions and classes for battle data
6. spltools setup guide
5. Best brawler code
4. spltools update: Classes for Brawl data
3. spltools update: Reward chest classes
2. spltools update: Checking which set a card belongs to
1. Initial spltools commit


If you have not yet joined Splinterlands please click the referral link below to get started.



Join Splinterlands


Best wishes
@Kalkulus

separator.png

Sort:  

Great, now it’s easier to see I lost a match by 1% chance 🤣 !BBH

Nice work though, really appreciate the work you put into providing this insight

Haha, yeah those unlikely misses/hits was one of the reasons originally for why I made the battle log parser!

Nice to see the move to streamlit and was it easy?

Great way to deploy some apps with ease and free😍

Looking forward to all the updates on it.

Yeah, streamlit was easy to work with once I got the hang of the session state. Great to learn about it. Thanks for bringing it to my attention!
Also it was incredibly easy to deploy after I had the gui structure in place!