{"id":11929,"date":"2026-01-06T11:13:27","date_gmt":"2026-01-06T02:13:27","guid":{"rendered":"https:\/\/www.moonmile.net\/blog\/?p=11929"},"modified":"2026-01-09T11:12:24","modified_gmt":"2026-01-09T02:12:24","slug":"libreoffice-%e3%81%ae-python-macro-%e3%81%a7-pip-%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/11929","title":{"rendered":"LibreOffice \u306e Python macro \u3067 pip \u3092\u4f7f\u3046"},"content":{"rendered":"\n<p>\u9577\u5e74&#8230;\u3068\u3044\u3063\u3066\u3082\u3001\u534a\u6708\u307b\u3069\u3067\u3059\u304c\u3001\u61f8\u5ff5\u3067\u3042\u3063\u305f LibreOffice \u306e Python \u30de\u30af\u30ed\u3067 pip \u3092\u4f7f\u3048\u308b\u65b9\u6cd5\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>moonmile\/ExcelLikeUno: LibreOffice \u306e Python \u30de\u30af\u30ed\u3092 Excel VBA \u30e9\u30a4\u30af\u306b\u64cd\u4f5c <a href=\"https:\/\/github.com\/moonmile\/ExcelLikeUno\">https:\/\/github.com\/moonmile\/ExcelLikeUno<\/a><\/p>\n\n\n\n<p>\u3068\u3044\u3046\u304b\u3001\u666e\u901a\u306b LibreOffice Python \u304c\u4f7f\u3063\u3066\u3044\u308b\u3068\u3053\u308d\u306b pip \u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp; &#039;C:\\Program Files\\LibreOffice\\program\\python&#039; -m pip install excellikeuno\n<\/pre><\/div>\n\n\n<p>\u3053\u306e\u3088\u3046\u306b LibreOffice \u304c\u4f7f\u3063\u3066\u3044\u308b Python \u3092 -m \u30b9\u30a4\u30c3\u30c1\u3092\u4ed8\u3051\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u914d\u7f6e\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nC:\\Users\\masuda\\AppData\\Roaming\\Python\\Python311\\site-packages\\\n<\/pre><\/div>\n\n\n<p>\u5171\u6709\u306e Program Files \u914d\u4e0b\u306b\u306f\u5165\u308c\u3089\u308c\u306a\u3044\u306e\u3067\u3001\u4ee3\u308f\u308a\u306b\u30e6\u30fc\u30b6\u30fc\u306e AppData \u306e\u4e2d\u306b\u5165\u308a\u307e\u3059\u3002\u73fe\u5728\u306e LibreOffice Python \u306f 3.11 \u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001Python311 \u30d5\u30a9\u30eb\u30c0\u30fc\u306b\u306a\u308a\u307e\u3059\u3002\u5c06\u6765\u7684\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u5909\u308f\u308b\u3068\u3001\u3053\u3053\u3082\u5909\u308f\u308b\u53ef\u80fd\u6027\u306f\u5927\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3067\u3001Calc \u306e\u30de\u30af\u30ed\u304b\u3089\u3082 excellikeuno \u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u3051\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&quot;&quot;&quot;LibreOffice Calc sample macro.&quot;&quot;&quot;\nfrom re import X\nfrom typing import Any, Tuple\nfrom excellikeuno import connect_calc_script\nfrom excellikeuno.table.sheet import Sheet \n\ndef hello_to_cell():\n    ( _, _, sheet ) = connect_calc_script(XSCRIPTCONTEXT)\n    sheet.cell(0, 0).text = &quot;Hello Excel Like for Python!&quot;\n    sheet.cell(0, 1).text = &quot;\u3053\u3093\u306b\u3061\u306f\u3001Excel Like for Python!&quot;\n    sheet.cell(0,0).column_width = 10000  # \u5e45\u3092\u8a2d\u5b9a\n\n    cell = sheet.cell(0,1)\n    cell.CellBackColor = 0x006400  # \u6fc3\u3044\u7dd1\u306b\u8a2d\u5b9a\n    cell.CharColor = 0xFFFFFF  # \u6587\u5b57\u8272\u3092\u767d\u306b\u8a2d\u5b9a\n\ng_exportedScripts = (\n    hello_to_cell,\n)\n\n<\/pre><\/div>\n\n\n<p>XSCRIPTCONTEXT \u306e\u63a5\u7d9a\u90e8\u5206\u3092\u96a0\u853d\u5316\u3055\u305b\u308b\u305f\u3081\u306b\u3001connect_calc_script \u95a2\u6570\u3092\u4f7f\u3063\u3066 sheet \u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u3053\u306e\u3042\u305f\u308a\u306f\u3001\u3082\u3063\u3068\u7c21\u7d20\u5316\u3057\u3066 Excel VBA \u306e\u3088\u3046\u306b ActiveWorksheet, ActiveWorkbook \u3068\u3057\u3066\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u4e88\u5b9a\u3067\u3059\u3002<\/p>\n\n\n\n<p>Python \u30de\u30af\u30ed\u81ea\u4f53\u306f\u3001\u4ee5\u4e0b\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u306e\u3067 vscode \u3067\u7de8\u96c6\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nC:\\Users\\\uff5b\u30e6\u30fc\u30b6\u30fc\u540d\uff5d\\AppData\\Roaming\\LibreOffice\\4\\user\\Scripts\\python\\\n<\/pre><\/div>\n\n\n<p>\u305f\u3060\u3057\u3001\u3053\u306e\u307e\u307e\u3060\u3068 vscode \u306e\u30b3\u30fc\u30c9\u88dc\u5b8c\u304c\u52b9\u304b\u306a\u3044\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30b3\u30fc\u30c9\u88dc\u5b8c\u304c\u52b9\u304b\u306a\u3044\u306e\u3067 Scripts\/python\/.vscode\/settings.json \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n{\n    &quot;python.analysis.autoImportCompletions&quot;: true,\n    &quot;python.analysis.extraPaths&quot;: &#x5B;\n        &quot;C:\/Users\/masuda\/AppData\/Roaming\/Python\/Python311\/site-packages&quot;\n    ]\n}\n<\/pre><\/div>\n\n\n<p>&#8220;python.analysis.extraPaths&#8221; \u306b\u3001\u5148\u306e site-packages \u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u8a2d\u5b9a\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3046\u3059\u308b\u3068\u3001ExcelLikeUno \u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u5b9a\u7fa9\u3057\u3066\u3042\u308b Sheet \u30af\u30e9\u30b9\u306a\u3069\u3067\u3001\u30b3\u30fc\u30c9\u88dc\u5b8c\u304c\u50cd\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2026\/01\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"681\" src=\"https:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2026\/01\/image-7-1024x681.png\" alt=\"\" class=\"wp-image-11930\" srcset=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2026\/01\/image-7-1024x681.png 1024w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2026\/01\/image-7-300x199.png 300w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2026\/01\/image-7-768x511.png 768w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2026\/01\/image-7-1536x1021.png 1536w, http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2026\/01\/image-7.png 1620w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>\u3053\u308c\u3060\u3068\u3001uno api \u5358\u4f53\u3088\u308a\u306f\u306f\u308b\u304b\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3057\u3084\u3059\u3044\u3057\u3001VBA \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u305f\u304b\u3093\u3058\u3067 Excel VBA \u98a8\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3042\u3068\u306f\u3001Excel VBA \u3068 uno api \u306e\u5bfe\u5fdc\u8868\u3092\u4f5c\u308a\u306a\u304c\u3089\u3001\u3061\u307e\u3061\u307e\u3068\u30af\u30e9\u30b9\u8a2d\u8a08\u3092\u3057\u3066\u3044\u3051\u3070\u826f\u3044\u306f\u305a\u3002uno api \u306e\u307b\u3046\u304c Java \u7684\u306b\u7dba\u9e97\u306b\u6574\u7406\u3055\u308c\u306f\u3044\u308b\u306e\u3060\u3051\u308c\u3069\u3001Excel VBA \u306e\u69cb\u9020\u306b\u6163\u308c\u3066\u3044\u308b\u3068\u3001\u3044\u307e\u3044\u3061\u767a\u60f3\u304c\u5c4a\u304b\u306a\u3044\u306e\u3067\u3059\u3002\u307e\u3042\u3001\u3044\u3063\u305f\u3093\u3001Excel VBA \u306b\u76f4\u3057\u3066\u304b\u3089\u3001\u3042\u3089\u305f\u3081\u3066 UNO api \u98a8\u306b\u623b\u3057\u3066\u3044\u3051\u3070\u3088\u3044\u304b\u306a\u3068\u3002<\/p>\n\n\n\n<p>\u3068\u3053\u308d\u3067 LibreOffice Python \u3067\u3082\u81ea\u7531\u306b pip \u304c\u3067\u304d\u308b\uff08\u591a\u5206\u3001\u4eee\u60f3\u74b0\u5883\u3067\u306f\u7121\u7406\u3060\u308d\u3046\u3051\u3069\uff09\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u306e\u3067\u3001\u901a\u5e38\u306e pip \u30d1\u30c3\u30b1\u30fc\u30b8\u3082 Calc \u5185\u90e8\u304b\u3089\u4f7f\u3048\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>OpenAI \u95a2\u4fc2\u306e API \u3092\u547c\u3073\u51fa\u3057<\/li>\n\n\n\n<li>PyNum \u95a2\u4fc2\u3067\u6570\u5f0f\u3092\u4f7f\u3063\u3066\u30b0\u30e9\u30d5\u3092\u4f5c\u6210<\/li>\n\n\n\n<li>Python \u30de\u30af\u30ed\u5185\u304b\u3089 Web API \u547c\u3073\u51fa\u3057<\/li>\n<\/ul>\n\n\n\n<p>\u3042\u305f\u308a\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u306e\u3042\u305f\u308a\u306f\u3001\u5225\u9014\u305f\u3081\u3057\u3066\u307f\u308b\u4e88\u5b9a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9577\u5e74&#8230;\u3068\u3044\u3063\u3066\u3082\u3001\u534a\u6708\u307b\u3069\u3067\u3059\u304c\u3001\u61f8\u5ff5\u3067\u3042\u3063\u305f LibreOffice \u306e Python \u30de\u30af\u30ed\u3067 pip \u3092\u4f7f\u3048\u308b\u65b9\u6cd5\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002 moonmile\/ExcelLikeUno: LibreOffice  &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/11929\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,109,25],"tags":[],"class_list":["post-11929","post","type-post","status-publish","format-standard","hentry","category-dev","category-libreoffice","category-python"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/11929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=11929"}],"version-history":[{"count":3,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/11929\/revisions"}],"predecessor-version":[{"id":11946,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/11929\/revisions\/11946"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=11929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=11929"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=11929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}