LibreOffice Logo LibreOffice Logo Extensions, Documentation and Templates repository

logo full Numpy Extension for LibreOffice

Numpy is The fundamental package for scientific computing with Python.
This is a LibreOffice extension that allows you to use Numpy in LibreOffice python macros and scripts.

Base Calc Draw Impress Macro Presentations Writer
Download latest

latest release: 2025-01-08 02:13:19

Description

Example Usage:

# using OooDev to for easy access to LibreOffice
    import pandas as pd

    from ooodev.dialog.msgbox import MsgBox, MessageBoxType
    from ooodev.macro.macro_loader import MacroLoader
    from ooodev.office.calc import Calc
    from ooodev.utils.info import Info
    from ooodev.utils.lo import Lo


    def _do_work() -> None:
    # make sure we are working on a Calc Spreadsheet
    doc = Lo.XSCRIPTCONTEXT.getDocument()
    if not Info.is_doc_type(doc_type=Lo.Service.CALC, obj=doc):
    MsgBox.msgbox(
        msg="Not a Calc document",
        title="Error",
        boxtype=MessageBoxType.ERRORBOX,
    )
    return

    # create a data frame and add some data to it.
    df = pd.DataFrame()
    df["Name"] = ["Anil", "Raju", "Arun"]
    df["Age"] = ["32", "34", "45"]

    data = (("Name", "Age"),)  # Column names
    # convert data frame values into something that Calc can use.
    data += tuple(df.itertuples(index=False, name=None))

    sheet = Calc.get_active_sheet()
    # set the data starting at cell A1
    Calc.set_array(values=data, sheet=sheet, name="A1")


    def demo(*args) -> None:
    with MacroLoader():
    # using MacroLoader so we can use OooDev in macros
    _do_work()


    g_exportedScripts = (demo,)
    

FAQ

Q: I am using LibrePyhtonista do I still need to install this extension?
Answer

The short answer is no. If you are using LibrePythonista extension then Numpy will be automatically installed with it. It will not show up as an extension; However, the python package numpy is installed which is what the extension installs.

Q: How do I remove all the files when uninstalling Numpy?
Answer

Numpy is uninstalled as an extension it does not automatically uninstall Numpy Python files. This is a feature and not a bug. To remove the python files Open the extension manager. Choose options for Numpy, Go to the uninstall section. Check to box for Numpy, click the Uninstall button. Next Uninstall the extension for complete removal. Note that if the python files are removed without removing the extension then the python files will be automatically installed again on next restart of LibreOffice.

Issues

Report any issues to the issues page.

Note

If you have installed LibrePythonista or Pandas for LibreOffice then you already have Numpy installed, in which this extension will not be needed.

Homepage: https://github.com/Amourspirit/python-libreoffice-numpy-ext

Repository: https://github.com/Amourspirit/python-libreoffice-numpy-ext

Release Description Compatibility Operating Systems License Release notes Updated  
2.3.0 2.3.0 Update 7.0 Linux, Windows, macOS MIT It now possible to uninstall numpy python files from Extension Options. 2025-01-05 20:38:48 Download
2.2.2 2.2.2 Update 7.0 Linux, Windows, macOS MIT Fixed issue for last update not always installing on Windows. 2025-01-03 20:15:40 Download
2.2.1 2.2.1 7.0 Linux, Windows, macOS MIT Fine tuning for changing Numpy Version. 2025-01-03 15:22:58 Download
2.2.0 2.2.0 Update 7.0 Linux, Windows, macOS MIT This release has more stability when changing Numpy Version.
Also this version install a version of Numpy that is best suited for the current version of Python.
2025-01-03 01:10:26 Download
2.0.0 2.0.0 Update 7.0 Linux, Windows, macOS MIT This release enables the option to change the Numpy installed version.
This is done in the options for the extension.

 

Installing OOO Development Tools (OooDev) has been removed from this extension. OOO Development Tools is available as a separate extension.
2024-12-26 00:38:39 Download
1.2.5 1.2.5 update 7.0 Linux, Windows, macOS MIT Update OooDev and Example. 2024-03-14 14:52:04 Download
1.2.4 1.2.4 Update 7.0 Linux, Windows, macOS MIT Update for flatpak install. 2024-02-20 23:54:42 Download
1.2.2 Better install error handling during install. 7.0 Linux, Windows, macOS MIT Better install error handling during install.

Update to OooDev version 0.15.0
2023-12-04 20:21:51 Download
1.2.0 Support for LibreOffice 32 and 64 bit versions for Windows 7.0 Linux, Windows, macOS MIT Support for LibreOffice 32 and 64 bit versions for Windows. If you running both 32 bit  and 64 bint versions of LibreOffice on Windows now there will be no binary conflict and both version will work. 2023-10-27 15:39:20 Download
1.1.1 Update for Mac 7.0 Linux, Windows, macOS MIT Updates for better support on Mac and AppImage on Linux. 2023-10-26 05:08:50 Download
1.0.0 Initial Release 7.0 Linux, Windows, macOS MIT Initial Release 2023-10-20 21:23:43 Download
Show more

Related Extensions

Sqlite for LibreOffice on Windows

Logo for Sqlite for LibreOffice on Windows

Adds sqlite3 support to LibreOffice on Windows.

12-2024

2774

Not rated yet

Pandas for LibreOffice

Logo for Pandas for LibreOffice

Pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool, built on top of the Python programming language.&

01-2025

3302

★ ★ ★ ★ ★

Include Python Path for LibreOffice

Logo for Include Python Path for LibreOffice

Give the ability to include external python paths in LibreOffice. Making other python packages available in Python macros and scripts.

05-2024

2385

Not rated yet

OooDev GUI Automation for Windows

Logo for OooDev GUI Automation for Windows

Although the LibreOffice API gives access to many parts of the LibreOffice application, it does not give access to everything. This project is an extension that allows access to the GUI. This project a set of python modules to automate the LibreO

04-2024

1007

Not rated yet

Feedback

☆ ☆ ☆ ☆ ☆

Post your review

You cannot post reviews until you have logged in. Login Here.

Reviews

No one has commented on this page yet.

RSS feed for reviews on this page | RSS feed for all reviews