Skip to content
Merged
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
23 changes: 12 additions & 11 deletions API_REFERENCE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vCon Library API Reference

Complete API documentation for the vCon library - a Python implementation of the vCon 0.3.0 specification for Virtual Conversation objects.
Complete API documentation for the vCon library - a Python implementation of the latest vCon specification for Virtual Conversation objects.

## Table of Contents

Expand All @@ -18,7 +18,7 @@ Complete API documentation for the vCon library - a Python implementation of the

## Overview

The vCon library provides a complete Python implementation of the vCon 0.3.0 specification for representing virtual conversations. It supports all features including parties, dialogs, attachments, analysis, digital signatures, and extensibility.
The vCon library provides a complete Python implementation of the latest vCon specification for representing virtual conversations. It supports all features including parties, dialogs, attachments, analysis, digital signatures, and extensibility.

## Installation

Expand All @@ -40,7 +40,7 @@ The main class for working with vCon objects.
#### Constructor

```python
Vcon(vcon_dict: Dict[str, Any] = None, property_handling: str = "default", strict_version: bool = False)
Vcon(vcon_dict: Dict[str, Any] = None, property_handling: str = "default")
```

**Parameters:**
Expand All @@ -49,7 +49,6 @@ Vcon(vcon_dict: Dict[str, Any] = None, property_handling: str = "default", stric
- `"default"`: Keep non-standard properties (default)
- `"strict"`: Remove non-standard properties
- `"meta"`: Move non-standard properties to meta object
- `strict_version` (bool): If True, reject vCons not at version "0.3.0". Defaults to False.

#### Class Methods

Expand All @@ -60,14 +59,15 @@ Create a new vCon object with default values.
vcon = Vcon.build_new()
```

##### `build_from_json(json_str: str, property_handling: str = "default", strict_version: bool = False) -> Vcon`
##### `build_from_json(json_str: str, property_handling: str = "default") -> Vcon`
Create a vCon object from JSON string.

```python
vcon = Vcon.build_from_json('{"uuid": "123", "vcon": "0.3.0"}')
vcon = Vcon.build_from_json('{"uuid": "123", "created_at": "2024-01-01T00:00:00Z"}')
```

##### `load(file_path_or_url: str, property_handling: str = "default", strict_version: bool = False) -> Vcon`
##### `load(file_path_or_url: str, property_handling: str = "default") -> Vcon`

Load a vCon from file or URL.

```python
Expand All @@ -78,10 +78,11 @@ vcon = Vcon.load("conversation.vcon.json")
vcon = Vcon.load("https://example.com/conversation.vcon.json")
```

##### `load_from_file(file_path: str, property_handling: str = "default", strict_version: bool = False) -> Vcon`
##### `load_from_file(file_path: str, property_handling: str = "default") -> Vcon`
Load a vCon from a local file.

##### `load_from_url(url: str, property_handling: str = "default", strict_version: bool = False) -> Vcon`
##### `load_from_url(url: str, property_handling: str = "default") -> Vcon`

Load a vCon from a URL.

##### `validate_file(file_path: str) -> Tuple[bool, List[str]]`
Expand Down Expand Up @@ -343,8 +344,8 @@ Set the update timestamp.
##### `uuid -> str`
Get the vCon UUID.

##### `vcon -> str`
Get the vCon version.
##### `vcon -> Optional[str]`
Get the vCon version (optional field).

##### `subject -> Optional[str]`
Get the vCon subject.
Expand Down
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,75 @@
# Changelog

## [0.8.0] - 2025-01-26

### 🎉 Major Release: Version Management Simplification

This release aligns with the upcoming vCon draft specification by removing mandatory version management and enforcement, making the version field optional while maintaining full backward compatibility.

### ✨ Added

#### **Flexible Versioning**
- **Optional Version Field**: The `vcon` field is now optional in vCon objects
- **Version Preservation**: Existing vCons with version fields continue to work unchanged
- **Simplified Creation**: New vCons can be created without version fields

### 🔄 Changed

#### **Version Management Simplification**
- **Removed `strict_version` Parameter**: Eliminated from all Vcon methods (`__init__`, `build_from_json`, `build_new`, `load`, `load_from_file`, `load_from_url`)
- **No Automatic Version Assignment**: vCon objects no longer automatically get a version field
- **No Version Migration**: Removed automatic migration from older versions
- **Updated Validation**: The `is_valid()` method no longer requires the version field

#### **Method Signatures Updated**
- `Vcon(vcon_dict=None, property_handling="default")` - removed `strict_version` parameter
- `build_from_json(json_str, property_handling="default")` - removed `strict_version` parameter
- `build_new(created_at=None, property_handling="default")` - removed `strict_version` parameter
- `load(source, property_handling="default")` - removed `strict_version` parameter
- `load_from_file(file_path, property_handling="default")` - removed `strict_version` parameter
- `load_from_url(url, property_handling="default")` - removed `strict_version` parameter

### 🧪 Testing

#### **Updated Test Suite**
- **Replaced Version Migration Tests**: Updated tests to cover optional version field behavior
- **New Test Cases**: Added comprehensive tests for versionless vCon creation and preservation
- **Backward Compatibility Tests**: Ensured existing vCons with version fields continue to work

### 📄 Documentation

#### **Updated Documentation**
- **README.md**: Updated to reflect version field being optional
- **API_REFERENCE.md**: Removed `strict_version` parameter from all method signatures
- **GUIDE.md**: Updated examples to show versionless vCon creation
- **MIGRATION_GUIDE.md**: Added migration steps for version management changes

#### **Updated Sample Files**
- **Removed Version Fields**: All sample vCon JSON files updated to demonstrate versionless vCons
- **Backward Compatibility**: Existing vCons with version fields continue to work

### 🔧 Technical Details

#### **Implementation Changes**
- **Removed Version Logic**: Eliminated version checking, migration, and enforcement code
- **Simplified Initialization**: Streamlined vCon object creation process
- **Preserved Functionality**: All other features remain unchanged

#### **Backward Compatibility**
- **Existing vCons**: Continue to work without any changes
- **Version Fields**: Preserved when present, not added when absent
- **API Compatibility**: All other methods and properties remain unchanged

### 🎯 Benefits

1. **Enhanced Flexibility**: vCon objects can now exist without mandatory versioning
2. **Simplified Implementation**: Reduced complexity in version management
3. **Better Privacy Support**: Enables creation of redacted versions without version conflicts
4. **Multiple Version Support**: Allows different versions of the same vCon to coexist
5. **Specification Compliance**: Aligns with upcoming vCon draft specification

---

## [0.7.0] - 2025-07-19

### 🎉 Major Release: Complete vCon 0.3.0 Specification Compliance
Expand Down
6 changes: 3 additions & 3 deletions GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ from vcon import Vcon

#### Properties
- `uuid`: Unique identifier
- `vcon`: Version number
- `vcon`: Version number (optional)
- `created_at`: Creation timestamp
- `updated_at`: Last update timestamp
- `parties`: List of participants
Expand Down Expand Up @@ -84,7 +84,7 @@ from vcon.dialog import Dialog
vcon = Vcon.build_new()

# Create from dictionary
vcon = Vcon({"uuid": "...", "vcon": "0.3.0"})
vcon = Vcon({"uuid": "...", "created_at": "2024-01-01T00:00:00Z"})

# Create from JSON
vcon = Vcon.build_from_json(json_string)
Expand Down Expand Up @@ -276,6 +276,6 @@ if not is_valid:
is_valid, errors = Vcon.validate_file("path/to/vcon.json")

# Validate a vCon JSON string
json_str = '{"uuid": "123", "vcon": "0.3.0", ...}'
json_str = '{"uuid": "123", "created_at": "2024-01-01T00:00:00Z", ...}'
is_valid, errors = Vcon.validate_json(json_str)
```
56 changes: 52 additions & 4 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# Migration Guide: New Required Fields
# Migration Guide: Version Management Changes

This guide helps you migrate your existing vCon code to use the new required fields introduced in the latest version.
This guide helps you migrate your existing vCon code to work with the updated version management system.

## Overview

The vCon library now supports additional fields as specified in the IETF vCon specification. All new fields are **optional** and **backward compatible**, so existing code will continue to work without changes.
The vCon library has been updated to align with the latest vCon specification changes. The most significant change is that the **version field is now optional** and version management has been simplified. All changes are **backward compatible**, so existing code will continue to work without changes.

## Key Changes

### Version Field is Now Optional
- The `vcon` field is no longer required in vCon objects
- No automatic version assignment or migration
- Existing vCons with version fields continue to work unchanged
- New vCons can be created without version fields

### Removed Version Management
- Removed `strict_version` parameter from all methods
- No more automatic version migration
- No more version enforcement or validation

## What's New

Expand All @@ -24,7 +37,42 @@ The vCon library now supports additional fields as specified in the IETF vCon sp

## Migration Steps

### Step 1: Add Extensions (Optional)
### Step 1: Update Method Calls (Required if using strict_version)

If you were using the `strict_version` parameter, you need to remove it:

```python
# Old code (will cause errors)
vcon = Vcon.load("file.json", strict_version=True)
vcon = Vcon.build_from_json(json_str, strict_version=True)
vcon = Vcon(data, strict_version=True)

# New code (remove strict_version parameter)
vcon = Vcon.load("file.json")
vcon = Vcon.build_from_json(json_str)
vcon = Vcon(data)
```

### Step 2: Version Field Handling (Optional)

The version field is now optional. You can choose to:

**Option A: Remove version fields from new vCons**
```python
# Old code
vcon = Vcon({"uuid": "123", "vcon": "0.3.0", "created_at": "2024-01-01T00:00:00Z"})

# New code (version field optional)
vcon = Vcon({"uuid": "123", "created_at": "2024-01-01T00:00:00Z"})
```

**Option B: Keep existing version fields**
```python
# This still works - no changes needed
vcon = Vcon({"uuid": "123", "vcon": "0.3.0", "created_at": "2024-01-01T00:00:00Z"})
```

### Step 3: Add Extensions (Optional)

If you want to declare extension capabilities:

Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A Python library for working with vCon (Virtual Conversation) objects according

## Overview

The vCon library provides a complete implementation of the vCon format for representing conversations and related metadata. It supports all features defined in the vCon 0.3.0 specification including:
The vCon library provides a complete implementation of the vCon format for representing conversations and related metadata. It supports all features defined in the latest vCon specification including:

- **Conversation Management**: Parties, dialogs, attachments, and analysis
- **Contact Information**: Multiple contact methods (tel, email, SIP, DID)
Expand All @@ -14,15 +14,15 @@ The vCon library provides a complete implementation of the vCon format for repre
- **Location Data**: Civic address information (GEOPRIV)
- **Event Tracking**: Party history with join/drop/hold/mute events

## New in vCon 0.3.0
## Key Features

This library implements the latest vCon specification (0.3.0) with the following new features:
This library implements the latest vCon specification with the following features:

### Enhanced Party Information
```python
from vcon import Vcon, Party

# Create a party with new vCon 0.3.0 fields
# Create a party with enhanced contact information
party = Party(
tel="+1234567890",
name="John Doe",
Expand Down Expand Up @@ -158,9 +158,6 @@ vcon = Vcon.load("conversation.vcon.json")

# Load from URL
vcon = Vcon.load("https://example.com/conversation.vcon.json")

# Load with strict version checking
vcon = Vcon.load("conversation.vcon.json", strict_version=True)
```

### Validation
Expand Down Expand Up @@ -288,7 +285,7 @@ vcon.add_analysis(

## Specification Compliance

This library implements the vCon 0.3.0 specification with:
This library implements the latest vCon specification with:

- ✅ All required fields and validation
- ✅ Proper media type support
Expand All @@ -297,6 +294,7 @@ This library implements the vCon 0.3.0 specification with:
- ✅ Transfer dialog support
- ✅ Content hashing and security
- ✅ Extensions and must_support
- ✅ Flexible versioning (version field is optional)
- ✅ Backward compatibility

## Testing
Expand All @@ -307,12 +305,13 @@ Run the test suite:
pytest tests/
```

All 149 tests pass, covering:
All tests pass, covering:
- Basic functionality
- New vCon 0.3.0 features
- Enhanced vCon features
- Validation and error handling
- Media type support
- Security features
- Flexible versioning
- Backward compatibility

## License
Expand Down
7 changes: 6 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./vcon.html"/>
<meta http-equiv="refresh" content="0; url=./build/html/index.html"/>
<title>vCon Documentation - Redirecting...</title>
</head>
<body>
<p>Redirecting to the latest documentation...</p>
<p>If you are not redirected automatically, <a href="./build/html/index.html">click here</a>.</p>
</body>
</html>
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
copyright = "2024, Thomas McCarthy-Howe"
author = "Thomas McCarthy-Howe"

version = "0.3.9"
release = "0.3.9"
version = "0.7.0"
release = "0.7.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ vcon is a Python library for working with vCon (Video Conference) containers, wh
installation
usage
new_required_fields
version_management
api/modules

Installation
Expand Down
1 change: 0 additions & 1 deletion docs/source/new_required_fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ The resulting JSON will include:

{
"uuid": "...",
"vcon": "0.3.0",
"extensions": ["video"],
"must_support": ["encryption"],
"parties": [{
Expand Down
Loading