You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
godo 877198da9a add res 5 months ago
..
etree change base office 6 months ago
ole2 change base office 6 months ago
pdf change base office 6 months ago
xls change base office 6 months ago
xlsx change base office 6 months ago
LICENSE change base office 6 months ago
Readme.md change base office 6 months ago
darwin.go change base office 6 months ago
doc.go change base office 6 months ago
document.go add res 5 months ago
document_test.go add ai chat with file 5 months ago
docx.go change base office 6 months ago
epub.go change base office 6 months ago
html.go change base office 6 months ago
json.go change base office 6 months ago
linux.go change base office 6 months ago
md.go change base office 6 months ago
odt.go change base office 6 months ago
ppt.go change base office 6 months ago
pptx.go change base office 6 months ago
reader.go change base office 6 months ago
rtf.go change base office 6 months ago
splittext.go add onlyoffice 6 months ago
totxt.go add onlyoffice 6 months ago
txt.go change base office 6 months ago
types.go add onlyoffice 6 months ago
windows.go change base office 6 months ago
xls.go change base office 6 months ago
xml.go change base office 6 months ago

Readme.md

📄 Gh0ffice (Office/PDF File Parser)

Modifications

  • 2024=12-08 godoos: add support for odt/epub/xml/rtf/md/txt/html/json files

This Go-based project provides a robust parser for various office document formats, including DOCX/DOC, PPTX/PPT, XLSX/XLS, and PDF. The parser extracts both content and metadata from these file types, allowing easy access to structured document data for further processing or analysis.

🛠 Features

  • Metadata Extraction: Captures essential metadata such as title, author, keywords, and modification dates.
  • Content Parsing: Supports extraction of text content from multiple file formats.
  • Extensible Architecture: Easily add support for new file formats by implementing additional reader functions.

📂 Supported Formats

  • DOCX: Extracts text content from Word documents.
  • PPTX: Extracts text content from PowerPoint presentations.
  • XLSX: Extracts data from Excel spreadsheets.
  • DOC: Extracts text content from Legacy Word documents.
  • PPT: Extracts text content from Legacy PowerPoint presentations.
  • XLS: Extracts data from Legacy Excel spreadsheets.
  • PDF: Extracts text content from PDF files (note that some complex PDFs may not be fully supported).

📖 Installation

To use this project, ensure you have Go installed on your system. Clone this repository and run the following command to install the dependencies:

go mod tidy

🚀 Usage

Basic Usage

You can inspect a document and extract its content and metadata by calling the inspectDocument function with the file path as follows:

doc, err := gh0ffice.InspectDocument("path/to/your/file.docx")
if err != nil {
    log.Fatalf("Error reading document: %s", err)
}
fmt.Printf("Title: %s\n", doc.Title)
fmt.Printf("Content: %s\n", doc.Content)

Debugging

Set the DEBUG variable to true to enable logging for more verbose output during the parsing process:

const DEBUG bool = true

⚠️ Limitations

  • The PDF parsing may fail on certain complex or malformed documents.
  • Only straightforward text extraction is performed; formatting and images are not considered.
  • Compatibility tested primarily on major office file formats.

📝 License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

📬 Contributing

Contributions are welcome! Please feel free to create issues or submit pull requests for new features or bug fixes.

👥 Author

This project is maintained by the team and community of YT-Gh0st. Contributions and engagements are always welcome!


For any questions or suggestions, feel free to reach out. Happy parsing! 😊