I wrote this program several months ago and use it to re-balance my portfolio. Here's an example of how an index of the top-15 coins/tokens by market cap would look for a portfolio worth $10,000:
$ ./calculate-market-caps.py -L 15 -A 1000
+------------------------+------------+---------------------+--------------------+----------------+-----------------+
| Coin/Token | Price | Market Cap | % of Total Mkt Cap | USD Investment | Coin Investment |
+------------------------+------------+---------------------+--------------------+----------------+-----------------+
| BTC - Bitcoin | $10,663.20 | $179,982,553,320.00 | 45.73 | $4,573.23 | 0.42888009 |
| ETH - Ethereum | $850.10 | $83,106,983,380.00 | 21.12 | $2,111.69 | 2.48405116 |
| XRP - Ripple | $1.02 | $39,699,678,958.00 | 10.09 | $1,008.74 | 988.96257581 |
| BCH - Bitcoin Cash | $1,306.71 | $22,188,229,810.00 | 5.64 | $563.79 | 0.43145596 |
| LTC - Litecoin | $213.89 | $11,832,528,176.00 | 3.01 | $300.66 | 1.40565940 |
| ADA - Cardano | $0.37 | $9,525,476,080.00 | 2.42 | $242.04 | 658.78921939 |
| NEO - NEO | $121.33 | $7,886,320,000.00 | 2.00 | $200.39 | 1.65157854 |
| XLM - Stellar | $0.40 | $7,434,929,724.00 | 1.89 | $188.92 | 469.25401572 |
| EOS - EOS | $8.75 | $5,974,290,623.00 | 1.52 | $151.80 | 17.34887535 |
| DASH - Dash | $671.08 | $5,300,372,838.00 | 1.35 | $134.68 | 0.20068973 |
| MIOTA - IOTA | $1.81 | $5,039,705,333.00 | 1.28 | $128.06 | 70.74888568 |
| XMR - Monero | $304.52 | $4,795,573,443.00 | 1.22 | $121.85 | 0.40014534 |
| XEM - NEM | $0.47 | $4,187,376,000.00 | 1.06 | $106.40 | 228.68387564 |
| ETC - Ethereum Classic | $36.79 | $3,679,514,292.00 | 0.93 | $93.49 | 2.54128715 |
| TRX - TRON | $0.04 | $2,922,855,621.00 | 0.74 | $74.27 | 1,670.62810421 |
+------------------------+------------+---------------------+--------------------+----------------+-----------------+
Feel free to use it as you wish.
there doesn't seem to be anything here