<jupyter_start><jupyter_text>Account Overview 04.6 Winter School on Smart Contracts <NAME> (<EMAIL>)2022-01-22* Helper file to keep an overview over all our accounts  SetupSee notebook 04.1, the lines below will always automatically load functions in `algo_util.py`, the 5 accounts and the Purestake credentials<jupyter_code># Loading shared code and credentials
import sys, os

codepath = '..'+os.path.sep+'..'+os.path.sep+'sharedCode'
sys.path.append(codepath)
from algo_util import *
cred = load_credentials()

# Shortcuts to directly access the 3 main accounts
MyAlgo  = cred['MyAlgo']
Alice   = cred['Alice']
Bob     = cred['Bob']
Charlie = cred['Charlie']
Dina    = cred['Dina']
from algosdk import account, mnemonic
from algosdk.v2client import algod
from algosdk.future import transaction
from algosdk.future.transaction import PaymentTxn
from algosdk.future.transaction import AssetConfigTxn, AssetTransferTxn, AssetFreezeTxn
from algosdk.future.transaction import LogicSig

import algosdk.error
import json
import base64
import pandas as pd
# Initialize the algod client (Testnet or Mainnet)
algod_client = algod.AlgodClient(algod_token='', algod_address=cred['algod_test'], headers=cred['purestake_token'])
print(MyAlgo['public'])
print(Alice['public'])
print(Bob['public'])
print(Charlie['public'])
print(Dina['public'])<jupyter_output><empty_output><jupyter_text>Quick check of asset holdings, otherwise go to ...- https://bank.testnet.algorand.network- https://testnet.algoexplorer.io/dispenser<jupyter_code>asset_holdings_df(algod_client,Alice['public'])<jupyter_output><empty_output><jupyter_text>Check Purestake API<jupyter_code>last_block = algod_client.status()["last-round"]
print(f"Last committed block is: {last_block}")<jupyter_output><empty_output><jupyter_text>The Overview<jupyter_code># Get the holdings of all accounts
myAlgo_holding=asset_holdings_df(algod_client, MyAlgo['public'])
alice_holding=asset_holdings_df(algod_client, Alice['public'])
bob_holding=asset_holdings_df(algod_client, Bob['public'])
charlie_holding=asset_holdings_df(algod_client, Charlie['public'])
dina_holding=asset_holdings_df(algod_client, Dina['public'])
pd.set_option('precision', 4)
df1 = pd.merge(myAlgo_holding,alice_holding,how="outer", on=["asset-id", "unit", "name", "decimals"],suffixes=['MyAlgo','Alice'])
df2 = pd.merge(df1,bob_holding,how="outer", on=["asset-id", "unit", "name", "decimals"])
df2.columns.values[-1] = 'amountBob'
df3 = pd.merge(df2,charlie_holding,how="outer", on=["asset-id", "unit", "name", "decimals"])
df3.columns.values[-1] = 'amountCharlie'
df4 = pd.merge(df3,dina_holding,how="outer", on=["asset-id", "unit", "name", "decimals"])
df4.columns.values[-1] = 'amountDina'
df4<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14218009478672985, 'fraction_numerical': 0.012395187750637988, 'mean_word_length': 8.527777777777779, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '122559', 'license': 'MIT', 'n_tokens_mistral': 998, 'n_tokens_neox': 942, 'n_words': 194, 'path': 'ClassMaterial/04 - Tokens/04 code/04.6_WSC_Overview.ipynb', 'repo_name': 'gruberpeter/smartcontractscourse', 'size': '2761'}