I am the maintainer of OdsIO, an old package that wrap ezodf python module to read and write data on ODS (LibreOffice) spreadsheets.
This has been my first package and at that time I used PyCall and made the installation of the python module on build.jl:
using PyCall
println("Running build.jl for the OdsIO package.")
# Change that to whatever packages you need.
const PACKAGES = ["ezodf","lxml"]
# Use eventual proxy info
proxy_arg=String[]
if haskey(ENV, "http_proxy")
push!(proxy_arg, "--proxy")
push!(proxy_arg, ENV["http_proxy"])
end
# Import pip
try
pyimport("pip")
catch
# If it is not found, install it
println("Pip not found on your sytstem. Downloading it.")
get_pip = joinpath(dirname(@__FILE__), "get-pip.py")
download("https://bootstrap.pypa.io/get-pip.py", get_pip)
run(`$(PyCall.python) $(proxy_arg) $get_pip --user`)
end
println("Installing required python packages using pip")
run(`$(PyCall.python) $(proxy_arg) -m pip install --user --upgrade pip setuptools`)
run(`$(PyCall.python) $(proxy_arg) -m pip install --user $(PACKAGES)`)
Now this approach has several limitations, and I am trying to “modernize it”.
So, which is the standard way nowaday to create a Julia package that require a Python one?
I am trying (unsuccessfully) to use PythonCall/CondaPkg, by replacing the text above on build.jl with
in src/OdsIO.jl
However I have various errors (from not knowing the ezods package or completelly crashing Julia.
So which is the approach in order to get a Julia package wrapping a Python module, without depending at all to what there is installed in the host system (i.e. whatever the host system has its own ezods module or not) ?
I managed but my package is not running in VSCode.
Actually, it has nothing to do with my package.
The following script runs in a julia terminal but not in VSCode, both with Julia 1.12.6:
using Pkg
Pkg.activate(;temp=true)
Pkg.add(["CondaPkg","PythonCall"])
using PythonCall
import CondaPkg
CondaPkg.add("ezodf")
const ezodf_ref = Ref{Py}()
# This will go into the __init__ function in my package..
ezodf_ref[] = pyimport("ezodf")
ezodf = ezodf_ref[]
destDoc = ezodf.newdoc(doctype="ods", filename="foo.ods") # here it crashes Julia only in VSCode
I ask because I am thinking of asking Claude to build a Julia native reader/writer for .ods files using XLSX.jl as a model to “copy”. I have had a number of requests to extend XLSX.jl to include .ods files, which I’m reluctant to do, so I thought I’d try this approach instead. I also have in the back of my mind the moves recently in some geographies away from Microsoft products in search of “digital sovereignty”.
I don’t want to unnecessarily compete with anything you might still be doing, so I just wanted to check.
You can see my developing repo if you want to take a look but it is a very early WIP (started yesterday!) with as yet an uncertain future.
PS - I only just noticed this repo exists, too, although it’s seen no updates for over a year and doesn’t seem to be registered. Git told me ODSFiles.jl was free but it seems not! I don’t want to step on anyone’s toes!
Hello, no I am not actively working on that package. Also, the python ezodf package it wraps is no longer maintained, so I welcome a more modern and efficient julia native way.
I believe if what we want is “just” read/write the data, without considering the various formatting specifications, using a XML parser for it should it relatively easy and the kind of stuff where I expect Claude to be excellent on…
Please let me know when you consider it done and registered, so I can deprecate the OdsIO.jl package. If you need the name, it is also fine for me, but I don’t know how to process…
Yes, it’s registered. I suggest you reach out to the author to explore ways forward.
The normal procedure to replace an existing package with a completely new implementation by a different author is to
Transfer the repository to the new author. If done with GitHub’s tools, this will add automatic forwarding.
Make a manual PR to the General registry, changing the repo URL for the package.
Remove the old files and add the new files in the repository (normal git rm, git add, do not perform any history rewrites) and bump the major version of the package.
Register a new breaking version as normal.
(If the new implementation uses the same API, it’s not necessary to do a breaking version bump, but that’s not usually the case for such big changes to the implementation.)