Skip to main content

License Apache PyPI - Python Version PyPI - Wheel Github

ooouno

ooouno is a library of all (more than 4300) classes, typings and types for the LibreOffice API.

ooouno is for version 2024.2 of LibreOffice API.

More about LibreOffice.

Docs

Read the docs here

Installation

CONDA

ooouno on Anaconda

$ conda install -c conda-forge ooouno

PIP

ooouno PyPI

$ pip install ooouno

Usage

All class found in LO API are recreated in this library.

For instance:
from ooo.dyn.style.line_spacing import LineSpacing is equivalent to
from com.sun.star.style import LineSpacing

Namespace

There are four namespaces representing LO API in this library.

ooo.lo

Namespace ooo.lo contains all static python classes. The format is
ooo.lo.<ns>.<snake_case_name>.<PascalCaseName>
from ooo.lo.uno.x_interface import XInterface

def foo(input:str) -> XInterface: ...

ooo.dyn

Namespace ooo.dyn contains static and dynamic classes depending on class type. The format is ooo.dyn.<ns>.<snake_case_name>.<PascalCaseName>

This namespace has dynamic classes that are changed at runtime. For classes that are dynamic are fully or partially replaced by UNO version at runtime.

This allows for typings while in design time (working in IDE) and at runtime UNO classes are created instead.

>>> from ooo.dyn.style.line_spacing import LineSpacing as DynLineSpacing
>>> from ooo.lo.style.line_spacing import LineSpacing as LoLineSpacing
>>> dyn_lns = DynLineSpacing(Height=10, Mode=3)
>>> lo_lns = LoLineSpacing(Height=10, Mode=3)
>>> assert dyn_lns.Height == 10
>>> assert dyn_lns.Mode == 3
>>> type(dyn_lns).__name__
'com.sun.star.style.LineSpacing'
>>> type(lo_lns).__name__
'LineSpacing'

ooo.csslo

As of version 2.0.0 the ooo.csslo namespace is deprecated. Use the ooo.lo namespace instead.

Namespace ooo.csslo contains static classes as LO API style imports.
The format is ooo.csslo.<ns>.<PascalCaseName>

When importing from ooo.csslo all classes in that namespace are also loaded. Under some circumstances this may not be desired. Such as packaging with stickytape.

>>> from ooo.lo.style.line_spacing import LineSpacing as LoLineSpacing
>>> from ooo.csslo.style import LineSpacing as CssLineSpacing
>>> LoLineSpacing is CssLineSpacing
True
>>> ls = CssLineSpacing()
>>> type(ls).__name__
'LineSpacing'

ooo.cssdyn

As of version 2.0.0 the ooo.cssdyn namespace is deprecated. Use the ooo.dyn namespace instead.

Namespace ooo.cssdyn contains static and dynamic classes depending on class type as LO API style imports.

When importing from ooo.cssdyn all classes in that namespace are also loaded. Under some circumstances this may not be desired. Such as packaging with stickytape.

>>> from ooo.dyn.style.line_spacing import LineSpacing as DynLineSpacing
>>> from ooo.cssdyn.style import LineSpacing as CssLineSpacing
>>> DynLineSpacing is CssLineSpacing
True
>>> ls = CssLineSpacing()
>>> type(ls).__name__
'com.sun.star.style.LineSpacing'

Generally speaking

When using ooo as typings then import from ooo.lo or ooo.csslo.

When using ooo interactively such as creating struts, enums, singletons, const classes then import from ooo.dyn or ooo.cssdyn.

Development

Development environment is configured using poetry.

It is recommended to install virtual environment locally.

To Configure poetry to install virtual environment in local folder:

poetry config virtualenvs.in-project true

After virtual environment has been set up.

Linux/Mac

Link UNO files into virtual environment.

oooenv cmd-link -a

Windows

Run toggle command to set virtual environment.

oooenv env -t

See Also

Metadata

Release files for ooouno 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ooouno 3.0.0
File Size Uploaded
ooouno-3.0.0.tar.gz 2.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ooouno 3.0.0
File Interpreter ABI Platform
ooouno-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 MB

Release files / ooouno-3.0.0.tar.gz

Download URL ooouno-3.0.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
e4b4208387bda46c2ba777f9e406fba22d1eb4367d0ec56403f4fc23bb50d580
BLAKE2b-256 checksum
How to use checksums
972e9d12012eac0973f5c9e27fab8ccc5adc3bdf1714f3e47f5d8b1d891dc362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.5 Linux/6.8.0-41-generic

Release files / ooouno-3.0.0-py3-none-any.whl

Download URL ooouno-3.0.0-py3-none-any.whl
Size 9.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
237af5c39c41892e00dacb7d89c18b62025af080c96579bb3c24051f0113fd65
BLAKE2b-256 checksum
How to use checksums
f93dd7f5f71958020e945f5a9c2923fc5d4f473d5ab92af4c61eb09f8014dc45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.5 Linux/6.8.0-41-generic

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page