|
@@ -53,8 +53,32 @@ def plot(card=None,columns=['cost','cost-min','cost-max'],maxCost=None):
|
|
"""
|
|
"""
|
|
df=getDF(card).plot(x='date',y=columns)
|
|
df=getDF(card).plot(x='date',y=columns)
|
|
plt.title(str(card))
|
|
plt.title(str(card))
|
|
|
|
+ plt.xticks(rotation=45)
|
|
plt.xlabel("Date")
|
|
plt.xlabel("Date")
|
|
plt.ylabel("Cost")
|
|
plt.ylabel("Cost")
|
|
plt.ylim(0,maxCost)
|
|
plt.ylim(0,maxCost)
|
|
plt.show()
|
|
plt.show()
|
|
|
|
|
|
|
|
+def buyout():
|
|
|
|
+ today=datetime.utcnow().strftime('%Y-%m-%d')
|
|
|
|
+ PlayerCards=PlayerDB.search(Query().fragment({'date':today}))
|
|
|
|
+ Stock=[None]*152
|
|
|
|
+ for card in PlayerCards: Stock[card['card-num']]=card['stock']
|
|
|
|
+ MarketDF = getDF(aDate=today)
|
|
|
|
+ MarketCards=MarketDF.to_dict('records')
|
|
|
|
+ total=0
|
|
|
|
+ cardCount=0
|
|
|
|
+ NeededCards=[]
|
|
|
|
+ for card in MarketCards:
|
|
|
|
+ if 'CRYSTAL' not in Stock[card['card-num']]:
|
|
|
|
+ card['stock']=int(Stock[card['card-num']])
|
|
|
|
+ card['needed']=10-card['stock']
|
|
|
|
+ card['card-num']=card['card-num']
|
|
|
|
+ card['total-cost']=card['needed']*card['cost']
|
|
|
|
+ NeededCards.append(card)
|
|
|
|
+ total+=card['total-cost']
|
|
|
|
+ cardCount+=card['needed']
|
|
|
|
+ print(f"{card['card-num']: <3} {card['name']: <20} {card['needed']: >2} {card['total-cost']}")
|
|
|
|
+
|
|
|
|
+ print(f" Remaining Cards: {cardCount}")
|
|
|
|
+ print(f"Total Gems Needed: {total}")
|