# LibreOffice Developer Search
Simplified searching for LibreOffice Developers. This version targets LibreOffice `7.4`.
## Installation
### pip
lo-dev-search [PyPI](https://pypi.org/project/lo-dev-search/)
```sh
pip install lo-dev-search
```
For LibreOffice `7.3`
```sh
pip install "lo-dev-search<2.0"
```
## Finding API Documentation Online
The online API documentation can be time-consuming to search due to its great size.
If you want to have a browse, start at [LibreOffice API Namespaces](https://api.libreoffice.org/docs/idl/ref/namespaces.html), which takes a while to load.
Each Office application (e.g. Writer, Draw, Impress, Calc, Base, Math) is supported by multiple modules. For example, most of Writer's API is in Office's "text" module, while Impress' functionality comes from the "presentation" and "drawing" modules. These modules are located in [com.sun.star package](https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star.html).
Rather than searching manually through a module for a given class, it's a lot quicker to get a search engine to do it for you. This is the purpose of my `lodoc` cli, which utilizes [Google](https://google.com). For instance, at the command line, you can type:
```sh
lodoc xtext
```
and the Office API documentation on the XText interface will open in your browser.
``lodoc`` 'almost' always returns the right page, mainly because Office interfaces, and many of its services, have long unique names. (I'll explain what a service is shortly.) ``lodoc`` can be access by typing ``lodoc`` in the terminal.
Service names are less unusual, and so you should probably add the word "service" to your search. For instance, if you're looking for the Text service, type:
```sh
lodoc text service
```
Module names are also quite common words, so add "module" to the search. If you want to reach the "text" module (which implements most of Writer), search for:
```sh
lodoc text module
```
You can call lodoc with Office application names, which are mapped to API module names. For instance:
```sh
lodoc Impress
```
brings up the "presentation" module page.
## Searching the Online Developer's Guide
The online Developer's Guide can also be time-consuming to search because it's both long (around 1650 pages), and poorly organized. To help, I've written a `loguide` cli which is quite similar to `lodoc`. It calls [Google](https://google.com), limiting the search to the Developer's Guide web pages, and loads the first matching page into your web browser.
The first argument of `loguide` must be an Office application name, which restricts the search to the part of the guide focusing on that application's API or otherwise, `general`.
Type `loguide -h` for options.
General example:
```sh
loguide general Lifetime of UNO Objects
```
loads the guide page with that heading into the browser. A less precise query will probably produce the same page, but even when the result is 'wrong' it'll still be somewhere in the guide.
Impress example:
```sh
loguide impress Page Formatting
```
Calling `loguide` with just an application name, opens the guide at the start of the chapter on that topic. For example:
```sh
loguide writer
```
opens the guide at the start of the "Text Documents" chapter.
Calling `loguide` with no arguments, makes the browser load the first page of the guide.
## loapi
`loapi` uses a local database to narrow class names and namespaces for a more focused search.
### loapi comp
`loapi comp` can search for a components `const`,`enum`, `exception`, `interface`, `singleton`, `service`, `struct`, `typedef` or `any`.
Type `loapi comp -h` to see options available for `comp`.
For example:
```sh
loapi comp --search writer
Choose an option (default 1):
[0], Cancel
[1], UnsupportedOverwriteRequest - com.sun.star.task.UnsupportedOverwriteRequest - exception
[2], LayerWriter - com.sun.star.configuration.backend.xml.LayerWriter - service
[3], ManifestWriter - com.sun.star.packages.manifest.ManifestWriter - service
[4], Writer - com.sun.star.xml.sax.Writer - service
[5], XCompatWriterDocProperties - com.sun.star.document.XCompatWriterDocProperties - interface
[6], XManifestWriter - com.sun.star.packages.manifest.XManifestWriter - interface
[7], XSVGWriter - com.sun.star.svg.XSVGWriter - interface
[8], XWriter - com.sun.star.xml.sax.XWriter - interface
```
Choosing any number greater than `0` opens the that components url.
Option `4` would open to <https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1xml_1_1sax_1_1Writer.html>
Search can be narrowed by including `--component-type` option.
```sh
loapi comp --component-type service --search writer
Choose an option (default 1):
[0], Cancel
[1], LayerWriter - com.sun.star.configuration.backend.xml.LayerWriter - service
[2], ManifestWriter - com.sun.star.packages.manifest.ManifestWriter - service
[3], Writer - com.sun.star.xml.sax.Writer - service
```
A search parameter can be more that one word.
For example:
```sh
loapi comp --component-type exception --search "ill arg"
Choose an option (default 1):
[0], Cancel
[1], IllegalArgumentIOException - com.sun.star.frame.IllegalArgumentIOException - exception
[2], IllegalArgumentException - com.sun.star.lang.IllegalArgumentException - exception
```
searches for all components of type `exception` that contain `ill` followed by any number of characters and then `arg`.
### loapi ns
Similar to `loapi comp`, `loapi ns` search strictly in namespaces.
Type `loapi ns -h` to see options available for `ns`.
For example:
```sh
loapi ns --search xml
Choose an option (default 1):
[0], Cancel
[1], com.sun.star.xml
[2], com.sun.star.xml.crypto.sax
[3], com.sun.star.xml.dom
[4], com.sun.star.xml.crypto
[5], com.sun.star.xml.xslt
[6], com.sun.star.xml.input
[7], com.sun.star.xml.sax
[8], com.sun.star.xml.wrapper
[9], com.sun.star.xml.xpath
[10], com.sun.star.xml.dom.views
```
Choosing any number greater than `0` opens the that components url.
Option `4` would open to <https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1xml_1_1crypto.html>
## loproc
While developing/debugging code, it's quite easy to inadvertently trigger a runtime exception in the Office API. In the worst case, this can cause your program to exit without shutting down the *soffice* process.
`loproc --running` show if the process is running.
`loproc --kill` kills the process if it is running.
There is no issue running `loproc --kill` without running `loproc --running`.
Raw data
{
"_id": null,
"home_page": "https://github.com/Amourspirit/python_lo_dev_search",
"name": "lo-dev-search",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "libreoffice,openoffice,search,uno,ooouno,pyuno",
"author": ":Barry-Thomas-Paul: Moss",
"author_email": "vibrationoflife@protonmail.com",
"download_url": "https://files.pythonhosted.org/packages/28/05/0f500c75701e7e260e55aa8254bee1deebe1a57b5024150e219b31d8d2e8/lo_dev_search-2.0.2.tar.gz",
"platform": null,
"description": "# LibreOffice Developer Search\n\nSimplified searching for LibreOffice Developers. This version targets LibreOffice `7.4`.\n\n## Installation\n\n### pip\n\nlo-dev-search [PyPI](https://pypi.org/project/lo-dev-search/)\n\n```sh\npip install lo-dev-search\n```\n\nFor LibreOffice `7.3`\n\n```sh\npip install \"lo-dev-search<2.0\"\n```\n\n## Finding API Documentation Online\n\nThe online API documentation can be time-consuming to search due to its great size.\n\nIf you want to have a browse, start at [LibreOffice API Namespaces](https://api.libreoffice.org/docs/idl/ref/namespaces.html), which takes a while to load.\n\nEach Office application (e.g. Writer, Draw, Impress, Calc, Base, Math) is supported by multiple modules. For example, most of Writer's API is in Office's \"text\" module, while Impress' functionality comes from the \"presentation\" and \"drawing\" modules. These modules are located in [com.sun.star package](https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star.html).\n\nRather than searching manually through a module for a given class, it's a lot quicker to get a search engine to do it for you. This is the purpose of my `lodoc` cli, which utilizes [Google](https://google.com). For instance, at the command line, you can type:\n\n```sh\nlodoc xtext\n```\n\nand the Office API documentation on the XText interface will open in your browser.\n\n``lodoc`` 'almost' always returns the right page, mainly because Office interfaces, and many of its services, have long unique names. (I'll explain what a service is shortly.) ``lodoc`` can be access by typing ``lodoc`` in the terminal.\n\nService names are less unusual, and so you should probably add the word \"service\" to your search. For instance, if you're looking for the Text service, type:\n\n```sh\nlodoc text service\n```\n\nModule names are also quite common words, so add \"module\" to the search. If you want to reach the \"text\" module (which implements most of Writer), search for:\n\n```sh\nlodoc text module\n```\n\nYou can call lodoc with Office application names, which are mapped to API module names. For instance:\n\n```sh\nlodoc Impress\n```\n\nbrings up the \"presentation\" module page.\n\n## Searching the Online Developer's Guide\n\nThe online Developer's Guide can also be time-consuming to search because it's both long (around 1650 pages), and poorly organized. To help, I've written a `loguide` cli which is quite similar to `lodoc`. It calls [Google](https://google.com), limiting the search to the Developer's Guide web pages, and loads the first matching page into your web browser.\n\nThe first argument of `loguide` must be an Office application name, which restricts the search to the part of the guide focusing on that application's API or otherwise, `general`.\n\nType `loguide -h` for options.\n\nGeneral example:\n\n```sh\nloguide general Lifetime of UNO Objects\n```\n\nloads the guide page with that heading into the browser. A less precise query will probably produce the same page, but even when the result is 'wrong' it'll still be somewhere in the guide.\n\nImpress example:\n\n```sh\nloguide impress Page Formatting\n```\n\nCalling `loguide` with just an application name, opens the guide at the start of the chapter on that topic. For example:\n\n```sh\nloguide writer\n```\n\nopens the guide at the start of the \"Text Documents\" chapter.\n\nCalling `loguide` with no arguments, makes the browser load the first page of the guide.\n\n## loapi\n\n`loapi` uses a local database to narrow class names and namespaces for a more focused search.\n\n### loapi comp\n\n`loapi comp` can search for a components `const`,`enum`, `exception`, `interface`, `singleton`, `service`, `struct`, `typedef` or `any`.\n\nType `loapi comp -h` to see options available for `comp`.\n\nFor example:\n\n```sh\nloapi comp --search writer\nChoose an option (default 1):\n[0], Cancel\n[1], UnsupportedOverwriteRequest - com.sun.star.task.UnsupportedOverwriteRequest - exception\n[2], LayerWriter - com.sun.star.configuration.backend.xml.LayerWriter - service\n[3], ManifestWriter - com.sun.star.packages.manifest.ManifestWriter - service\n[4], Writer - com.sun.star.xml.sax.Writer - service\n[5], XCompatWriterDocProperties - com.sun.star.document.XCompatWriterDocProperties - interface\n[6], XManifestWriter - com.sun.star.packages.manifest.XManifestWriter - interface\n[7], XSVGWriter - com.sun.star.svg.XSVGWriter - interface\n[8], XWriter - com.sun.star.xml.sax.XWriter - interface\n```\n\nChoosing any number greater than `0` opens the that components url.\nOption `4` would open to <https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1xml_1_1sax_1_1Writer.html>\n\nSearch can be narrowed by including `--component-type` option.\n\n```sh\nloapi comp --component-type service --search writer\nChoose an option (default 1):\n[0], Cancel\n[1], LayerWriter - com.sun.star.configuration.backend.xml.LayerWriter - service\n[2], ManifestWriter - com.sun.star.packages.manifest.ManifestWriter - service\n[3], Writer - com.sun.star.xml.sax.Writer - service\n```\n\nA search parameter can be more that one word.\n\nFor example:\n\n```sh\nloapi comp --component-type exception --search \"ill arg\"\nChoose an option (default 1):\n[0], Cancel\n[1], IllegalArgumentIOException - com.sun.star.frame.IllegalArgumentIOException - exception\n[2], IllegalArgumentException - com.sun.star.lang.IllegalArgumentException - exception\n```\n\nsearches for all components of type `exception` that contain `ill` followed by any number of characters and then `arg`.\n\n\n### loapi ns\n\nSimilar to `loapi comp`, `loapi ns` search strictly in namespaces.\n\nType `loapi ns -h` to see options available for `ns`.\n\nFor example:\n\n```sh\nloapi ns --search xml\nChoose an option (default 1):\n[0], Cancel\n[1], com.sun.star.xml\n[2], com.sun.star.xml.crypto.sax\n[3], com.sun.star.xml.dom\n[4], com.sun.star.xml.crypto\n[5], com.sun.star.xml.xslt\n[6], com.sun.star.xml.input\n[7], com.sun.star.xml.sax\n[8], com.sun.star.xml.wrapper\n[9], com.sun.star.xml.xpath\n[10], com.sun.star.xml.dom.views\n```\n\nChoosing any number greater than `0` opens the that components url.\nOption `4` would open to <https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1xml_1_1crypto.html>\n\n## loproc\n\nWhile developing/debugging code, it's quite easy to inadvertently trigger a runtime exception in the Office API. In the worst case, this can cause your program to exit without shutting down the *soffice* process.\n\n`loproc --running` show if the process is running.\n\n`loproc --kill` kills the process if it is running.\n\nThere is no issue running `loproc --kill` without running `loproc --running`.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "LibreOffice Developer Search Engine",
"version": "2.0.2",
"split_keywords": [
"libreoffice",
"openoffice",
"search",
"uno",
"ooouno",
"pyuno"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5c6810be1f9bebff698be5aa98faca818313be45a20f718621d71ef68f107ce4",
"md5": "b5e367251d5821f60d1f39087798cd05",
"sha256": "a770db39d82de3c3046740297c6ae2e587eaaa288283f1f7fa8caaae663bad49"
},
"downloads": -1,
"filename": "lo_dev_search-2.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b5e367251d5821f60d1f39087798cd05",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 1342272,
"upload_time": "2023-03-30T13:38:42",
"upload_time_iso_8601": "2023-03-30T13:38:42.686465Z",
"url": "https://files.pythonhosted.org/packages/5c/68/10be1f9bebff698be5aa98faca818313be45a20f718621d71ef68f107ce4/lo_dev_search-2.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "28050f500c75701e7e260e55aa8254bee1deebe1a57b5024150e219b31d8d2e8",
"md5": "7d47f489543737c03de1f3c101c47416",
"sha256": "dbaf378c063cbc3b4344b4e55c619d151bc9c963872625995f637c023124fadc"
},
"downloads": -1,
"filename": "lo_dev_search-2.0.2.tar.gz",
"has_sig": false,
"md5_digest": "7d47f489543737c03de1f3c101c47416",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 1322841,
"upload_time": "2023-03-30T13:38:45",
"upload_time_iso_8601": "2023-03-30T13:38:45.889894Z",
"url": "https://files.pythonhosted.org/packages/28/05/0f500c75701e7e260e55aa8254bee1deebe1a57b5024150e219b31d8d2e8/lo_dev_search-2.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-30 13:38:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Amourspirit",
"github_project": "python_lo_dev_search",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "lo-dev-search"
}