
Connecting Tally For Data Visualization On Nioviz
Here is How we can Configure and use Tally Data on Superset for Data Visualization !
- a SQLAlchemy dialect + a companion Python DB-API 2 library to enable basic functionality
- some database-specific connector code to enable all features
In Short, an SQL Alchemy URI can be added to connect a database which is not listed here to connect to Superset for Data Vizualization.
SQLAlchemy is one of the most popular object-relational mapper (or ORM for short) out there and it’s written in Python. The Format For SqlAlchemy URI is :
dialect+driver://username:password@host:port/database
or
{SQL Alchemy Connection Type}://{Username}:{Password}@{URL}?{Options}
To Obtain the values for this string and also how to connect tally off-premises data online to our server and visualize it in dashboard, we need to follow the following steps-
Requirements Or prerequisite
Download and Installation Requirements For Windows:-
- Superset
- CData Tally Python Connector
https://www.cdata.com/drivers/tally/download/python/
- Jupyter Notebook
https://jupyter.org/try-jupyter/retro/notebooks/?path=notebooks/Intro.ipynb
- Ngrok
- Tally Prime
https://www.tally.com.sg/download
- ODBC Driver
https://dev.mysql.com/downloads/connector/odbc/
- SQL Alchemy
we can make data connectors with the help of installing CData , ODBC Driver and Jupyter Notebook for python codes to be written in it. and do few settings in tally.
Setting Tally
Open Tally Prime and set Client/Server Configration , tab under Exchange, as
Tally prime act as “Both”
Enable ODBC “Yes”
Port “9000”
Configuring Data Connector
After Everything Installed we Can write Python code in Jupyter Notebook for Data Connector
Steps and Python Codes use to connect Tally Data using SQL Alchemy Query Process.
Steps:-
- Install The Requirements
- Import / Call them
- Create Engine in SQL Alchemy
- Give Connection String to the Engine
- Declare a Mapping Class for tally data
- Query Tally Data
- Use the piputility to install the SQLAlchemy toolkit:
pip install sqlalchemy
- Be sure to import the module with the following:
import sqlalchemy
- You can now connect with a connection string. Use the create_enginefunction to create an Engine for working with Tally data.
engine = create_engine(“tally:///?Url=’http://localhost:9000′”)
- After establishing the connection, declare a mapping class for the table you wish to model in the ORM (in this article, we will model the Company table). Use the sqlalchemy.ext.declarative.declarative_base function and create a new class with some or all of the fields (columns) defined.
base = declarative_base()
class Company(base):
__tablename__ = “Company”
Name = Column(String,primary_key=True)
Address = Column(String)
…
- With the mapping class prepared, you can use a session object to query the data source. After binding the Engine to the session, provide the mapping class to the session query method.
engine = create_engine(“tally:///?Url=’http://localhost:9000′”)
factory = sessionmaker(bind=engine)
session = factory()
for instance in session.query(Company).filter_by(CompanyNumber=“1000”):
print(“Name: “, instance.Name)
print(“Address: “, instance.Address)
print(“———“)
Here You Can See the Output as the Data you queried about from Tally.
Connecting Tally Data On Server
ngrok Secure Tunnels
Ngrox helps us for Instant access to any system without network pain.
No dynamic DNS, no port forwarding, no VPNs. Put localhost on the internet securely.
Now, We Can Create a URL / Temporary Public IP Address to use this data at Cloud, through Ngrok.
Syntax –
ngrok http 80 –oauth=github –oauth-scope=repo
Run Cmd and then run Code for tally:
Ngrok http 9000
Use url obtained after Forward (Example) : https://96ba-2401-4900-1c19-7c2e-79f6-cf3c-1144-baf8.in.ngrok.io
the whole world can access this URL, it will Keep Changing every time we use ngrok for Non Paid users.Ngrox
SQL Alchemy URI for Tally in Nioviz
Now SQL Alchemy URI for Tally Database in Superset, would look as follows,
“tally:///?Url=’https://464e-2401-4900-1c19-7c2e-811f-df13-6865-d136.in.ngrok.io“
You can test whether the URL is spelled correctly by clicking Test connection in case of any issues like wrong password or inaccurate privileges. If everything is OK, You will See a Pop Up at Right Bottom for Successful Database Connection Set with Superset. And you will able to Visualize Your Tally Data.
Coding Overview
NioViz BI Tool by Niograph supplements Apache Superset potential with additional components, professional services and simple installation scripts that can be deployed at the required scale.
As NioViz is based on Superset, and is an open source data visualization tool that allows users to create interactive dashboards to visualize live data. It also have capabilities to build and use data connectors for the various data source by using SQL Alchemy and Python.
For More Professional Services On Data Visualization Contact Niograph