Metadata-Version: 2.4
Name: PyContactFile
Version: 0.3.2
Summary: A simple Python library for processing VCF formats
Author-email: Ryan Quinn <ryan.quinn@certusinnovations.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Stonewall-Defense/PyContactFile
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: beautifulsoup4==4.13.5
Requires-Dist: pythonvCard4==0.2.0
Dynamic: license-file

# PyContactFile: A simple Python library for processing VCF formats

Supports [vCard](https://www.rfc-editor.org/rfc/rfc6350), [hCard](https://microformats.org/wiki/hcard), and [jCard](https://www.rfc-editor.org/rfc/rfc7095) parsing.

## Motivation

Primarily implemented to support the [asaperson](https://github.com/Stonewall-Defense/asaperson) library.

## Limitations

This library was internally based on the [pythonvCard4](https://pypi.org/project/pythonvCard4/) library. During later testing, it was revealed that the library has some limitations vs. the example(s) given in the specification, including:

- Parsing `adr` and `anniversary` fields that are not ISO dates
- Parsing `tel` and `email` types that are surrounded by quotation marks
- Parsing `geo` values that are [geo URIs](https://www.rfc-editor.org/rfc/rfc5870)
- Consistently handling and displaying addresses

Currently, this library inherits all these limitations for vCards, and the latter for all inputs.

## Prerequisites

- Python 3.11 runtime
- Pip for package installation

## Installation

Install the dependencies into the environment with [pip](https://pypi.org/project/pip/):

```bash
pip install -r requirements.txt
pip install .
```

## Usage

Call the relevant `*card_to_contact` to convery a string representing a [VCF](https://en.wikipedia.org/wiki/VCard) into a `Contact` object. See the [pythonvCard4](https://pypi.org/project/pythonvCard4/) library for details on the output format.

## Testing

```bash
python3 -m coverage run -m unittest discover -s test -p "*_test.py" && python -m coverage report --skip-covered
python -m coverage html
```

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/Stonewall-Defense/PyContactFile/tags).

## Authors

- **Ryan Quinn** - _Initial work_

## License

MIT.
