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程序员 💪请大家多指点
程序员晚枫
ERISHA is a mulitilingual multispeaker expressive speech synthesis framework. It can transfer the expressivity to the speaker's voice for which no expressive speech corpus is available.

ERISHA: Multilingual Multispeaker Expressive Text-to-Speech Library ERISHA is a multilingual multispeaker expressive speech synthesis framework. It ca

Ajinkya Kulkarni 43 Nov 27, 2022
An open source bike computer based on Raspberry Pi Zero (W, WH) with GPS and ANT+. Including offline map and navigation.

Pi Zero Bikecomputer An open-source bike computer based on Raspberry Pi Zero (W, WH) with GPS and ANT+ https://github.com/hishizuka/pizero_bikecompute

hishizuka 264 Jan 02, 2023
BarcodeRattler - A Raspberry Pi Powered Barcode Reader to load a game on the Mister FPGA using MBC

Barcode Rattler A Raspberry Pi Powered Barcode Reader to load a game on the Mist

Chrissy 29 Oct 31, 2022
Meandering In Networks of Entities to Reach Verisimilar Answers

MINERVA Meandering In Networks of Entities to Reach Verisimilar Answers Code and models for the paper Go for a Walk and Arrive at the Answer - Reasoni

Shehzaad Dhuliawala 271 Dec 13, 2022
NeuralCompression is a Python repository dedicated to research of neural networks that compress data

NeuralCompression is a Python repository dedicated to research of neural networks that compress data. The repository includes tools such as JAX-based entropy coders, image compression models, video c

Facebook Research 297 Jan 06, 2023
Object tracking implemented with YOLOv4, DeepSort, and TensorFlow.

Object tracking implemented with YOLOv4, DeepSort, and TensorFlow. YOLOv4 is a state of the art algorithm that uses deep convolutional neural networks to perform object detections. We can take the ou

The AI Guy 1.1k Dec 29, 2022
IMBENS: class-imbalanced ensemble learning in Python.

IMBENS: class-imbalanced ensemble learning in Python. Links: [Documentation] [Gallery] [PyPI] [Changelog] [Source] [Download] [知乎/Zhihu] [中文README] [a

Zhining Liu 176 Jan 04, 2023
🗺 General purpose U-Network implemented in Keras for image segmentation

TF-Unet General purpose U-Network implemented in Keras for image segmentation Getting started • Training • Evaluation Getting started Looking for Jupy

Or Fleisher 2 Aug 31, 2022
This project aims at providing a concise, easy-to-use, modifiable reference implementation for semantic segmentation models using PyTorch.

Semantic Segmentation on PyTorch (include FCN, PSPNet, Deeplabv3, Deeplabv3+, DANet, DenseASPP, BiSeNet, EncNet, DUNet, ICNet, ENet, OCNet, CCNet, PSANet, CGNet, ESPNet, LEDNet, DFANet)

2.4k Jan 08, 2023
Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

CoProtector Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

Zhensu Sun 1 Oct 26, 2021
PASTRIE: A Corpus of Prepositions Annotated with Supersense Tags in Reddit International English

PASTRIE Official release of the corpus described in the paper: Michael Kranzlein, Emma Manning, Siyao Peng, Shira Wein, Aryaman Arora, and Nathan Schn

NERT @ Georgetown 4 Dec 02, 2021
Implementation of the state-of-the-art vision transformers with tensorflow

ViT Tensorflow This repository contains the tensorflow implementation of the state-of-the-art vision transformers (a category of computer vision model

Mohammadmahdi NouriBorji 2 Mar 16, 2022
AdaFocus V2: End-to-End Training of Spatial Dynamic Networks for Video Recognition

AdaFocusV2 This repo contains the official code and pre-trained models for AdaFo

79 Dec 26, 2022
Open-L2O: A Comprehensive and Reproducible Benchmark for Learning to Optimize Algorithms

Open-L2O This repository establishes the first comprehensive benchmark efforts of existing learning to optimize (L2O) approaches on a number of proble

VITA 161 Jan 02, 2023
Python scripts for performing stereo depth estimation using the MobileStereoNet model in ONNX

ONNX-MobileStereoNet Python scripts for performing stereo depth estimation using the MobileStereoNet model in ONNX Stereo depth estimation on the cone

Ibai Gorordo 23 Nov 29, 2022
Interactive web apps created using geemap and streamlit

geemap-apps Introduction This repo demostrates how to build a multi-page Earth Engine App using streamlit and geemap. You can deploy the app on variou

Qiusheng Wu 27 Dec 23, 2022
[ICML 2021] A fast algorithm for fitting robust decision trees.

GROOT: Growing Robust Trees Growing Robust Trees (GROOT) is an algorithm that fits binary classification decision trees such that they are robust agai

Cyber Analytics Lab 17 Nov 21, 2022
Deep Learning (with PyTorch)

Deep Learning (with PyTorch) This notebook repository now has a companion website, where all the course material can be found in video and textual for

Alfredo Canziani 6.2k Jan 07, 2023
Official PyTorch Implementation of Mask-aware IoU and maYOLACT Detector [BMVC2021]

The official implementation of Mask-aware IoU and maYOLACT detector. Our implementation is based on mmdetection. Mask-aware IoU for Anchor Assignment

Kemal Oksuz 46 Sep 29, 2022
code for Grapadora research paper experimentation

Road feature embedding selection method Code for research paper experimentation Abstract Traffic forecasting models rely on data that needs to be sens

Eric López Manibardo 0 May 26, 2022