pip install python-office

Overview

github license

🍬 python for office

👉 http://www.python4office.cn/ 👈

github star github contributors github forks github issues github license github license

gitee star gitee fork


🌎 English Documentation


📚 简介

Python-office 是一个 Python 自动化办公第三方库,能解决大部分自动化办公的问题。而且每个功能只需一行代码,不需要小白用户学习 Python 知识,做到了真正的开箱即用。

🍺 特点

  • 一键搭建所有 Python + 自动化办公的编程环境。
  • 使用一行代码解决大部分自动化办公的问题,不需要小白学习 Python 知识
  • 贴合职场办公需求
  • 极简编程,学习成本极低,工作效率提升显著

📦 安装

🍊 pip 自动下载&更新

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python-office -U

📝 文档

📘 中文文档

🎬 视频介绍


🛠️ 包含组件

以下所有功能,都在逐步搭建中。

模块 介绍
excel excel处理
word word处理
ppt ppt处理
pdf pdf处理
file 文件和文件夹的操作
tools 便捷小工具
web 网站快捷搭建
email 邮件功能
image 图片处理
video 视频处理
ocr 识别功能:文字识别、语音识别

可以根据需求对每个模块单独引入,也可以通过import office方式引入所有模块。


🏗️ 添砖加瓦

📐 PR的建议

python-office欢迎任何人来添砖加瓦,贡献代码,建议提交的pr(pull request)符合一些规范,规范如下:

参与项目建设的步骤:

  • 例如:你需要给python-office添加一个add方法。
    1. 你的Github账户名为:demo
    2. 于是你在./contributors新建了文件夹./demo
    3. 新建了add.py文件,编辑你的代码
    4. 编辑完成,提交pr到master分支(gitee或者GitHub,都可以)。可以注明你对自己功能的取名建议
    5. 晚枫收到后,会对各位的代码进行测试后,合并后打包上传到python官方库

📐 代码规范

  1. 注释完备,尤其每个新增的方法应按照Google Python文档规范标明方法说明、参数说明、返回值说明等信息,必要时请添加单元测试,如果愿意,也可以加上你的大名。
  2. python-office的文档,需要进行格式化。注意:只能格式化你自己的代码
  3. 请直接pull request到master分支。master是主分支,表示已经发布pypi库的版本。未来参与人数增多,会开辟新的分支,请留意本文档的更新。
  4. 我们如果关闭了你的issue或pr,请不要诧异,这是我们保持问题处理整洁的一种方式,你依旧可以继续讨论,当有讨论结果时我们会重新打开。

🧬 贡献代码的步骤

  1. 在Gitee或者Github上fork项目到自己的repo
  2. 把fork过去的项目也就是你的项目clone到你的本地
  3. 修改代码
  4. commit后push到自己的库
  5. 登录Gitee或Github在你首页可以看到一个 pull request 按钮,点击它,填写一些说明信息,然后提交到master分支即可。
  6. 等待维护者合并

🎋 分支说明

python-office的源码分为两个分支,功能如下:

分支 作用
master 主分支,pypi发布版本使用的分支,可以直接pr
develop 开发分支,供大家各自开发使用

🐞 提供bug反馈或建议

提交问题反馈时,请务必填写和python-office代码本身有关的问题,不进行有关python学习,甚至是个人练习的知识答疑和讨论。


🪙 支持python-office

💳 捐赠

如果你觉得python-office不错,可以捐赠请维护者喝杯咖啡~,在此表示感谢^_^。

捐赠给项目 👈 该项捐赠仅用于支持本项目发展使用

捐赠给程序员晚枫


Star python-office

Stargazers over time

📌 公众号&开源小组

