Skip to content

Radcliffe/wordscrape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wordscrape

This package contains utilities for extracting form data from Microsoft Word 2007 documents with the .docx extension. It reads Check Box Form Fields and Text Form Fields, which are both classified as legacy controls. Subsequent versions will support more kinds of controls.

Basic usage example:

>>> from wordscrape import WordDocument
>>> doc = WordDocument('form.docx')
>>> data = doc.get_form_data()

The function get_form_data returns an OrderedDict containing all field names and values.

Wordscrape can read form data from multiple Word documents, and write the data to a single CSV file, while ensuring that the field names match.

>>> from wordscrape import WordDocument, read_dir, write_csv
>>> path = '/temp/forms/'
>>> all_data = read_dir(path)
>>> write_csv(all_data, 'report.csv')

The function all_data returns a list of ordered dictionaries, and the function write_csv writes the data to a CSV file with a header row.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages