Import Stock Price Chart Images and Visualize in Blender Python:
Follow the Instructions from the Above Video then go for the Code Input:
Code in Python:
import pandas as pd
from fyers_api import fyersModel
from datetime import datetime,timedelta
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
client_id=open('app_id.txt','r').read()
token=open('access_token.txt','r').read().strip()
fyers=fyersModel.FyersModel(client_id=client_id,token=token,log_path='C:/Users/Current_Directory')
days=1
symbol='NSE:NIFTYBANK-INDEX'
interval='1'
now=datetime.now()
from_date=now-timedelta(days=days)
from_date=datetime.strftime(from_date,'%Y-%m-%d')
to_date=datetime.strftime(now,'%Y-%m-%d')
def historical_data(symbol,interval,from_date,to_date):
data={'symbol':symbol,
'resolution':interval,
'date_format':'1',
'range_from':from_date,
'range_to':to_date,
'cont_flag':'1'
}
response=pd.DataFrame(fyers.history(data=data)['candles'],columns=['date','open','high','low','close','volume'])
return response
hist=historical_data(symbol,interval,from_date,to_date)
plt.plot(hist['close'])
plt.tight_layout()
plt.savefig('price.png')
plt.show()
Code in Blender Python Text Editor:
import bpy
bpy.ops.object.delete(use_global=False)
bpy.ops.mesh.primitive_plane_add(size=2, enter_editmode=False, location=(0, 0, 0))
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
bpy.ops.import_image.to_plane(files=[{"name":"price.png", "name":"price.png"}], directory="C:\\Users\\your_directory\\Desktop\\blender\\", relative=False)
Easy Installation of Python Packages in Blender:
Follow the Instructions from the Video then go for the Command
Find Path of Python Blender:
import sys
print(sys.executable)
Run CMD as Adminstrator the Set your Path as such
C:\Program Files\Blender Foundation\Blender\2.80\python> and Type this Command.
Pip Installation=> .\bin\python.exe -m ensurepipre
Packages Installation=>.\Scripts\pip3.exe install matplotlib
CNC(Computer Numerical Control)
Materials Required:
1)CNC Shield
2)Arduino UNO R3
3)DRV8825 Driver
4)Fishing Line