Skip to main content

Extract data from forms in Microsoft Word documents.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wordscrape-0.3.zip (4.5 kB view details)

Uploaded Source

File details

Details for the file wordscrape-0.3.zip.

File metadata

  • Download URL: wordscrape-0.3.zip
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wordscrape-0.3.zip
Algorithm Hash digest
SHA256 d6e8e174c24efe7e695be323e978fe24b7a2d0b8a98898bb366ed2b22a1f24c6
MD5 01a32a02a9954dc40efdd5e8ec19897b
BLAKE2b-256 a6b1680f56a8bd1ffb0f1ab3b35285cbe5917ea52afbb58149332566d123e97f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page