Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch with several improvements #7

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f0f917e
changed input argument infile to accept multiple files; outfile to op…
sdbbs Mar 20, 2024
111401d
added code in dump_header to extract assumed entry heading, and to co…
sdbbs Mar 21, 2024
6905ddc
isolated related code into analyze_file(), which populates a list of …
sdbbs Mar 21, 2024
6239472
more printouts; added parse_file_entries which indeed does parse some…
sdbbs Mar 21, 2024
2640fa9
better printouts, fix for not taking the last chunk of b_entry into a…
sdbbs Mar 21, 2024
f0f36fc
code finally started parsing 0xBC, 0x00 entry headings - cannot do th…
sdbbs Mar 21, 2024
0cbd89a
found the right offset for 0xBC, 0x00 entry headings, now they get pa…
sdbbs Mar 21, 2024
ce2f785
rearranged code, so parse_file_entries is now called by analyze_file …
sdbbs Mar 21, 2024
c40f76b
changes to default printouts (when without outfile)
sdbbs Mar 21, 2024
e6f28f3
added class IPBEntry, and global merged_ipb_entries and code to popul…
sdbbs Mar 21, 2024
3fd84d1
fix for IPBEntry class, so it does not keep overwriting its instance;…
sdbbs Mar 21, 2024
5142739
help text via RawDescriptionHelpFormatter; reorganized code so analys…
sdbbs Mar 21, 2024
14e363a
added IPBEntry.eref pointing to Entry and code to ignore it for json …
sdbbs Mar 21, 2024
6fe75c0
added --injson, and handling in code if it is active; check for dupli…
sdbbs Mar 21, 2024
663a7f0
added parsing of extra1 field - not sure what it is, but it is part o…
sdbbs Mar 21, 2024
de5b9c7
added vcard() method to IPBEntry, and added code to handle output to …
sdbbs Mar 21, 2024
f74057a
some examples in help text; fix printout bug; modified vcard output t…
sdbbs Mar 21, 2024
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
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,46 @@
NOTE: please consider this example project as unmaintained - issues and PRs
will be ignored (but feel free to use them as your documentation).

This is a simple Python 3.x script that converts a `phonebook.ib` file, such
as the one generated by a Nokia 3310 backup, to vCard.

Created and tested ad-hoc on a single sample file, your mileage may vary.

The current version should be able to handle Nokia 3310 3G and Nokia 220 4G
`phonebook.ib` files.

## Examples

You can provide multiple `phonebook.ib` files on the command line - in that
case, the program performs the parsing and extraction of entries from all files
in a single merged internal representation, and only outputs a report on the
standard output (including check for empty fields and duplicates):

```lang-none
python3 export.py ../Backups/*/phonebook.ib
```

If you provide the `--outjson` argument, the merged internal representation
will be output as a JSON file:

```lang-none
python3 export.py ../Backups/*/phonebook.ib --outjson all_merged_contacts.json
```

Then you can copy this `all_merged_contacts.json` file to an
`all_merged_contacts_edit.json` file, which you can edit manually. If you
provide the `--injson` argument, then you can read in the edited file, and
use it to export directly a .vcf vCard file (without parsing input .ib files):

```lang-none
python3 export.py --injson all_merged_contacts_edit.json --outfile all_merged_contacts_edit.vcf
```

Otherwise, you can also export a .vcf directly from the result of parsing of the
input .ib files (without using a JSON file):

```lang-none
python3 export.py ../Backups/*/phonebook.ib --outfile all_merged_contacts_edit.vcf
```

Note that different models seem to require different formats for the .vcf file: for example, the .vcf import (Save vCard) on Nokia 215 4G **will fail** if the lines in the .vcf file are terminated with only line feeds - however, terminating the lines with CR LF will make the .vcf import on this device succeed.
Loading