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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pydantic_vcon-0.0.2.tar.gz
(7.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_vcon-0.0.2.tar.gz.
File metadata
- Download URL: pydantic_vcon-0.0.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.1.2 CPython/3.13.3 Darwin/23.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f16279e45c17a7313dcdaf50cd846041a32a4c47a9d51c7ff53b770817cb66ab
|
|
| MD5 |
7d7a9762685bd3b88d4a7dbc26e8dd1f
|
|
| BLAKE2b-256 |
cb53d349e1d967b7575aafa7ec539c21c53e885f77cd10b62f251192d0989001
|
File details
Details for the file pydantic_vcon-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pydantic_vcon-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.1.2 CPython/3.13.3 Darwin/23.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8801ab5480cdacfa865c51a1fa72dd31d4e7090f695a5caa4bf20f0af3e2a5a
|
|
| MD5 |
96bb02753d3f661f82062fe0a4dc690f
|
|
| BLAKE2b-256 |
cc25e7dd8ad2825f56570a8d9e5c8a20c1683623e4569f5a7ebcb147306e6eae
|