Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 55 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
voice2json
`voice2json`
=============

*Export your Google Voice call & text history as JSON*

Google Takeout only offers HTML export of your Google Voice call and text message records. `voice2json` converts these HTML files into machine-readable JSON for easier analysis.

## Usage

*Note: Beautiful Soup 4 is a required dependency for HTML parsing. Install it using* `pip install beautifulsoup4`*.*

First, download your Google Voice call history as HTML from [Google Takeout](https://www.google.com/settings/takeout). Unzip the file and navigate to the `Voice/Calls` directory. Then run the `voice2json.py`, passing in the path to the calls directory, and you're all done:

```
$ python voice2json.py /path/to/Takeout/Voice/Calls /path/to/output.json
```

Slightly more detailed:

```
$ python voice2json.py -h
usage: voice2json.py [-h] source [output]
Expand All @@ -30,72 +26,67 @@ optional arguments:
```

## Output

`voice2json` produces a JSON file in the following format:

```js
{
"records": [

// Calls, voicemails, etc...
{
"date": "2013-01-27T04:21:24.000Z", // ISO-formatted date
"duration": 56000.0, // If applicable, the duration of the call
"tags": [ // Array of the tags(s) associated with the record (see below)
"received",
...
],
"contributors": [ // An array of participants in the call
{
"tel": "+01234567890", // Stringified telephone number containing country code
"name": "John Doe" // Name (if known, otherwise an empty string)
},
...
]
},

// Text messages
{
"date": "2014-05-07T19:26:51.780Z", // ISO-formatted start date of conversation
"conversation": [ // A list of messages in the conversation
{
"date": "2014-05-07T19:26:51.780Z", // ISO-formatted date of message
"message": "I'm right behind you.",
"sender": {
"tel": "+01234567890", // Stringified telephone number containing country code
"name": "John Doe" // Name (if known, otherwise an empty string)
}
},
...
],
"contributors": [
{
"tel": "+01234567890", // Stringified telephone number containing country code
"name": "John Doe" // Name (if known, otherwise an empty string)
},
{
"tel": "+01234567890", // Your phone number
"name": "Me"
}
],
"tags": [ // A list of tags for the conversation
"inbox",
"sms"
]
}

...
"records": [
// Calls, voicemails, etc...
{
"date": "2013-01-27T04:21:24.000Z", // ISO-formatted date
"duration": 56000.0, // If applicable, the duration of the call
"tags": [ // Array of the tags(s) associated with the record (see below)
"received",
...
],
"contributors": [ // An array of participants in the call
{
"tel": "+01234567890", // Stringified telephone number containing country code
"name": "John Doe" // Name (if known, otherwise an empty string)
},
...
]
},
// Text messages
{
"date": "2014-05-07T19:26:51.780Z", // ISO-formatted start date of conversation
"conversation": [ // A list of messages in the conversation
{
"date": "2014-05-07T19:26:51.780Z", // ISO-formatted date of message
"message": "I'm right behind you.",
"sender": {
"tel": "+01234567890", // Stringified telephone number containing country code
"name": "John Doe" // Name (if known, otherwise an empty string)
}
},
...
],
"contributors": [
{
"tel": "+01234567890", // Stringified telephone number containing country code
"name": "John Doe" // Name (if known, otherwise an empty string)
},
{
"tel": "+01234567890", // Your phone number
"name": "Me"
}
],
"tags": [ // A list of tags for the conversation
"inbox",
"sms"
]
}
...
}
```

Possible tags include:

- **received** – an incoming call, received and answered
- **missed** – an incoming call that was not answered
- **placed** – an outgoing call
- **inbox** – an item in the Google Voice inbox (e.g., a voicemail)
- **voicemail** – a voicemail message
- **unread** – used in conjunction with a voicemail to indicate that it is unread
- **sms** – a text message
- **received** — an incoming call, received and answered
- **missed** — an incoming call that was not answered
- **placed** — an outgoing call
- **inbox** — an item in the Google Voice inbox (e.g., a voicemail)
- **voicemail** — a voicemail message
- **unread** — used in conjunction with a voicemail to indicate that it is unread
- **sms** — a text message

Happy analyzing!
Loading