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程序员 💪请大家多指点
程序员晚枫
Code that accompanies the paper Semi-supervised Deep Kernel Learning: Regression with Unlabeled Data by Minimizing Predictive Variance

Semi-supervised Deep Kernel Learning This is the code that accompanies the paper Semi-supervised Deep Kernel Learning: Regression with Unlabeled Data

58 Oct 26, 2022
PyTorch implementation of the ExORL: Exploratory Data for Offline Reinforcement Learning

ExORL: Exploratory Data for Offline Reinforcement Learning This is an original PyTorch implementation of the ExORL framework from Don't Change the Alg

Denis Yarats 52 Jan 01, 2023
Like ThreeJS but for Python and based on wgpu

pygfx A render engine, inspired by ThreeJS, but for Python and targeting Vulkan/Metal/DX12 (via wgpu). Introduction This is a Python render engine bui

139 Jan 07, 2023
BEGAN in PyTorch

BEGAN in PyTorch This project is still in progress. If you are looking for the working code, use BEGAN-tensorflow. Requirements Python 2.7 Pillow tqdm

Taehoon Kim 260 Dec 07, 2022
Luminous is a framework for testing the performance of Embodied AI (EAI) models in indoor tasks.

Luminous is a framework for testing the performance of Embodied AI (EAI) models in indoor tasks. Generally, we intergrete different kind of functional

28 Jan 08, 2023
Autolfads-tf2 - A TensorFlow 2.0 implementation of Latent Factor Analysis via Dynamical Systems (LFADS) and AutoLFADS

autolfads-tf2 A TensorFlow 2.0 implementation of LFADS and AutoLFADS. Installati

Systems Neural Engineering Lab 11 Oct 29, 2022
Benchmarks for the Optimal Power Flow Problem

Power Grid Lib - Optimal Power Flow This benchmark library is curated and maintained by the IEEE PES Task Force on Benchmarks for Validation of Emergi

A Library of IEEE PES Power Grid Benchmarks 207 Dec 08, 2022
PyTorch implementation of SimSiam: Exploring Simple Siamese Representation Learning

SimSiam: Exploring Simple Siamese Representation Learning This is a PyTorch implementation of the SimSiam paper: @Article{chen2020simsiam, author =

Facebook Research 834 Dec 30, 2022
A PyTorch implementation of Multi-digit Number Recognition from Street View Imagery using Deep Convolutional Neural Networks

SVHNClassifier-PyTorch A PyTorch implementation of Multi-digit Number Recognition from Street View Imagery using Deep Convolutional Neural Networks If

Potter Hsu 182 Jan 03, 2023
Soomvaar is the repo which 🏩 contains different collection of 👨‍💻🚀code in Python and 💫✨Machine 👬🏼 learning algorithms📗📕 that is made during 📃 my practice and learning of ML and Python✨💥

Soomvaar 📌 Introduction Soomvaar is the collection of various codes implement in machine learning and machine learning algorithms with python on coll

Felix-Ayush 42 Dec 30, 2022
Code for EMNLP 2021 paper Contrastive Out-of-Distribution Detection for Pretrained Transformers.

Contra-OOD Code for EMNLP 2021 paper Contrastive Out-of-Distribution Detection for Pretrained Transformers. Requirements PyTorch Transformers datasets

Wenxuan Zhou 27 Oct 28, 2022
PyTorch implementation of SimCLR: A Simple Framework for Contrastive Learning of Visual Representations

PyTorch implementation of SimCLR: A Simple Framework for Contrastive Learning of Visual Representations

Thalles Silva 1.7k Dec 28, 2022
Let's create a tool to convert Thailand budget from PDF to CSV.

thailand-budget-pdf2csv Let's create a tool to convert Thailand Government Budgeting from PDF to CSV! รวมพลัง Dev แปลงงบ จาก PDF สู่ Machine-readable

Kao.Geek 88 Dec 19, 2022
OpenVisionAPI server

🚀 Quick start An instance of ova-server is free and publicly available here: https://api.openvisionapi.com Checkout ova-client for a quick demo. Inst

Open Vision API 93 Nov 24, 2022
SBINN: Systems-biology informed neural network

SBINN: Systems-biology informed neural network The source code for the paper M. Daneker, Z. Zhang, G. E. Karniadakis, & L. Lu. Systems biology: Identi

Lu Group 15 Nov 19, 2022
A dual benchmarking study of visual forgery and visual forensics techniques

A dual benchmarking study of facial forgery and facial forensics In recent years, visual forgery has reached a level of sophistication that humans can

8 Jul 06, 2022
Mask2Former: Masked-attention Mask Transformer for Universal Image Segmentation in TensorFlow 2

Mask2Former: Masked-attention Mask Transformer for Universal Image Segmentation in TensorFlow 2 Bowen Cheng, Ishan Misra, Alexander G. Schwing, Alexan

Phan Nguyen 1 Dec 16, 2021
Public repository containing materials used for Feed Forward (FF) Neural Networks article.

Art041_NN_Feed_Forward Public repository containing materials used for Feed Forward (FF) Neural Networks article. -- Illustration of a very simple Fee

SolClover 2 Dec 29, 2021
Bottom-up attention model for image captioning and VQA, based on Faster R-CNN and Visual Genome

bottom-up-attention This code implements a bottom-up attention model, based on multi-gpu training of Faster R-CNN with ResNet-101, using object and at

Peter Anderson 1.3k Jan 09, 2023
ChineseBERT: Chinese Pretraining Enhanced by Glyph and Pinyin Information

ChineseBERT: Chinese Pretraining Enhanced by Glyph and Pinyin Information This repository contains code, model, dataset for ChineseBERT at ACL2021. Ch

413 Dec 01, 2022