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
Over time, I plan to add more functionality to the site!
![separator.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/23tmBVTkPE8GPjV9KGtgDkp1eB3TQ7yDVmYDYLjwAFvVvXBaKwoNL2yje7oAbW49gFCTM.png)
Battle summarizer
The front page of the app contains a single entry field for a battle id:
![image.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/23vhU8rVyXk7pmvWhrRYAzhDfomDEL2XxzbQW38W1Ca6KvufRzxSd8AQHRHXsQdXAdmCQ.png)
Here, you should enter a battle id, which you will find by looking at the url of a Splinterlands battle page:
![image.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/EoyPb3Xmv6XYnVF4ZDA92qj2BDVQ53oNWRwt7tF4MX5pyJQEA5P3Y3MxPrW2vsJ79qv.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:
At the bottom of the page you will find copyable markdown text, that you can directly insert in a hive post:
In the upper right corner of the markdown text block, there is a button to copy the contents:
![Copy button](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/23sweHqWeiUesELG16EwuW5MhpP2HKP48Av6NAeAVCdLdQ9MRFoiCYZBYq5pAdqpEY7GW.png)
When I paste the copied content into the hive post, it produces the following:
kalkulus vs. sc456 | |
---|---|
Type | Tournament |
Format | Wild |
Mana | 33 |
Elements | Black |
Rules | Up to Eleven, Shades of Gray, Earthquake |
Winner | kalkulus |
kalkulus's team:
sc456's team:
![separator.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/23tmBVTkPE8GPjV9KGtgDkp1eB3TQ7yDVmYDYLjwAFvVvXBaKwoNL2yje7oAbW49gFCTM.png)
Battle log parser
Just below the battle id entry field, you will find three tab selectors:
![Tab selectors](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/23tGXhSycKWEEKUqwosxs4rFdsZgkW5HnBvy8GFfZr8BXk4zenZqztd2bnpsPL2tTv6rE.png)
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](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/23swgMvwSuABnrSgQvyJRQrZtrszrXcpXF3pgBVvJ4qV54RYWb7E9i58npaxWc6coCrQL.png)
The second tab displays the battle log:
![Battle log display](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/Eo1vRkWJ74FPVx2J2GrCbK7fEYcdtgb755yEXnEKSEAJ3ckXfP71vierVF31zyidrcc.png)
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](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/23tmBVTkPE8GPjV9KGtgDkp1eB3TQ7yDVmYDYLjwAFvVvXBaKwoNL2yje7oAbW49gFCTM.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.
![](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/splinterlands/23tbwHGyBbHdEqtyLjA83Rc159mfzLQNwDsJVrmwKNHCtthwmsXtwUeyY3xX1fEHyMxRh.png)
Join Splinterlands
![](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/splinterlands/23tbwHGyBbHdEqtyLjA83Rc159mfzLQNwDsJVrmwKNHCtthwmsXtwUeyY3xX1fEHyMxRh.png)
Best wishes
@Kalkulus
![separator.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/kalkulus/23tmBVTkPE8GPjV9KGtgDkp1eB3TQ7yDVmYDYLjwAFvVvXBaKwoNL2yje7oAbW49gFCTM.png)