Skip to main content

pydantic-vcon

A Pydantic-based implementation of the vCon (Virtual Conversation Container) format.

Installation

# Using pip
pip install pydantic-vcon

# Using Poetry
poetry add pydantic-vcon

Development

This project uses Poetry for dependency management and packaging.

# Install Poetry (if not already installed)
curl -sSL https://install.python-poetry.org | python3 -

# Clone the repository
git clone https://github.com/howethomas/pydantic-vcon.git
cd pydantic-vcon

# Install dependencies
poetry install

# Run tests
poetry run pytest

# Format code
poetry run black .
poetry run isort .

# Type checking
poetry run mypy .

# Linting
poetry run ruff check .

Quick Start

from pydantic_vcon import VCon, Party, Dialog, DialogType, Encoding
from datetime import datetime

# Create a new vCon
vcon = VCon.build_new()

# Add a party
party = Party(
    tel="+1234567890",
    name="John Doe"
)
vcon.add_party(party)

# Add a dialog
dialog = Dialog(
    type=DialogType.TEXT,
    start=datetime.now(),
    parties=0,  # Reference to the first party
    body="Hello, world!",
    encoding=Encoding.JSON
)
vcon.add_dialog(dialog)

# Convert to JSON
json_str = vcon.to_json()

Features

  • Full implementation of the vCon format using Pydantic models
  • Type validation and automatic conversion
  • JSON serialization/deserialization
  • Helper methods for common operations
  • Comprehensive validation

Documentation

For detailed documentation, please visit the documentation site.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for pydantic-vcon 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-vcon 0.0.2
File Size Uploaded
pydantic_vcon-0.0.2.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-vcon 0.0.2
File Interpreter ABI Platform
pydantic_vcon-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / pydantic_vcon-0.0.2.tar.gz

Download URL pydantic_vcon-0.0.2.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f16279e45c17a7313dcdaf50cd846041a32a4c47a9d51c7ff53b770817cb66ab
BLAKE2b-256 checksum
How to use checksums
cb53d349e1d967b7575aafa7ec539c21c53e885f77cd10b62f251192d0989001
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.3 Darwin/23.4.0

Release files / pydantic_vcon-0.0.2-py3-none-any.whl

Download URL pydantic_vcon-0.0.2-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8801ab5480cdacfa865c51a1fa72dd31d4e7090f695a5caa4bf20f0af3e2a5a
BLAKE2b-256 checksum
How to use checksums
cc25e7dd8ad2825f56570a8d9e5c8a20c1683623e4569f5a7ebcb147306e6eae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.3 Darwin/23.4.0

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page