Skip to main content

Offline Address Books decoder

Project description

OAB(1)

NAME

oab - Microsoft Exchange/Outlook Offline Address Book (.oab files) decoder

INSTALLATION

Once you have installed Python v3.10+ and its packages manager pip, use the following command to install this tool:

pip install oab

SYNOPSIS

oab [--bar|-b] [--output|-o FILE] [--csv|-C] [--delimiter|-d CHAR] [--excel|-E] [--json|-J] [--compact|-c] [--ident|-i INT] [--table|-T] [--width|-w INT] [--debug] [--help|-?] [--version] [--] filename

DESCRIPTION

The oab utility and library decode Microsoft Exchange/Outlook Offline Address Book (.oab) files, and provide their contents as a Python dictionary or in CSV (delimiter separated values), Excel, JSON, text or tabular formats.

Utility

By default, the utility will print the resulting Python dictionary to standard output as pretty printed text.

It is possible to get CSV, Excel, JSON and pretty table formats instead by using the --csv|-C, --excel|-E, --json|-J or --table|-T options.

For all these formats, the --output|-o option can be used to redirect output to file(s) with an argument indicating the desired basename. oab will add the appropriate file extension and, in the case of CSV and pretty table formats, will separate the results in users and lists contents.

The delimiter used for CSV files can be changed from a comma to the argument of the --delimiter|-d option.

The style used for JSON files can be changed to compact mode with the --compact|-c option, or with an indentation different from 4 spaces with the argument of the --indent|-i option.

The terminal width used for the pretty table files can be changed from the default 80 columns to the argument of the --width|-w option. You should especially use this option When redirecting the program output to a file...

Last and least, you can disable the progress bar with the --bar|-b option.

Python library

There are 5 public functions, one for loading an oab file, the others for converting its result into another format:

import oab

# data is a dict
# filename is a str. For example, "udetails.oab"
# progress_bar is a bool
data = oab.load_oab_file(filename, progress_bar=False)

# delimiter is a str, normally for a single character
# users and lists will be list instances
users, lists = oab.oab2csv(data, parameters["delimiter"])

# basename is a str. For example, "address_book"
oab.oab2excel(data, basename)

# compact is a bool
# indent is an int
json_data = oab.oab2json(data, compact=False, indent=2)

# width is an int
users, lists = oab2table(data, width=173)

OPTIONS

Options Use
--bar|-b Toggle OFF progress bar
--output|-o FILE Output result into FILE (extension added by oab)
--csv|-C Format results as CSV
--delimiter|-d CHAR Use CHAR as delimiter for CSV format
--excel|-E Format results as Excel tabbed file
--json|-J Format results as JSON
--compact|-c Use compact JSON format
--ident|-i INT Use INT spaces for indented JSON format
--table|-T Format results as tables
--width|-w INT Use INT columns in table format
--debug Enable debug mode
--help|-? Print usage and a short help message and exit
--version Print version and exit
-- Options processing terminator

ENVIRONMENT

The COLUMNS environment variable will be used in tabular format if present.

EXIT STATUS

The oab utility exits 0 on success, and >0 if an error occurs.

EXAMPLES

To generate pretty tables with relevant information about users and mailing lists in 2 files, use the following command:

$ oab --table --width 170 --output addressbook udetails.oab

SEE ALSO

Specifications

Other implementations

STANDARDS

The oab utility is not a standard UNIX command.

This implementation tries to follow the PEP 8 style guide for Python code.

PORTABILITY

To be tested under Windows.

HISTORY

This program was made on a rainy sunday in order to investigate the contents of my Outlook .oab files.

It was then used to help cleaning my company's global address list.

LICENSE

It is available under the 3-clause BSD license.

AUTHORS

Hubert Tournier

This program is inspired by antimatter15's boa and includes snippets of code from:

CAVEAT

Only uncompressed version 4 full details files are supported at this time.

BUGS

Excel reports an error while opening generated XLSX files, but after accepting its recovery offer these files appear to be fine...

SECURITY CONSIDERATIONS

OAB files and the results generated by this program contain sensitive personal information that should not be left unprotected.

There are known attacks in the wild targetting these files:

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

oab-1.0.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

oab-1.0.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file oab-1.0.0.tar.gz.

File metadata

  • Download URL: oab-1.0.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for oab-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fb6d1f20302c90f99d4bafe7ee34459ff45f479e7eb8c729150681cfe12859f4
MD5 87a30cc76100bf122b3a1d27c4b752a9
BLAKE2b-256 c55b87f2720f7ae5ab92f4f5abb4c5d0835557c9df3368169fb45d716e16df01

See more details on using hashes here.

File details

Details for the file oab-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: oab-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for oab-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88359e3047086fb2ff9f8a2bbde0c75411cbf6ea58f6e1981ccaba959306a948
MD5 55e4dee86b427b1442bccb9b5e44ce96
BLAKE2b-256 93f5423b5a6c04e31b0c2151256521b5c0d2e3b29758a5ae294bbe4173db4d38

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page