Steem-Python avatar

SteemChain - Charts & Analytics V1.4.0

steempytutorials

Published: 23 Mar 2019 › Updated: 23 Mar 2019SteemChain - Charts & Analytics V1.4.0

SteemChain - Charts & Analytics V1.4.0

Repository

https://github.com/Juless89/steem-dashboard

Website

http://www.steemchain.eu

Screenshot 2019-03-23 14.58.32.png

What is SteemChain?

SteemChain in an open source application to analyse transactions and operations from the STEEM blockchain. Store these into a MySQL database and visualise with charts and tables via the web. Looking to bring data analytics to STEEM like websites as blockchain.com do for Bitcoin.

New Features

A smaller but much needed update. One new feature and implementing feedback from the previous update.

amCharts

Commit: 4e0a55a633210b57b19f1222efe449614d1d8573

Charts.js has been swapped out for amCharts. Not only does this library deal better with large amounts of data points it also comes with zoom and scrolling functionality. All necessary code changes have been made to accommodate this package.

Small changes had to be made to the API to feed the chart the correct data format. Instead of returning a dict with two lists. The data is now returned as a list where every data point is a dict.

# front-end/api/views.py

# datastruct for response
data = []

# Omit last result, append data into lists
for row in serializer.data[:-1]:
    data.append({
        "date": row['timestamp'],
        "count": row['count'],
    })

return Response(data)

amCharts.gif

Implemented feedback

Commit: 5043b3f147025d702dad88238c84b9d9c35e3622

As advised most 'import *' have been removed, except for the data models, which include over 100 models. Also long if/else statements have been replaced with switchers.

# front-end/api/views.py

def get_start_day(period, end):
    switcher = {
        "ALL": None,
        "30D": end - timedelta(days=30),
        "90D": end - timedelta(days=90),
        "1Y": end - timedelta(days=365),
        "7D": end - timedelta(days=7),
        "24H": end - timedelta(days=1),
        "12H": end - timedelta(hours=12),
        "1H": end - timedelta(hours=1),
    }
    return switcher.get(period, "Invalid period")

Known issues

  • At the moment if no operation occurred in a specific period, the period does not get added. By default this should be set to 0.

Roadmap

  • Implement unit testing
  • Add analytics for all operation types
  • Add user analytics
  • Create a daily automated report of important data posted to a STEEM account
  • Create an overview with most relevant data as the home page
  • Write documentation

GitHub Account

Juless89

Leave SteemChain - Charts & Analytics V1.4.0 to:

Written by

Python tutorials often related to Steem | Managed by @juliank

Read more #utopian-io posts


Best Posts From Steem-Python

We have not curated any of steempytutorials's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Steem-Python