Any alternatives for xlwings and udf for macos? - python-3.x

my usecase:
i have an excel spreadsheet and a python function that uses pandas to take advantage of my spreadsheet. I would like to select some data (table/entire sheet to be precise) and would like to pass that data to a custom function i wrote in python and the I want the function to return a dataframe that i would want to show in the spreadsheet.
Apparently, i have followed through the documentation but found On Mac, all UDF related functionality is not available. on the Xlwings doc page. Since this is for my work i cannot use another machine and apparently, the requirement cannot be achieved using the xlwings addin for macos MSExcel.
Are there any alternatives for achieving the same? Also, please correct me, if i got it anywhere wrong or any thing that i should do in making my requirement work in my environment?

Related

a simple visualization when write excel with python

this might be a stupid question but I need some insight
I currently already create an excel file with openpyxl. But now, I would like to add a visualization on the 4th column
I want to create a visual for two points like shown below
Pretty much a scale that shows the two points between actual vs reference. I don't know what to call this chart, but I found something really similar with sparkline (which is not what I am looking for).
Does anyone have any suggestion on what tool to use that can create this type of visualization when writing the file with python?
thank you

Get number of columns in Excel using Oracle

is a possibility to get number of columns in Excel document using Oracle? I can't find even any similar question to this.
You can use the plsql-utils library, the ooxml_utils_pkg package, to open an Excel file and interrogate the contents. You have to know a bit about the file, like how it's laid out to determine what cells to look at to see if they're populated.

How to read excel and validate one column's data in the database?

I am coming from java background and have minimal idea regarding python. I have to read an excel file and validate one of it's column values in the DB to verify that those rows exist in the DB or not.
I know the exact libraries and steps in java using which I can do this work.
But I am facing problems in choosing the ways to do this work in python.
till now I am able to identify some things which I can do.
Read excel file in python using python.
Use pyodbc to validate the values.
Can pandas help me to refine those steps. Rather doing things the hard way.
Yes pandas can help. But you phrase the question in a "please google this for me" way. Expect this question to be down-voted a lot.
I will give you the answer for the excel part. Surely you could have found this yourself with a little effort?
import pandas as pd
df = pd.read_excel('excel_file.xls')
Read the documentation.
Using xlrd module, one can retrieve information from a spreadsheet. For example, reading, writing or modifying the data can be done in Python. Also, a user might have to go through various sheets and retrieve data based on some criteria or modify some rows and columns and do a lot of work.
xlrd module is used to extract data from a spreadsheet.
# Reading an excel file using Python
import xlrd
# Give the location of the file
loc = ("path of file")
# To open Workbook
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
# For row 0 and column 0
sheet.cell_value(0, 0)
put open_workbook under try statement and use pyodbc.Error as exe in except to catch the error if there is any.

Excel VBA Code to pull SSRS data as a dataset

I can’t seem to find a solution for my problem no matter how much I Google.
(Please excuse my verbosity in the following explanation)
My process is that I have to go to the SSRS web page, run my report (with parameters), and finally export as an excel file. Once all that is done I can execute my couple thousand lines of VBA code to import the raw data I just downloaded and apply my business logic. Now I’m able to make My pretty charts and graphs. For lots of reasons I won’t enumerate here, I need to further automate this.
What I would like to do is change my code so it will just pull the data directly into my Excel spreadsheet without having to have first saved it as a file.
The Googling I have done so far suggests I would be pulling it into a dataset, then work with that dataset object to consume my data.
Does anyone have VBA code that demonstrates how to connect to the SSRS server, call my specific report (with parameters) and, and return the results as ( I’m guessing as a dataset),and read that into my spreadsheet?
Excel is providing facility to connect to the database and run query. You can execute the SP's query from excel
Once you got the data, you can apply your chart logic in excel.
Please refer the link. Hope it will help you.

Language/framework to write Excel spreadsheets, webbased

I need to make a webpage (from scratch) that will interrogate a SQLite database (with a predetermined query) to produce an Excel compatible spreadsheet. I need to find a lightweight solution to implement this, but don't know where to look and what is recommended.
The page itself will be fairly vanilla, only takes two dates as input, and the query will be pretty much a single table dump between those two dates. I'm interested in how to port the data to a spreadsheet.
EDIT: Framework should have some sort of stock SQLite package.
P.S.: Can be for use with Excel 2007 (XLSX) or older. Which ever way it goes, the page will be set to one or the other, not both.
Maybe PHP and PHPExcel will suite your needs.

Resources