Comments
  • 社区规范化问题:预设

    社区规范化问题:预设

    目前,这个开源项目正处在蓬勃的发展当中,但是在发展的过程中需要更多的规范化。客户以及开发者提出了各种各样的需求,有一些需求比较大众,有一些需求比较小众。如果不对这些需求加以区分而盲目的将api合入office的库中,会导致整个库十分臃肿且没有中心,这势必会对于整个开源生态的发展非常的不利。 为此,我建议采用类似主体+插件的形式对于开源代码进行维护。主体保留最常见的相应功能,这一部分功能是用户使用的频率最高的,呼声最大的功能。而插件——在这里被我称为预设,则保证小众的需求,让客户可以选择的下载。同时在某些预设的使用量较高的情况下,将其合入主体。 这样子有几个好处:首先是,可以分清楚主次以及开发者的职责。主体由项目的主要开发者维护,而预设则主要由预设的创作者来维护。这样子不会出现某些主要开发者专注于维护低频次使用的功能而忽视主要功能的维护升级。 其次是方便项目维护,稳定的特性可以放置在主体中进行维护与迭代,而非稳定的特性可以放到预设进行开发,直到稳定再合入主体。 另外就是鼓励了创作者的开发热情。由于预设并不一定要是完整的功能,仅仅是一个小的办公脚本中就可以加入预设,这样子每一个使用了python脚本的人都可以把自己的脚本分享出来。这就有点类似创意工坊的感觉,可以极大的增加创作者的热情。 当然,预设仍有许多规范化问题需要解决,这需要社区进行讨论,制定相应的预设编写规范以及导入方法

    good first issue 
    opened by mingerfan 4
  • 添加单元测试

    添加单元测试

    现在的贡献方式是在contributors文件夹下编辑各自的代码,再由核心维护者手动把功能整合进office文件夹中,再上传到PyPI上,这种方式有以下弊端:

    • 增加了核心维护者 @CoderWanFeng 进行code review的工作量
    • 贡献者代码质量难以保证,同时优质功能上线周期也长
    • 由于相对路径、相对导入存在一些坑,从contributors到主文件夹的迁移可能产生新的bug
    • office文件夹下现存的实现有的是半成品,有的有待优化,但大家不敢乱动,生怕向后不兼容

    综上原因我建议,在根目录(与office文件夹)建一个tests文件夹,里面存储各模块的单元测试, 同时也改变一下贡献的方式,允许有把握的同学在不改变原有单元测试的前提下,直接commit到office目录,保证新增的功能也提供了有效的单元测试,测试通过后,在核心开发者认定代码质量够高后,即可直接merge并推送到PyPI,实现新功能的快速上线

    enhancement 
    opened by CNSeniorious000 2
  • 安装报错

    安装报错

    在Pycharm 中 输入pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python-office -U 都能正常安装,但有一个报错,导致安装失败

    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. paddlepaddle-gpu 2.2.2 requires numpy<=1.19.3,>=1.13; python_version >= "3.5" and platform_system == "Windows", but you have numpy 1.22.3 which is incompatible.

    opened by ahulxj 2
  • mac 安装后, 运行报错

    mac 安装后, 运行报错

    1. 安装后 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python-office -U

    2. 执行 office.excel.fake2excel(columns=['name', 'text'], rows=20)

    3. 报错

    Traceback (most recent call last):
      File "/Users/xxx/work_code/python-lessons/main.py", line 9, in <module>
        import office
      File "/Users/xxx/work_code/python-lessons/venv/lib/python3.8/site-packages/office/__init__.py", line 1, in <module>
        from . import word
      File "/Users/xxx/work_code/python-lessons/venv/lib/python3.8/site-packages/office/word.py", line 12, in <module>
        from win32com.client import constants, gencache
    ModuleNotFoundError: No module named 'win32com'
    
    1. 再次安装缺少的 win32
    pip install pypiwin32
    
    1. 安装 win32 报错
    Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
    Collecting pypiwin32
      Using cached https://mirrors.aliyun.com/pypi/packages/d0/1b/2f292bbd742e369a100c91faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl (1.7 kB)
      Using cached https://mirrors.aliyun.com/pypi/packages/2b/ca/5c086c18de8f70222787b3e824e755b68d99272531522e77bb381d4f60c8/pypiwin32-219.zip (4.8 MB)
      Preparing metadata (setup.py) ... error
      error: subprocess-exited-with-error
      
      × python setup.py egg_info did not run successfully.
      │ exit code: 1
      ╰─> [7 lines of output]
          Traceback (most recent call last):
            File "<string>", line 2, in <module>
            File "<pip-setuptools-caller>", line 34, in <module>
            File "/private/var/folders/2p/c0c3rrys09b8c8y0rrkscn8r0000gn/T/pip-install-b18sn648/pypiwin32_0e47d8d13683441e9c213f629f92a95f/setup.py", line 121
              print "Building pywin32", pywin32_version
                    ^
          SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Building pywin32", pywin32_version)?
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: metadata-generation-failed
    
    × Encountered error while generating package metadata.
    ╰─> See above for output.
    
    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.
    
    opened by xingguang2013 1
  • 希望每个功能都能提供一个CLI接口

    希望每个功能都能提供一个CLI接口

    使用场景:在一个充满屏幕截图的文件夹下,用一行命令将这些截图转为ppt

    建议:将命令命名为py-office或者poffice或者po,短命令好打

    这样上述使用场景需要的命令大概是:

    po img2ppt -i . -o output.pptx
    # or:
    python -m python-office img2ppt -i . -o output.pptx
    

    要实现这个功能,需要:

    1. python-office的每个子包都有一个__main__.py文件
    2. 打包一个总的__main__.py为一个exe文件,比如命名为po.exe

    建议:对CLI参数的解析可以借助标准库的argparse模块,

    但个人更推荐使用第三方库typer,用装饰器的方式,更直观更便捷地将已有的功能函数转为cli接口


    提供cli接口的一个用处是,让几乎完全没有python基础的人也能使用python-office

    enhancement 
    opened by CNSeniorious000 1
  • Mac 没办法做支持的吧

    Mac 没办法做支持的吧

    Mac 没办法做支持的吧,安装pip python-office 不报错,执行 /Users/betty/PycharmProjects/pythonProject/venv/bin/python /Users/betty/PycharmProjects/pythonProject/myfaker.py Traceback (most recent call last): File "/Users/betty/PycharmProjects/pythonProject/myfaker.py", line 6, in import office File "/Users/betty/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/office/init.py", line 1, in from office.api import word File "/Users/betty/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/office/api/word.py", line 13, in from office.core.WordType import MainWord File "/Users/betty/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/office/core/WordType.py", line 2, in from win32com.client import constants, gencache ModuleNotFoundError: No module named 'win32com'

    opened by bytebitgo 7
