Python Forum

Full Version: Python Package for deploying python code in Excel on machines without python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
All, 
    Which free python package can be used to deploy Python code into Excel ? I am using Anaconda and based on my research here is what I have so far : 

https://docs.continuum.io/anaconda/excel 
1. Data Nitro - Not Free beyond trials 
2. ExcelPython -  Development is currently discontinued and rolled into xlwings
3. XLLoop :  Not entirely clear on this one 
4. ExPy : Demonstration software 
5. PyXLL : Limited to educational or personal 
6. xlwings : Requires Python to be installed on the user machine 

    Essentially , I want to be able to deploy my python code into Excel like a macro such that a user only needs to have the workbook but does not necessarily need Python installed on his machine to be able to utilize the functionality of the code. 


    Any inputs or guidance is appreciated 

Best 
U
Pandas is good pd.read_excel(), df.to_excel() more heavy share without python installed.

XlsxWriter test with Python 3.6 freeze to standalone.
I activate a virtual enviroment,and install xlsxwriter and cx_freeze from Gohlke.
(web_scrape) C:\Python36\web_scrape
λ pip install XlsxWriter-0.9.5-py2.py3-none-any.whl
Processing c:\python36\web_scrape\xlsxwriter-0.9.5-py2.py3-none-any.whl
Installing collected packages: XlsxWriter
Successfully installed XlsxWriter-0.9.5

(web_scrape) C:\Python36\web_scrape
λ pip install cx_Freeze-5.0.1-cp36-cp36m-win32.whl
Processing c:\python36\web_scrape\cx_freeze-5.0.1-cp36-cp36m-win32.whl
Installing collected packages: cx-Freeze
Successfully installed cx-Freeze-5.0.1
So with this i have a stand alone solution with a exe file,
that write a hello world to a hello.xlsx file.
#make_exe.py
from cx_Freeze import setup,Executable
import sys

# Replaces commandline arg 'build'
#sys.argv.append("build")

# If need to include/exclude module/packages
includes = []
excludes = []
packages = []

# Console or Win32GUI
base = None
if sys.platform == "win32":
    base = 'Console'
    #base = 'Win32GUI'

# Name of file to make ".exe" of
filename = "excel_test.py"
setup(
    name = 'Myapp',
    version = '0.1',
    description = 'Cx test',
    options = {'build_exe': {'excludes':excludes,'packages':packages,'includes':includes}},
    executables = [Executable(filename, base=base, icon = None)])

# From command line
#python make_exe.py build
# excel_test.py
import xlsxwriter

workbook = xlsxwriter.Workbook('hello.xlsx')
worksheet = workbook.add_worksheet()
worksheet.write('A1', 'Hello world')
workbook.close()
Doesn't this still require a user to have python installed to use the application after development ?

What I was trying to ask was:
I would like to develop a stand-alone application in Excel using Python where the user doesn't have to worry about installing Python on their machine