ChatGPT copilot for office files
Project description
copilot4office
copilot4office is a robust Python package crafted to facilitate the creation of office files, such as PowerPoint presentations, from response texts generated by chat models like ChatGPT. Leveraging the advanced natural language processing capabilities of ChatGPT, copilot4office aims to enhance productivity by enabling the generation of contextual and meaningful content across various office documents.
Features
- PowerPoint Integration: Assist in creating comprehensive presentations with autogenerated text for slides.
Installation
copilot4office can be easily installed via pip from PyPI:
pip install copilot4office
Alternatively, if you want to install the latest version directly from GitHub:
pip install git+https://github.com/fslurrehman/copilot4office.git
How it Works?
copilot4office makes it easy for you to create slides from Chat Prompts for slides.
- You ask ChatGPT or Gemini to create slides for you as per sample slides text provided in
examples\data\in\presentation.txt. Copy the chat responce using copy button in the ChatGPT Web App and paste it in a plain text file. - Run commands as explained in usage to get your presentation right from the text generated by Chat prompts.
- Then, you can refine your slides in powerpoint.
Usage
After installation, you can start using copilot4office by importing it into your Python script. Here's a basic example of generating text for a PowerPoint slide:
from presentation.presentation_processor import PresentationProcessor
prsp= PresentationProcessor()
#if you are running python from project root then below shall be the path
#if you are running python from examples folder then path shall be: \data\in\presentation.txt
text =prsp.read_text_from_file(r'examples\data\in\presentation.txt')
jsn = prsp.text_to_json(text)
print(jsn)
#if you are running python from project root then below shall be the path
#if you are running python from examples folder then path shall be: \data\out\presentation.json
r = prsp.save_to_file(jsn, r'examples\data\out\presentation.json')
print(r)
Make sure to check examples\data\in\presentation.txt which is a sample text file that you will use to create json file for presentation.
Here's example of creating powerpoint pptx from json file:
from presentation.presentation_creator import PresentationCreator
#if you are running python from project root then below shall be the path
#if you are running python from examples folder then path shall be: \data\in\jsn.json
creator = PresentationCreator(r'examples\data\in\jsn.json')
content = creator.load_content_from_json()
if creator.validate_content_data(content):
#if you are running python from project root then below shall be the path
#if you are running python from examples folder then path shall be: data\out\output_presentation.pptx
creator.create_presentation(content, r"examples\data\out\output_presentation.pptx")
Developer Guide
Contributors are welcome to enhance copilot4office by adding new features, improving existing ones, or fixing bugs. Here's how to get started:
- Clone the Repository:
git clone https://github.com/fslurrehman/copilot4office.git
- Set Up a Virtual Environment:
python -m venv .venv source .venv/bin/activate # On Windows use `env\Scripts\activate`
- Install Development Dependencies:
pip install -r requirements.txt
- Run Tests:
Make sure all tests pass to ensure your setup is correct.
python -m unittest tests.test_presentation_processor python -m unittest tests.test_presentation_creator
Contributing
To contribute to copilot4office, please fork the repository, make your changes, and submit a pull request. For more details, see the CONTRIBUTING.md file.
TODO
- Add word support.
- Add excel support.
- Add ChatGPT API to create text.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any problems or have suggestions, please file an issue on the GitHub repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file copilot4office-0.2.tar.gz.
File metadata
- Download URL: copilot4office-0.2.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fc28829081f01609be43c3ffb269cdddd4f9202a353b6f0becca80d0bf981bd
|
|
| MD5 |
72bb4467141d3c5504cf740320980829
|
|
| BLAKE2b-256 |
f3ae9a4d04d850d094d5be4f445c73b8b8ec238303e01716e3908ae73a2a377d
|
File details
Details for the file copilot4office-0.2-py3-none-any.whl.
File metadata
- Download URL: copilot4office-0.2-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c93ef571514764d3f189bb9abe6b7569e97b2a26aaad8bdf3c1bc122746ed8be
|
|
| MD5 |
5d9b799f71be238ab56bbb3478dac5bc
|
|
| BLAKE2b-256 |
b5e1c68b8e6f0fc645a7e636983768f43f1d677a7c856e130050c68fcfc72907
|