Skip to main content

Interfaces and classes for LibreOffice (uno)

Project description

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 6.4 to 7.2 of LibreOffice API. ooouno may work in older versions of API but has not been tested.

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
from ooo.cssdyn.style 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

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

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 interactivly such as creating structs, enums, singletons, const classes then import from ooo.dyn or ooo.cssdyn.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ooouno-0.1.13.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ooouno-0.1.13-py3-none-any.whl (9.6 MB view details)

Uploaded Python 3

File details

Details for the file ooouno-0.1.13.tar.gz.

File metadata

  • Download URL: ooouno-0.1.13.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for ooouno-0.1.13.tar.gz
Algorithm Hash digest
SHA256 a1b719013ffd7245d9a62c9402293ed3dc5e2a97521609d4337dc450f4e50b5a
MD5 d628f698b5d7850ff8073ccbf9bee760
BLAKE2b-256 6dd526f9bb4f96f861b0f3c90aa9246316f32d34bdcb628fc40c92a958c878fe

See more details on using hashes here.

File details

Details for the file ooouno-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: ooouno-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 9.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for ooouno-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 9fdb74b325857e76a31c08619c4a2cb893e38e9b556a7d79b5e6712e14533cd5
MD5 0c0212c27b4280769fed6eadef47daad
BLAKE2b-256 462ba8c9ca4af9b0757b86b26924800cf73b4d88a5d81805485071771375934d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page