Releases(0.1.38)
Owner
程序员晚枫
💻法学院毕业的Python程序员 💪请大家多指点
程序员晚枫
Office source code of paper UniFuse: Unidirectional Fusion for 360$^\circ$ Panorama Depth Estimation

UniFuse (RAL+ICRA2021) Office source code of paper UniFuse: Unidirectional Fusion for 360$^\circ$ Panorama Depth Estimation, arXiv, Demo Preparation I

Alibaba 47 Dec 26, 2022
Pip-package for trajectory benchmarking from "Be your own Benchmark: No-Reference Trajectory Metric on Registered Point Clouds", ECMR'21

Map Metrics for Trajectory Quality Map metrics toolkit provides a set of metrics to quantitatively evaluate trajectory quality via estimating consiste

Mobile Robotics Lab. at Skoltech 31 Oct 28, 2022
Install alphafold on the local machine, get out of docker.

AlphaFold This package provides an implementation of the inference pipeline of AlphaFold v2.0. This is a completely new model that was entered in CASP

Kui Xu 73 Dec 13, 2022
Download & Install mods for your favorit game with a few simple clicks

Husko's SteamWorkshop Downloader ?? IMPORTANT ❗ ?? The Tool is currently being rewritten so updates will be slow and only on the dev branch until it i

Husko 67 Nov 25, 2022
tinykernel - A minimal Python kernel so you can run Python in your Python

tinykernel - A minimal Python kernel so you can run Python in your Python

fast.ai 37 Dec 2, 2022
Python-experiments - A Repository which contains python scripts to automate things and make your life easier with python

Python Experiments A Repository which contains python scripts to automate things

Vivek Kumar Singh 11 Sep 25, 2022
Crab is a flexible, fast recommender engine for Python that integrates classic information filtering recommendation algorithms in the world of scientific Python packages (numpy, scipy, matplotlib).

Crab - A Recommendation Engine library for Python Crab is a flexible, fast recommender engine for Python that integrates classic information filtering r

python-recsys 1.2k Dec 21, 2022
Python scripts to detect faces in Python with the BlazeFace Tensorflow Lite models

Python scripts to detect faces using Python with the BlazeFace Tensorflow Lite models. Tested on Windows 10, Tensorflow 2.4.0 (Python 3.8).

Ibai Gorordo 46 Nov 17, 2022
A fast python implementation of Ray Tracing in One Weekend using python and Taichi

ray-tracing-one-weekend-taichi A fast python implementation of Ray Tracing in One Weekend using python and Taichi. Taichi is a simple "Domain specific

null 157 Dec 26, 2022
Technical Indicators implemented in Python only using Numpy-Pandas as Magic - Very Very Fast! Very tiny! Stock Market Financial Technical Analysis Python library . Quant Trading automation or cryptocoin exchange

MyTT Technical Indicators implemented in Python only using Numpy-Pandas as Magic - Very Very Fast! to Stock Market Financial Technical Analysis Python

dev 34 Dec 27, 2022
This is an open source python repository for various python tests

Welcome to Py-tests This is an open source python repository for various python tests. This is in response to the hacktoberfest2021 challenge. It is a

Yada Martins Tisan 3 Oct 31, 2021
Composable transformations of Python+NumPy programsComposable transformations of Python+NumPy programs

Chex Chex is a library of utilities for helping to write reliable JAX code. This includes utils to help: Instrument your code (e.g. assertions) Debug

DeepMind 506 Jan 8, 2023
Automatic self-diagnosis program (python required)Automatic self-diagnosis program (python required)

auto-self-checker 자동으로 자가진단 해주는 프로그램(python 필요) 중요 이 프로그램이 실행될때에는 절대로 마우스포인터를 움직이거나 키보드를 건드리면 안된다(화면인식, 마우스포인터로 직접 클릭) 사용법 프로그램을 구동할 폴더 내의 cmd창에서 pip

null 1 Dec 30, 2021
POPPY (Physical Optics Propagation in Python) is a Python package that simulates physical optical propagation including diffraction

POPPY: Physical Optics Propagation in Python POPPY (Physical Optics Propagation in Python) is a Python package that simulates physical optical propaga

Space Telescope Science Institute 132 Dec 15, 2022
Space-invaders - Simple Game created using Python & PyGame, as my Beginner Python Project

Space Invaders This is a simple SPACE INVADER game create using PYGAME whihc hav

Gaurav Pandey 2 Jan 8, 2022
null 2 Jul 19, 2022
Yolov5-opencv-cpp-python - Example of using ultralytics YOLO V5 with OpenCV 4.5.4, C++ and Python

yolov5-opencv-cpp-python Example of performing inference with ultralytics YOLO V

null 183 Jan 9, 2023
Python-kafka-reset-consumergroup-offset-example - Python Kafka reset consumergroup offset example

Python Kafka reset consumergroup offset example This is a simple example of how

Willi Carlsen 1 Feb 16, 2022