diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6e666e9..f27f00d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,53 +15,60 @@ permissions: # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: - group: "pages" + group: "pages-${{ github.ref }}" cancel-in-progress: false jobs: - docs: - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + # Builds on every push and pull request, so a broken docs build fails the PR. + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.8' - + python-version: '3.12' + - name: Install Poetry uses: snok/install-poetry@v1 with: - version: 1.7.1 + version: 2.5.1 virtualenvs-create: true virtualenvs-in-project: true - + - name: Install dependencies run: | poetry install --with dev - + - name: Build documentation run: | cd docs - poetry run make html + poetry run make html SPHINXOPTS="-W --keep-going" # Copy built docs to a clean directory for Pages mkdir -p ../pages-build cp -r build/html/* ../pages-build/ # Ensure .nojekyll exists to disable Jekyll touch ../pages-build/.nojekyll - - - name: Setup Pages - uses: actions/configure-pages@v5 - + - name: Upload artifact + if: github.event_name == 'push' uses: actions/upload-pages-artifact@v3 with: path: './pages-build' - + + # Deploys only from main; the github-pages environment rejects other refs. + deploy: + if: github.event_name == 'push' + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 diff --git a/API_REFERENCE.md b/API_REFERENCE.md index 559ee8a..cacaae0 100644 --- a/API_REFERENCE.md +++ b/API_REFERENCE.md @@ -57,7 +57,8 @@ The main class for working with vCon objects. #### Constructor ```python -Vcon(vcon_dict: Dict[str, Any] = None, property_handling: str = "default") +Vcon(vcon_dict: Dict[str, Any] = None, property_handling: str = "default", + migrate_legacy: bool = True, strict_migration: bool = False) ``` **Parameters:** @@ -66,24 +67,26 @@ Vcon(vcon_dict: Dict[str, Any] = None, property_handling: str = "default") - `"default"`: Keep non-standard properties (default) - `"strict"`: Remove non-standard properties - `"meta"`: Move non-standard properties to meta object +- `migrate_legacy` (bool): Migrate input that declares `"vcon": "0.4.0"` to 0.5.0 (default `True`) +- `strict_migration` (bool): Raise instead of using fallbacks when a 0.4.0 construct cannot be migrated exactly #### Class Methods -##### `build_new() -> Vcon` -Create a new vCon object with default values. +##### `build_new(created_at: Union[str, datetime] = None, property_handling: str = "default") -> Vcon` +Create a new vCon object with default values (`"vcon": "0.5.0"`, a new UUID, and empty `parties`, `dialog`, `attachments` and `analysis`). ```python vcon = Vcon.build_new() ``` -##### `build_from_json(json_str: str, property_handling: str = "default") -> Vcon` +##### `build_from_json(json_str: str, property_handling: str = "default", migrate_legacy: bool = True, strict_migration: bool = False) -> Vcon` Create a vCon object from JSON string. ```python vcon = Vcon.build_from_json('{"uuid": "123", "created_at": "2024-01-01T00:00:00Z"}') ``` -##### `load(file_path_or_url: str, property_handling: str = "default") -> Vcon` +##### `load(file_path_or_url: str, property_handling: str = "default", migrate_legacy: bool = True, strict_migration: bool = False) -> Vcon` Load a vCon from file or URL. @@ -95,10 +98,10 @@ 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") -> Vcon` +##### `load_from_file(file_path: str, property_handling: str = "default", migrate_legacy: bool = True, strict_migration: bool = False) -> Vcon` Load a vCon from a local file. -##### `load_from_url(url: str, property_handling: str = "default") -> Vcon` +##### `load_from_url(url: str, property_handling: str = "default", migrate_legacy: bool = True, strict_migration: bool = False) -> Vcon` Load a vCon from a URL. @@ -146,8 +149,8 @@ index = vcon.find_party_index("tel", "+1234567890") ##### Dialog Management -###### `add_dialog(dialog: Dialog) -> None` -Add a dialog to the vCon. +###### `add_dialog(dialog: Dialog, session: Optional[int] = None) -> int` +Add a dialog to the vCon and return its index. With `session`, the new dialog index is also appended to that Session's `dialog` list. ```python dialog = Dialog(type="text", start=datetime.now(), parties=[0, 1], body="Hello") @@ -194,13 +197,13 @@ vcon.add_incomplete_dialog(datetime.now(), "no-answer", [0]) ##### Attachment Management ###### `add_attachment(purpose: str, body: Any = None, encoding: str = "none", ..., party: Optional[int] = None, dialog: Optional[int] = None, session: Optional[Union[int, List[int]]] = None) -> Attachment` -Add an attachment to the vCon. +Add an attachment to the vCon. Core-05 needs `party` plus `dialog` or `session`: `party` defaults to 0, and if neither `dialog` nor `session` is given the only Session is used when the vCon has exactly one; otherwise `ValueError` is raised. ```python -attachment = vcon.add_attachment("transcript", "Full conversation...", "none") +attachment = vcon.add_attachment("transcript", "Full conversation...", "none", party=0, dialog=0) ``` -###### `add_image(image_path: str, type: str = "image") -> Attachment` +###### `add_image(image_path: str, purpose: str = "image") -> Attachment` Add an image attachment from file. ```python @@ -216,7 +219,7 @@ transcript = vcon.find_attachment_by_purpose("transcript") ##### Analysis Management -###### `add_analysis(type: str, dialog: Union[int, List[int]], vendor: str, body: Any, encoding: str = "none") -> None` +###### `add_analysis(*, type: str, vendor: str, body: Any, dialog: Union[int, List[int]] = None, sessions: Union[int, List[int]] = None, encoding: str = "none", ...) -> None` Add analysis data to the vCon. ```python @@ -239,7 +242,7 @@ sentiment = vcon.find_analysis_by_type("sentiment") ##### Tag Management Tags are stored as a `"tags"`-purpose attachment whose body is a list of -`"name:value"` strings (per `draft-ietf-vcon-vcon-core-04`, a `"json"`-encoded +`"name:value"` strings (per `draft-ietf-vcon-vcon-core-04` and `-05`, a `"json"`-encoded body is the JSON value itself, not a serialized string). `get_tag()` and `add_tag()` also accept a legacy JSON-*string* tags body -- as written under -02 conventions, or by this library prior to 0.10.0 -- decoding it @@ -302,7 +305,7 @@ Remove a must-support extension. ##### Extension-Specific Methods ###### `add_lawful_basis_attachment(lawful_basis: str, expiration: str, purpose_grants: list, party_index: Optional[int] = None, dialog_index: Optional[int] = None, session_index: Optional[Union[int, List[int]]] = None, **kwargs) -> None` -Add a lawful basis attachment to the vCon. +Add a lawful basis attachment to the vCon. Core-05 scopes a basis to Sessions, so pass `session_index` (a `dialog_index`-only scope is accepted with a warning). With neither, the only Session is used when the vCon has exactly one; otherwise `ValueError` is raised. `party_index` defaults to 0 with a warning. ```python vcon.add_lawful_basis_attachment( @@ -311,18 +314,20 @@ vcon.add_lawful_basis_attachment( purpose_grants=[ {"purpose": "recording", "granted": True, "granted_at": "2025-01-01T00:00:00Z"} ], - party_index=0 + party_index=0, + session_index=0 ) ``` -###### `add_wtf_transcription_attachment(transcript: Dict[str, Any], segments: List[Dict[str, Any]], metadata: Dict[str, Any], party_index: Optional[int] = None, dialog_index: Optional[int] = None, **kwargs) -> None` -Add a WTF transcription attachment to the vCon. +###### `add_wtf_transcription_attachment(transcript: Dict[str, Any], segments: List[Dict[str, Any]], metadata: Dict[str, Any], party_index: Optional[int] = None, dialog_index: Optional[int] = None, session_index: Optional[Union[int, List[int]]] = None, **kwargs) -> None` +Add a WTF transcription attachment to the vCon. Scoped by `dialog_index` and/or `session_index`; with neither, the only Session is used when the vCon has exactly one, otherwise `ValueError` is raised. ```python vcon.add_wtf_transcription_attachment( transcript={"text": "Hello world", "language": "en", "duration": 2.0, "confidence": 0.95}, segments=[{"id": 0, "start": 0.0, "end": 2.0, "text": "Hello world", "confidence": 0.95}], - metadata={"created_at": "2025-01-01T00:00:00Z", "provider": "whisper", "model": "whisper-1"} + metadata={"created_at": "2025-01-01T00:00:00Z", "provider": "whisper", "model": "whisper-1"}, + dialog_index=0 ) ``` @@ -435,7 +440,7 @@ Set the update timestamp. Get the vCon UUID. ##### `vcon -> Optional[str]` -Get the vCon version (optional field). +Get the vCon syntax version (`build_new()` writes `"0.5.0"`; input declaring `"0.4.0"` is migrated to `"0.5.0"` on load). ##### `subject -> Optional[str]` Get the vCon subject. @@ -574,7 +579,7 @@ Dialog( ``` **Parameters:** -- `type` (str): Dialog type ("text", "recording", "incomplete"; "audio" and "video" are library conveniences) +- `type` (str): Dialog type ("recording", "text", "incomplete"; "audio" and "video" are accepted as deprecated aliases that emit a `DeprecationWarning` and become "recording", with the media kind carried by `mediatype`) - `start` (Union[datetime, str]): Start time - `parties` (List[int]): Indices of the contributors (the receivers are in the Session) - `mediatype` (str, optional): MIME type of content @@ -589,7 +594,6 @@ Dialog( - `duration` (float, optional): Dialog duration - `meta` (dict, optional): Additional metadata - `metadata` (Dict[str, Any], optional): Structured metadata -- `transfer` (Dict[str, Any], optional): Transfer-specific information - `signaling` (Dict[str, Any], optional): Signaling information - `resolution` (str, optional): Video resolution (e.g., "1920x1080") - `frame_rate` (float, optional): Video frame rate @@ -600,6 +604,11 @@ Dialog( - `content_hash` (str, optional): Content hash for external files - `application` (str, optional): Application identifier - `message_id` (str, optional): Message identifier +- `redacted_segments` (List[Dict[str, Any]], optional): Redacted_segments Objects (`start`, `end`, optional `parties`) + +The parameters removed in 0.5.0 (`originator`, `party_history`, `transfer`, `transferee`, `transferor`, +`transfer_target`, `original`, `consultation`, `target_dialog`, `recordings`, `recording_set`) raise `ValueError`. +Use `Session(originator=...)`, `Event` objects and `Session(dialog=[...])` instead. #### Methods @@ -625,7 +634,7 @@ Check if dialog is text type. Check if dialog is recording type. ##### `is_transfer() -> bool` -Check if dialog is transfer type. +Deprecated: core-05 has no transfer Dialog type (transfers are Events), so this emits a `DeprecationWarning` and always returns `False`. ##### `is_incomplete() -> bool` Check if dialog is incomplete type. @@ -690,11 +699,11 @@ Set content hash. ##### `get_content_hash() -> Optional[str]` Get content hash. -##### `calculate_content_hash(algorithm: str = "sha256") -> str` -Calculate content hash. +##### `calculate_content_hash(algorithm: str = "sha512") -> str` +Calculate the content hash of the body as `"-"`, e.g. `"sha512-xbxz..."` (`"sha256"` is also supported). -##### `verify_content_hash(expected_hash: str, algorithm: str = "sha256") -> bool` -Verify content hash. +##### `verify_content_hash(expected_hash: str, algorithm: Optional[str] = None) -> bool` +Verify content hash. The algorithm is taken from the `expected_hash` prefix unless given. ### CivicAddress Class @@ -795,7 +804,7 @@ Attachment(purpose: str, body: Any = None, encoding: str = "none", mediatype=Non ##### `to_dict() -> Dict[str, Any]` Convert Attachment to dictionary. -##### `from_image(image_path: str, type: str = "image") -> 'Attachment'` +##### `from_image(image_path: str, purpose: str = "image") -> 'Attachment'` Create attachment from image file. ## Extensions @@ -972,7 +981,7 @@ The WTF (World Transcription Format) extension provides standardized representat Main class representing a WTF transcription attachment. ```python -from vcon.extensions.wtf import WTFAttachment, Transcript, Segment, Metadata +from vcon.extensions.wtf import WTFAttachment, Transcript, Segment, Word, Speaker, Quality, Metadata from datetime import datetime, timezone # Create transcript @@ -1188,6 +1197,10 @@ PROPERTY_HANDLING_META = "meta" # Move non-standard properties to meta VALID_TYPES = ["recording", "text", "incomplete", "audio", "video"] ``` +Core-05 defines only `recording`, `text` and `incomplete`. `audio` and `video` are accepted as deprecated +aliases: they emit a `DeprecationWarning` and are stored as `recording` (the media kind is carried by +`mediatype`). The `transfer` and `recording-set` types were removed in 0.5.0 (use transfer Events and a Session). + ### Disposition Values ```python @@ -1208,7 +1221,7 @@ from vcon.event import CORE_EVENT_TYPES ### Attachment Encodings ```python -VALID_ENCODINGS = ["base64", "base64url", "none"] +VALID_ENCODINGS = ["base64url", "json", "none"] ``` ### Supported MIME Types @@ -1264,9 +1277,9 @@ ProofType.EXTERNAL_SYSTEM # External system attestation ```python from vcon.extensions.lawful_basis import HashAlgorithm -HashAlgorithm.SHA_256 # SHA-256 -HashAlgorithm.SHA_384 # SHA-384 -HashAlgorithm.SHA_512 # SHA-512 +HashAlgorithm.SHA_256 # SHA-256 +HashAlgorithm.SHA_3_256 # SHA3-256 +HashAlgorithm.BLAKE2B_256 # BLAKE2b-256 ``` ### Canonicalization Methods @@ -1296,6 +1309,7 @@ from vcon.extensions.wtf import ( from vcon import Vcon from vcon.party import Party from vcon.dialog import Dialog +from vcon.session import Session from datetime import datetime # Create new vCon @@ -1382,11 +1396,13 @@ vcon.add_analysis( encoding="json" ) -# Add attachment +# Add attachment (core-05: party plus dialog or session) vcon.add_attachment( - type="transcript", + purpose="transcript", body="Full conversation transcript...", - encoding="none" + encoding="none", + party=0, + session=0 ) # Add tags @@ -1397,9 +1413,9 @@ vcon.add_tag("priority", "high") ### Video Content ```python -# Add video dialog +# Add video dialog (a "recording"; the mediatype says it is video) video_dialog = Dialog( - type="video", + type="recording", start=datetime.now(), parties=[0, 1], mediatype="video/mp4", @@ -1422,7 +1438,7 @@ metadata = video_dialog.extract_video_metadata() # Generate thumbnail thumbnail = video_dialog.generate_thumbnail(timestamp=10.0) -vcon.add_dialog(video_dialog) +vcon.add_dialog(video_dialog, session=0) ``` ### Civic Address @@ -1496,6 +1512,7 @@ vcon = Vcon.load("file.json", property_handling="default") from vcon import Vcon from vcon.party import Party from vcon.dialog import Dialog +from vcon.session import Session from datetime import datetime, timezone, timedelta # Create vCon with parties and dialog @@ -1505,14 +1522,15 @@ agent = Party(tel="+1987654321", name="Bob", role="agent") vcon.add_party(caller) vcon.add_party(agent) -# Add dialog +# Add a Session and the dialog +vcon.add_session(Session(start=datetime.now(timezone.utc), parties=[0, 1])) dialog = Dialog( type="recording", start=datetime.now(timezone.utc), parties=[0, 1], mediatype="audio/mp3" ) -vcon.add_dialog(dialog) +vcon.add_dialog(dialog, session=0) # Add lawful basis attachment vcon.add_lawful_basis_attachment( @@ -1532,7 +1550,7 @@ vcon.add_lawful_basis_attachment( } ], party_index=0, - dialog_index=0 + session_index=0 ) # Check permissions @@ -1553,6 +1571,7 @@ print(f"Found {len(attachments)} lawful basis attachments") from vcon import Vcon from vcon.party import Party from vcon.dialog import Dialog +from vcon.session import Session from datetime import datetime, timezone # Create vCon with parties and dialog @@ -1562,14 +1581,15 @@ agent = Party(tel="+1987654321", name="Bob", role="agent") vcon.add_party(caller) vcon.add_party(agent) -# Add dialog +# Add a Session and the dialog +vcon.add_session(Session(start=datetime.now(timezone.utc), parties=[0, 1])) dialog = Dialog( type="recording", start=datetime.now(timezone.utc), parties=[0, 1], mediatype="audio/mp3" ) -vcon.add_dialog(dialog) +vcon.add_dialog(dialog, session=0) # Add WTF transcription attachment vcon.add_wtf_transcription_attachment( @@ -1668,7 +1688,8 @@ wtf_attachment = whisper_adapter.convert(whisper_data) vcon.add_wtf_transcription_attachment( transcript=wtf_attachment.transcript.to_dict(), segments=[segment.to_dict() for segment in wtf_attachment.segments], - metadata=wtf_attachment.metadata.to_dict() + metadata=wtf_attachment.metadata.to_dict(), + dialog_index=0 # or session_index; required unless the vCon has exactly one Session ) ``` @@ -1678,6 +1699,7 @@ vcon.add_wtf_transcription_attachment( from vcon import Vcon from vcon.party import Party from vcon.dialog import Dialog +from vcon.session import Session from datetime import datetime, timezone, timedelta # Create comprehensive vCon with extensions @@ -1689,14 +1711,15 @@ agent = Party(tel="+1987654321", name="Bob", role="agent") vcon.add_party(caller) vcon.add_party(agent) -# Add dialog +# Add a Session and the recording dialog +vcon.add_session(Session(start=datetime.now(timezone.utc), parties=[0, 1])) dialog = Dialog( type="recording", start=datetime.now(timezone.utc), parties=[0, 1], mediatype="audio/mp3" ) -vcon.add_dialog(dialog) +vcon.add_dialog(dialog, session=0) # Add lawful basis for consent vcon.add_lawful_basis_attachment( diff --git a/CHANGELOG.md b/CHANGELOG.md index e0aee23..a7ed17b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [1.0.1] - 2026-11-15 + +Documentation release. No change to library behavior. + +### Changed +- README: install line, Python requirement and a 1.0 upgrade note at the top; + links to conserver.io, the API docs, the changelog and the migration guide; + absolute links so they work on PyPI; examples fixed for core-05 (attachment + scope, `recording` instead of `video`, sha512 content hashes). +- PyPI metadata: homepage, repository, documentation, changelog, migration + guide, issues and specification links; keywords and classifiers. +- Sphinx docs (https://vcon-dev.github.io/vcon-lib/) rewritten for 1.0 and + core-05: usage with Sessions and Events, a versions and migration page, and + API pages for every module. The version is read from `pyproject.toml`. The + stale 0.7.0 build output committed under `docs/` was removed. +- The docs workflow builds on Python 3.12 with warnings as errors and deploys + only from `main`; pull requests build without deploying. +- GUIDE.md, API_REFERENCE.md, LLM_GUIDE.md and MIGRATION_GUIDE.md examples + corrected against the 1.0 API. +- Docstring fixes in `Vcon` and `Dialog` so they render in Sphinx. + ## [1.0.0] - 2026-11-15 Retargets the library to `draft-ietf-vcon-vcon-core-05` (syntax `"0.5.0"`). diff --git a/GUIDE.md b/GUIDE.md index 1943122..5bf7860 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -28,7 +28,7 @@ from vcon import Vcon #### Properties - `uuid`: Unique identifier -- `vcon`: Version number (optional) +- `vcon`: Syntax version (`build_new()` writes `"0.5.0"`; 0.4.0 input is migrated on load) - `created_at`: Creation timestamp - `updated_at`: Last update timestamp - `parties`: List of participants @@ -42,8 +42,8 @@ from vcon import Vcon - `group`: Group information - `meta`: Metadata - `tags`: Tags attachment -- `extensions`: List of extensions used -- `critical`: List of must-support extensions +- `get_extensions()`: List of extensions used +- `get_critical()`: List of must-support extensions ### Party Represents a participant in the conversation. @@ -225,11 +225,14 @@ is_inline = dialog.is_inline_data() ### Attachments ```python -# Add an attachment +# Add an attachment. Core-05 needs party plus dialog or session; with +# neither, the only Session is used when exactly one exists, else ValueError. vcon.add_attachment( - type="document", + purpose="document", body="content", - encoding="none" + encoding="none", + party=0, + session=0 ) # Find attachment @@ -311,7 +314,7 @@ vcon.add_lawful_basis_attachment( } ], party_index=0, - dialog_index=0 + session_index=0 # core-05 scopes a lawful basis to Sessions ) ``` @@ -346,7 +349,8 @@ from vcon.extensions.lawful_basis import ( ProofMechanism, LawfulBasisType, ProofType, - HashAlgorithm + HashAlgorithm, + CanonicalizationMethod ) # Create purpose grants with conditions @@ -367,7 +371,7 @@ purpose_grants = [ # Create content hash for integrity content_hash = ContentHash( algorithm=HashAlgorithm.SHA_256, - canonicalization="JCS", + canonicalization=CanonicalizationMethod.JCS, value="computed_hash_value" ) @@ -499,7 +503,8 @@ wtf_attachment = whisper_adapter.convert(whisper_data) vcon.add_wtf_transcription_attachment( transcript=wtf_attachment.transcript.to_dict(), segments=[segment.to_dict() for segment in wtf_attachment.segments], - metadata=wtf_attachment.metadata.to_dict() + metadata=wtf_attachment.metadata.to_dict(), + dialog_index=0 # or session_index; required unless the vCon has exactly one Session ) ``` @@ -524,7 +529,13 @@ transcript = Transcript( confidence=0.95 ) -# Create segments with words +# Create words +words = [ + Word(id=0, start=0.0, end=1.0, text="Hello", confidence=0.95, speaker=0), + Word(id=1, start=1.0, end=2.0, text="world", confidence=0.95, speaker=0) +] + +# Create segments (a segment references its words by id) segments = [ Segment( id=0, @@ -533,23 +544,20 @@ segments = [ text="Hello world", confidence=0.95, speaker=0, - words=[ - Word(id=0, start=0.0, end=1.0, text="Hello", confidence=0.95, speaker=0), - Word(id=1, start=1.0, end=2.0, text="world", confidence=0.95, speaker=0) - ] + words=[0, 1] ) ] -# Create speaker information -speakers = [ - Speaker( +# Create speaker information (keyed by speaker id) +speakers = { + "0": Speaker( id=0, label="Speaker 1", segments=[0], total_time=2.0, confidence=0.9 ) -] +} # Create quality metrics quality = Quality( @@ -569,8 +577,8 @@ metadata = Metadata( processed_at=datetime.now(timezone.utc).isoformat(), provider="whisper", model="whisper-1", - audio_quality="high", - background_noise=0.1 + processing_time=1.2, + audio={"duration": 2.0, "sample_rate": 16000} ) # Create comprehensive WTF attachment @@ -578,7 +586,7 @@ attachment = WTFAttachment( transcript=transcript, segments=segments, metadata=metadata, - words=[word for segment in segments for word in segment.words], + words=words, speakers=speakers, quality=quality ) diff --git a/LLM_GUIDE.md b/LLM_GUIDE.md index 00ed6fa..840e1ef 100644 --- a/LLM_GUIDE.md +++ b/LLM_GUIDE.md @@ -10,7 +10,8 @@ The vCon library is a Python implementation of the vCon 0.5.0 specification (dra - **vCon Container**: The primary object that holds all conversation data - **Parties**: Participants in a conversation (callers, agents, bots) with contact information -- **Dialogs**: Individual messages or segments of the conversation (text, audio, video, etc.) +- **Dialogs**: Individual messages or segments of the conversation (`recording`, `text` or `incomplete`) +- **Sessions**: Group Dialogs and Events and list the receiving parties (0.5.0) - **Attachments**: Additional files or data associated with the conversation - **Analysis**: Results from processing the conversation (sentiment analysis, transcription, etc.) - **Extensions**: Optional features that extend the base vCon functionality @@ -18,7 +19,7 @@ The vCon library is a Python implementation of the vCon 0.5.0 specification (dra - **WTF Extension**: World Transcription Format for standardized speech-to-text data - **Digital Signatures**: Cryptographic verification of vCon integrity - **Civic Addresses**: Location information for parties using GEOPRIV standard -- **Party History**: Event tracking for multi-party conversations +- **Events**: Joins, drops, holds, key presses and transfers (replace 0.4.0 party history) ## Installation @@ -89,15 +90,17 @@ response = vcon.post_to_url( ```python # Access properties uuid = vcon.uuid -version = vcon.vcon +version = vcon.vcon # "0.5.0" for vCons built or migrated by 1.0 created_at = vcon.created_at updated_at = vcon.updated_at parties_list = vcon.parties dialog_list = vcon.dialog +sessions_list = vcon.sessions +events_list = vcon.events attachments_list = vcon.attachments analysis_list = vcon.analysis -extensions_list = vcon.extensions -critical_list = vcon.critical +extensions_list = vcon.get_extensions() +critical_list = vcon.get_critical() ``` ### 2. Party Class @@ -174,14 +177,14 @@ vcon.add_session(Session(start=datetime.now(timezone.utc), parties=[0, 1])) # Add to vCon, in Session 0 vcon.add_dialog(text_dialog, session=0) -# Create an audio dialog +# Create an audio recording dialog ("audio"/"video" are deprecated aliases for "recording") audio_dialog = Dialog( - type="audio", + type="recording", start=datetime.now(timezone.utc).isoformat(), parties=[0, 1], mediatype="audio/mp3", body=base64_encoded_audio, - encoding="base64", + encoding="base64url", filename="recording.mp3" ) @@ -233,11 +236,13 @@ is_email = dialog.is_email() #### Dialog Types and MIME Types **Valid Dialog Types:** +- `"recording"`: Audio/video recording (the media kind is carried by `mediatype`) - `"text"`: Text-based communication (chat, SMS, email) -- `"recording"`: Audio/video recording - `"incomplete"`: Failed or incomplete conversation setup -- `"audio"`: Audio content -- `"video"`: Video content + +`"audio"` and `"video"` are still accepted as deprecated aliases: they emit a `DeprecationWarning` and are +stored as `"recording"`. The `"transfer"` and `"recording-set"` types were removed in 0.5.0 (use transfer +Events and a Session), and Dialog parameters such as `transfer`, `party_history` and `originator` raise `ValueError`. **Supported MIME Types:** @@ -280,21 +285,28 @@ all_tags = vcon.tags # Returns the tags attachment dictionary ### 5. Working with Attachments -Attachments are arbitrary data associated with the conversation. +Attachments are arbitrary data associated with the conversation. Under core-05 an attachment needs `party` +plus `dialog` or `session`. `party` defaults to 0; if neither `dialog` nor `session` is given, the only Session +is used when the vCon has exactly one, otherwise `ValueError` is raised. ```python # Add an attachment vcon.add_attachment( - type="transcript", + purpose="transcript", body="Conversation transcript content...", - encoding="none" + encoding="none", + party=0, + dialog=0 ) -# Add a base64-encoded attachment +# Add a base64url-encoded attachment scoped to Session 0 vcon.add_attachment( - type="recording", + purpose="recording", body=base64_encoded_content, - encoding="base64url" + encoding="base64url", + mediatype="audio/mp3", + party=0, + session=0 ) # Find an attachment @@ -377,7 +389,7 @@ vcon.add_lawful_basis_attachment( } ], party_index=0, - dialog_index=0 + session_index=0 # core-05 scopes a lawful basis to Sessions ) # Add extension to vCon @@ -415,7 +427,8 @@ from vcon.extensions.lawful_basis import ( ProofMechanism, LawfulBasisType, ProofType, - HashAlgorithm + HashAlgorithm, + CanonicalizationMethod ) # Create purpose grants with conditions @@ -436,7 +449,7 @@ purpose_grants = [ # Create content hash for integrity content_hash = ContentHash( algorithm=HashAlgorithm.SHA_256, - canonicalization="JCS", + canonicalization=CanonicalizationMethod.JCS, value="computed_hash_value" ) @@ -571,7 +584,8 @@ wtf_attachment = whisper_adapter.convert(whisper_data) vcon.add_wtf_transcription_attachment( transcript=wtf_attachment.transcript.to_dict(), segments=[segment.to_dict() for segment in wtf_attachment.segments], - metadata=wtf_attachment.metadata.to_dict() + metadata=wtf_attachment.metadata.to_dict(), + dialog_index=0 # or session_index; required unless the vCon has exactly one Session ) ``` @@ -596,7 +610,13 @@ transcript = Transcript( confidence=0.95 ) -# Create segments with words +# Create words +words = [ + Word(id=0, start=0.0, end=1.0, text="Hello", confidence=0.95, speaker=0), + Word(id=1, start=1.0, end=2.0, text="world", confidence=0.95, speaker=0) +] + +# Create segments (a segment references its words by id) segments = [ Segment( id=0, @@ -605,23 +625,20 @@ segments = [ text="Hello world", confidence=0.95, speaker=0, - words=[ - Word(id=0, start=0.0, end=1.0, text="Hello", confidence=0.95, speaker=0), - Word(id=1, start=1.0, end=2.0, text="world", confidence=0.95, speaker=0) - ] + words=[0, 1] ) ] -# Create speaker information -speakers = [ - Speaker( +# Create speaker information (keyed by speaker id) +speakers = { + "0": Speaker( id=0, label="Speaker 1", segments=[0], total_time=2.0, confidence=0.9 ) -] +} # Create quality metrics quality = Quality( @@ -641,8 +658,8 @@ metadata = Metadata( processed_at=datetime.now(timezone.utc).isoformat(), provider="whisper", model="whisper-1", - audio_quality="high", - background_noise=0.1 + processing_time=1.2, + audio={"duration": 2.0, "sample_rate": 16000} ) # Create comprehensive WTF attachment @@ -650,7 +667,7 @@ attachment = WTFAttachment( transcript=transcript, segments=segments, metadata=metadata, - words=[word for segment in segments for word in segment.words], + words=words, speakers=speakers, quality=quality ) @@ -762,14 +779,14 @@ dialog = Dialog( body="Hello, this is a test message!", encoding="none", session_id={"local": "local-uuid", "remote": "remote-uuid"}, - content_hash="c8d3d67f662a787e96e74ccb0a77803138c0f13495a186ccbde495c57c385608", + content_hash="sha512-xbxzWUN7HoME4TkKebyfothmuRRH1M_Skvg2tfVxlFDWSQOdsLcKZ60qsibswilp_NsnfnBW3-7ctRSQGT9UVg", application="chat-app", message_id="" ) -# Video dialog with metadata +# Video recording dialog with metadata (the mediatype says it is video) video_dialog = Dialog( - type="video", + type="recording", start=datetime.now(), parties=[0, 1], mediatype="video/mp4", @@ -827,6 +844,7 @@ is_valid, errors = Vcon.validate_json(json_string) from vcon import Vcon from vcon.party import Party from vcon.dialog import Dialog +from vcon.session import Session from datetime import datetime, timezone # Create a new vCon @@ -838,22 +856,25 @@ agent = Party(tel="+1987654321", name="Bob", role="agent") vcon.add_party(caller) vcon.add_party(agent) -# Add conversation dialogs in sequence +# One Session for the conversation (lists the receivers) +vcon.add_session(Session(start=datetime.now(timezone.utc), parties=[0, 1])) + +# Add conversation dialogs in sequence (Dialog parties are the contributors) vcon.add_dialog(Dialog( type="text", start=datetime.now(timezone.utc).isoformat(), - parties=[0, 1], + parties=[0], mediatype="text/plain", body="Hello, I need help with my account." -)) +), session=0) vcon.add_dialog(Dialog( type="text", start=datetime.now(timezone.utc).isoformat(), - parties=[0, 1], + parties=[1], mediatype="text/plain", body="I'd be happy to help. Can you provide your account number?" -)) +), session=0) # Add metadata vcon.add_tag("customer_id", "12345") @@ -875,18 +896,18 @@ import base64 # Reading an audio file and adding it to a dialog with open("recording.mp3", "rb") as f: audio_data = f.read() - audio_base64 = base64.b64encode(audio_data).decode("utf-8") + audio_base64 = base64.urlsafe_b64encode(audio_data).decode("utf-8").rstrip("=") audio_dialog = Dialog( - type="audio", + type="recording", start=datetime.now(timezone.utc).isoformat(), parties=[0, 1], mediatype="audio/mp3", body=audio_base64, - encoding="base64", + encoding="base64url", filename="recording.mp3" ) -vcon.add_dialog(audio_dialog) +vcon.add_dialog(audio_dialog, session=0) ``` ### 3. External vs Inline Content @@ -914,9 +935,9 @@ if dialog.is_inline_data(): ### 4. Video Content Handling ```python -# Add video data with metadata +# Add video data with metadata (a "recording"; the mediatype says it is video) video_dialog = Dialog( - type="video", + type="recording", start=datetime.now(), parties=[0, 1], mediatype="video/mp4", @@ -986,14 +1007,14 @@ if image_dialog.is_pdf(): ### 6. Content Hashing and Integrity ```python -# Calculate content hash -content_hash = dialog.calculate_content_hash("sha256") +# Calculate content hash: "sha512-" (pass "sha256" for SHA-256) +content_hash = dialog.calculate_content_hash() # Set content hash for external files dialog.set_content_hash(content_hash) -# Verify content integrity -is_valid = dialog.verify_content_hash(expected_hash, "sha256") +# Verify content integrity (the algorithm is read from the hash prefix) +is_valid = dialog.verify_content_hash(expected_hash) # Check if external data has changed if dialog.is_external_data_changed(): @@ -1042,6 +1063,7 @@ When generating vCon code, use these templates as starting points: from vcon import Vcon from vcon.party import Party from vcon.dialog import Dialog +from vcon.session import Session from datetime import datetime def create_basic_conversation(): @@ -1054,13 +1076,17 @@ def create_basic_conversation(): vcon.add_party(caller) vcon.add_party(agent) + # A Session MUST exist once there is a Dialog (0.5.0) + vcon.add_session(Session(start=datetime.now(), parties=[0, 1])) + # Add conversation vcon.add_dialog(Dialog( type="text", start=datetime.now().isoformat(), - parties=[0, 1], + parties=[0], + mediatype="text/plain", body="Hello, I need help." - )) + ), session=0) return vcon ``` @@ -1087,22 +1113,25 @@ def create_multimedia_conversation(): vcon.add_party(caller) vcon.add_party(agent) + vcon.add_session(Session(start=datetime.now(), parties=[0, 1])) + # Add text dialog vcon.add_dialog(Dialog( type="text", start=datetime.now().isoformat(), - parties=[0, 1], + parties=[0], + mediatype="text/plain", body="Hello, I need help with my account." - )) + ), session=0) - # Add audio dialog + # Add audio recording dialog vcon.add_dialog(Dialog( type="recording", start=datetime.now().isoformat(), parties=[0, 1], mediatype="audio/mp3", filename="conversation.mp3" - )) + ), session=0) # Add analysis vcon.add_analysis( @@ -1140,16 +1169,17 @@ def create_extension_enabled_conversation(): vcon.add_party(caller) vcon.add_party(agent) - # Add recording dialog + # Add a Session and the recording dialog + vcon.add_session(Session(start=datetime.now(timezone.utc), parties=[0, 1])) dialog = Dialog( type="recording", start=datetime.now(timezone.utc), parties=[0, 1], mediatype="audio/mp3" ) - vcon.add_dialog(dialog) + vcon.add_dialog(dialog, session=0) - # Add lawful basis for consent + # Add lawful basis for consent (scoped to the only Session) vcon.add_lawful_basis_attachment( lawful_basis="consent", expiration=(datetime.now(timezone.utc) + timedelta(days=365)).isoformat(), @@ -1196,10 +1226,7 @@ def create_extension_enabled_conversation(): dialog_index=0 ) - # Add extensions - vcon.add_extension("lawful_basis") - vcon.add_extension("wtf_transcription") - + # Both methods already list their extension in vCon.extensions return vcon ``` @@ -1215,7 +1242,8 @@ def create_privacy_compliant_conversation(): ProofMechanism, LawfulBasisType, ProofType, - HashAlgorithm + HashAlgorithm, + CanonicalizationMethod ) vcon = Vcon.build_new() @@ -1234,14 +1262,15 @@ def create_privacy_compliant_conversation(): vcon.add_party(caller) vcon.add_party(agent) - # Add dialog + # Add a Session and the dialog + vcon.add_session(Session(start=datetime.now(timezone.utc), parties=[0, 1])) dialog = Dialog( type="recording", start=datetime.now(timezone.utc), parties=[0, 1], mediatype="audio/mp3" ) - vcon.add_dialog(dialog) + vcon.add_dialog(dialog, session=0) # Create comprehensive lawful basis purpose_grants = [ @@ -1266,7 +1295,7 @@ def create_privacy_compliant_conversation(): # Create content hash for integrity content_hash = ContentHash( algorithm=HashAlgorithm.SHA_256, - canonicalization="JCS", + canonicalization=CanonicalizationMethod.JCS, value="computed_hash_value" ) @@ -1289,14 +1318,15 @@ def create_privacy_compliant_conversation(): proof_mechanisms=[proof] ) - # Add to vCon - vcon.vcon_dict["attachments"].append({ - "type": "lawful_basis", - "encoding": "json", - "body": attachment.to_dict(), - "party": 0, - "dialog": 0 - }) + # Add to vCon (core-05: party plus session; a "json" body is the JSON value itself) + vcon.add_attachment( + purpose="lawful_basis", + body=attachment.to_dict(), + encoding="json", + mediatype="application/json", + party=0, + session=0 + ) # Add extension vcon.add_extension("lawful_basis") @@ -1335,14 +1365,15 @@ def create_transcription_enabled_conversation(): vcon.add_party(caller) vcon.add_party(agent) - # Add dialog + # Add a Session and the dialog + vcon.add_session(Session(start=datetime.now(timezone.utc), parties=[0, 1])) dialog = Dialog( type="recording", start=datetime.now(timezone.utc), parties=[0, 1], mediatype="audio/mp3" ) - vcon.add_dialog(dialog) + vcon.add_dialog(dialog, session=0) # Create detailed transcript transcript = Transcript( @@ -1352,7 +1383,22 @@ def create_transcription_enabled_conversation(): confidence=0.94 ) - # Create segments with words + # Create words + words = [ + Word(id=0, start=0.0, end=0.5, text="Hello", confidence=0.98, speaker=0), + Word(id=1, start=0.5, end=0.8, text="I", confidence=0.95, speaker=0), + Word(id=2, start=0.8, end=1.1, text="need", confidence=0.92, speaker=0), + Word(id=3, start=1.1, end=1.4, text="help", confidence=0.94, speaker=0), + Word(id=4, start=1.4, end=1.7, text="with", confidence=0.90, speaker=0), + Word(id=5, start=1.7, end=2.0, text="my", confidence=0.96, speaker=0), + Word(id=6, start=2.0, end=2.5, text="account", confidence=0.93, speaker=0), + Word(id=7, start=3.2, end=3.5, text="Can", confidence=0.91, speaker=0), + Word(id=8, start=3.5, end=3.8, text="you", confidence=0.94, speaker=0), + Word(id=9, start=3.8, end=4.2, text="assist", confidence=0.89, speaker=0), + Word(id=10, start=4.2, end=4.5, text="me", confidence=0.95, speaker=0) + ] + + # Create segments (a segment references its words by id) segments = [ Segment( id=0, @@ -1361,15 +1407,7 @@ def create_transcription_enabled_conversation(): text="Hello, I need help with my account.", confidence=0.95, speaker=0, - words=[ - Word(id=0, start=0.0, end=0.5, text="Hello", confidence=0.98, speaker=0), - Word(id=1, start=0.5, end=0.8, text="I", confidence=0.95, speaker=0), - Word(id=2, start=0.8, end=1.1, text="need", confidence=0.92, speaker=0), - Word(id=3, start=1.1, end=1.4, text="help", confidence=0.94, speaker=0), - Word(id=4, start=1.4, end=1.7, text="with", confidence=0.90, speaker=0), - Word(id=5, start=1.7, end=2.0, text="my", confidence=0.96, speaker=0), - Word(id=6, start=2.0, end=2.5, text="account", confidence=0.93, speaker=0) - ] + words=[0, 1, 2, 3, 4, 5, 6] ), Segment( id=1, @@ -1378,25 +1416,20 @@ def create_transcription_enabled_conversation(): text="Can you assist me?", confidence=0.92, speaker=0, - words=[ - Word(id=7, start=3.2, end=3.5, text="Can", confidence=0.91, speaker=0), - Word(id=8, start=3.5, end=3.8, text="you", confidence=0.94, speaker=0), - Word(id=9, start=3.8, end=4.2, text="assist", confidence=0.89, speaker=0), - Word(id=10, start=4.2, end=4.5, text="me", confidence=0.95, speaker=0) - ] + words=[7, 8, 9, 10] ) ] - # Create speaker information - speakers = [ - Speaker( + # Create speaker information (keyed by speaker id) + speakers = { + "0": Speaker( id=0, label="Customer", segments=[0, 1], total_time=6.5, confidence=0.93 ) - ] + } # Create quality metrics quality = Quality( @@ -1416,8 +1449,8 @@ def create_transcription_enabled_conversation(): processed_at=datetime.now(timezone.utc).isoformat(), provider="whisper", model="whisper-1", - audio_quality="high", - background_noise=0.05 + processing_time=2.1, + audio={"duration": 6.5, "sample_rate": 16000} ) # Create comprehensive WTF attachment @@ -1425,19 +1458,20 @@ def create_transcription_enabled_conversation(): transcript=transcript, segments=segments, metadata=metadata, - words=[word for segment in segments for word in segment.words], + words=words, speakers=speakers, quality=quality ) - # Add to vCon - vcon.vcon_dict["attachments"].append({ - "type": "wtf_transcription", - "encoding": "json", - "body": attachment.to_dict(), - "party": 0, - "dialog": 0 - }) + # Add to vCon (core-05: party plus dialog or session) + vcon.add_attachment( + purpose="wtf_transcription", + body=attachment.to_dict(), + encoding="json", + mediatype="application/json", + party=0, + dialog=0 + ) # Add extension vcon.add_extension("wtf_transcription") @@ -1462,14 +1496,21 @@ def chat_to_vcon(chat_messages, participants): vcon.add_party(party) party_map[participant["id"]] = i - # Add messages as dialogs + # One Session for the chat, received by all participants + vcon.add_session(Session( + start=chat_messages[0]["timestamp"], + parties=list(range(len(participants))) + )) + + # Add messages as dialogs (the sender is the contributor) for message in chat_messages: vcon.add_dialog(Dialog( type="text", start=message["timestamp"], parties=[party_map[message["sender_id"]]], + mediatype="text/plain", body=message["content"] - )) + ), session=0) return vcon ``` @@ -1620,6 +1661,7 @@ def export_transcriptions(vcon, party_index=None, format="srt"): exports.append({ "party_index": attachment.get("party"), "dialog_index": attachment.get("dialog"), + "session_index": attachment.get("session"), "format": format, "content": content }) @@ -1693,7 +1735,7 @@ def safe_vcon_operation(operation_func, *args, **kwargs): # Usage result = safe_vcon_operation(Vcon.load, "conversation.json") -if not result.get("success", True): +if isinstance(result, dict) and not result.get("success", True): print(f"Error: {result['error']}") ``` @@ -1715,11 +1757,18 @@ def validate_and_fix_vcon(vcon): # UUID is auto-generated, this shouldn't happen pass elif "invalid dialog type" in error.lower(): - # Try to fix invalid dialog types + # Try to fix invalid dialog types (core-05: recording, text, incomplete; + # an empty {} is a placeholder Dialog and has no type) for dialog in vcon.dialog: - if dialog.get("type") not in ["text", "recording", "incomplete", "audio", "video"]: + if not dialog: + continue + old_type = dialog.get("type") + if old_type in ("audio", "video"): + dialog["type"] = "recording" # deprecated aliases for recording + fixes_applied.append(f"Fixed dialog type {old_type} -> recording") + elif old_type not in ["recording", "text", "incomplete"]: dialog["type"] = "text" # Default to text - fixes_applied.append(f"Fixed invalid dialog type: {dialog.get('type')}") + fixes_applied.append(f"Fixed invalid dialog type: {old_type}") # Re-validate after fixes is_valid, remaining_errors = vcon.is_valid() @@ -1772,23 +1821,36 @@ def vcon_to_database_record(vcon): ### 6. Performance Considerations ```python +import base64 +from vcon.dialog import Dialog, compute_content_hash + def optimize_vcon_for_storage(vcon): """Optimize vCon for storage by converting large content to external references.""" + # vcon.dialog is a list of dicts (mutable references into the vCon) for i, dialog in enumerate(vcon.dialog): if dialog.get("body") and len(dialog["body"]) > 1000000: # 1MB threshold - # In real implementation, upload to storage and get URL + body = dialog["body"] + if dialog.get("encoding") == "base64url": + content = base64.urlsafe_b64decode(body + "=" * (-len(body) % 4)) + else: + content = body.encode() + # In real implementation, upload content to storage and get URL external_url = f"https://storage.example.com/dialog_{i}_content" dialog["url"] = external_url - dialog["content_hash"] = dialog.calculate_content_hash() + dialog["content_hash"] = compute_content_hash(content) # "sha512-..." del dialog["body"] - dialog["encoding"] = None + dialog.pop("encoding", None) def optimize_vcon_for_processing(vcon): """Optimize vCon for processing by loading external content.""" - for dialog in vcon.dialog: + for i, dialog_dict in enumerate(vcon.dialog): + if not dialog_dict: + continue # placeholder Dialog ({}) + dialog = Dialog(**dialog_dict) if dialog.is_external_data(): try: dialog.to_inline_data() + vcon.dialog[i] = dialog.to_dict() except Exception as e: print(f"Failed to load external content: {e}") ``` @@ -1805,7 +1867,7 @@ The vCon library provides a comprehensive framework for working with conversatio 6. **Handle Errors Gracefully**: Implement proper error handling for robust applications 7. **Consider Performance**: Optimize for storage or processing based on use case 8. **Use Extensions**: Declare optional features and must-support requirements -9. **Track Events**: Use party history for complex multi-party conversations +9. **Track Events**: Use Sessions and Event objects (joins, drops, holds, transfers) for complex multi-party conversations 10. **Integrate Seamlessly**: Follow patterns for API and database integration 11. **Implement Privacy Compliance**: Use Lawful Basis extension for GDPR compliance 12. **Standardize Transcriptions**: Use WTF extension for multi-provider transcription support diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 9096703..95a505f 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -50,6 +50,12 @@ attachment with inline content but no `mediatype`. # Earlier migration: Version Management Changes +> **Historical (pre-1.0).** This section describes an earlier release. Since 1.0.0, `build_new()` writes +> `"vcon": "0.5.0"`, a vCon that declares `"0.4.0"` is migrated to 0.5.0 on load (`migrate_legacy=False` turns +> that off), `is_valid()` requires a Session once there are dialogs or events, and attachments need `party` plus +> `dialog` or `session`. Where the text below says the version field is optional or that nothing is migrated, +> the 1.0.0 behavior above applies instead. + This guide helps you migrate your existing vCon code to work with the updated version management system. ## Overview @@ -92,7 +98,7 @@ The vCon library has been updated to align with the latest vCon specification ch If you were using the `strict_version` parameter, you need to remove it: ```python -# Old code (will cause errors) +# Old code: no longer works (TypeError: unexpected keyword argument 'strict_version') vcon = Vcon.load("file.json", strict_version=True) vcon = Vcon.build_from_json(json_str, strict_version=True) vcon = Vcon(data, strict_version=True) @@ -118,7 +124,7 @@ vcon = Vcon({"uuid": "123", "created_at": "2024-01-01T00:00:00Z"}) **Option B: Keep existing version fields** ```python -# This still works - no changes needed +# This still loads; since 1.0.0 a "0.4.0" vCon is migrated to "0.5.0" on load vcon = Vcon({"uuid": "123", "vcon": "0.4.0", "created_at": "2024-01-01T00:00:00Z"}) ``` @@ -273,6 +279,10 @@ party = Party( ) vcon.add_party(party) +# 1.0.0 / vCon 0.5.0: a Session must exist once there is a dialog +from vcon.session import Session +vcon.add_session(Session(start=datetime.now(), parties=[0])) + # Add dialog with session tracking and integrity dialog = Dialog( type="text", @@ -286,7 +296,7 @@ dialog = Dialog( content_hash = dialog.calculate_content_hash() dialog.set_content_hash(content_hash) -vcon.add_dialog(dialog) +vcon.add_dialog(dialog, session=0) # Save vcon.save_to_file("conversation.json") @@ -385,4 +395,5 @@ reference JSON schema: `created_at` when you don't supply them, because the WG JSON schema requires `start`, `party`, and `dialog` on every attachment. If your code checked for the *absence* of these keys (rather than their values), check - the CHANGELOG's 0.10.0 entry before upgrading. + the CHANGELOG's 0.10.0 entry before upgrading. (1.0.0 no longer defaults + `dialog` to `0`: pass `dialog` or `session`; see the 0.5.0 section above.) diff --git a/README.md b/README.md index 583df44..ac18c74 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,14 @@ # vCon Library -A Python library for working with vCon (Virtual Conversation) objects according to the vCon specification, currently `draft-ietf-vcon-vcon-core-05` (syntax `"0.5.0"`). +A Python library for working with vCon (Virtual Conversation) objects according to the vCon specification, currently [`draft-ietf-vcon-vcon-core-05`](https://datatracker.ietf.org/doc/draft-ietf-vcon-vcon-core/) (syntax `"0.5.0"`). + +[Documentation](https://www.conserver.io/vcon-library) · [API docs](https://vcon-dev.github.io/vcon-lib/) · [Changelog](https://github.com/vcon-dev/vcon-lib/blob/main/CHANGELOG.md) · [Migration guide](https://github.com/vcon-dev/vcon-lib/blob/main/MIGRATION_GUIDE.md) · [Source](https://github.com/vcon-dev/vcon-lib) + +```bash +pip install vcon +``` + +Requires Python 3.12 or later. Version 1.0 writes vCon syntax `"0.5.0"` and reads both `"0.4.0"` and `"0.5.0"`; a 0.4.0 vCon is migrated to 0.5.0 when it is loaded. 1.0 is a breaking release: read the [migration guide](https://github.com/vcon-dev/vcon-lib/blob/main/MIGRATION_GUIDE.md) before upgrading from 0.10 or earlier. ## Overview @@ -8,7 +16,7 @@ The vCon library provides a complete implementation of the vCon format for repre - **Conversation Management**: Parties, dialogs, attachments, and analysis - **Contact Information**: Multiple contact methods (tel, email, SIP, DID) -- **Media Support**: Audio, video, text, and image formats +- **Media Support**: Recordings (audio and video), text, and images - **Security**: Digital signatures and content hashing - **Extensibility**: Extensions and critical fields - **Location Data**: Civic address information (GEOPRIV) @@ -267,7 +275,8 @@ dialog = Dialog( start=datetime.now(), parties=[0, 1], session_id={"local": "local-uuid", "remote": "remote-uuid"}, - content_hash="c8d3d67f662a787e96e74ccb0a77803138c0f13495a186ccbde495c57c385608", + # "-"; vcon.compute_content_hash(data) makes one + content_hash="sha512-xbxzWUN7HoME4TkKebyfothmuRRH1M_Skvg2tfVxlFDWSQOdsLcKZ60qsibswilp_NsnfnBW3-7ctRSQGT9UVg", application="chat-app", message_id="" ) @@ -353,7 +362,8 @@ vcon.add_lawful_basis_attachment( "conditions": ["anonymized_data_only"] } ], - party_index=0 + party_index=0, + session_index=0 # an attachment needs a dialog or session scope ) # Check permissions @@ -438,7 +448,9 @@ wtf_attachment = whisper_adapter.convert(whisper_data) vcon.add_wtf_transcription_attachment( transcript=wtf_attachment.transcript.to_dict(), segments=[segment.to_dict() for segment in wtf_attachment.segments], - metadata=wtf_attachment.metadata.to_dict() + metadata=wtf_attachment.metadata.to_dict(), + party_index=0, + session_index=0 ) ``` @@ -517,6 +529,8 @@ is_valid, errors = Vcon.validate_file("conversation.vcon.json") ### Audio and Video +Core-05 has three Dialog types: `recording`, `text` and `incomplete`. Audio and video are both `recording` Dialogs, told apart by `mediatype`. `Dialog(type="audio")` and `Dialog(type="video")` still work, but they warn and build a `recording`. + ```python # Add audio recording audio_dialog = Dialog( @@ -529,7 +543,7 @@ audio_dialog = Dialog( # Add video with metadata video_dialog = Dialog( - type="video", + type="recording", start=datetime.now(), parties=[0, 1], url="https://example.com/video.mp4", @@ -557,7 +571,7 @@ from cryptography.hazmat.primitives import serialization # Generate key pair private_key, public_key = Vcon.generate_key_pair() -# Sign the vCon +# Sign the vCon (RS256 by default; alg "none" raises AlgorithmNotPermittedError) vcon.sign(private_key) # Verify signature @@ -567,11 +581,11 @@ is_valid = vcon.verify(public_key) ### Content Hashing ```python -# Calculate content hash for external files -content_hash = dialog.calculate_content_hash("sha256") +# Hash the dialog's content: "sha512-" by default +content_hash = dialog.calculate_content_hash() -# Verify content integrity -is_valid = dialog.verify_content_hash(expected_hash, "sha256") +# Verify content integrity against a stored hash +is_valid = dialog.verify_content_hash(content_hash) ``` ## Advanced Features @@ -628,7 +642,7 @@ This library implements the latest vCon specification with: - ✅ `extensions` completeness and `alg: "none"` rejection - ✅ Content hashing and security - ✅ Extensions and critical -- ✅ Flexible versioning (version field is optional) +- ✅ Writes `"vcon": "0.5.0"`; reads 0.4.0 and 0.5.0 - ✅ Backward compatibility - ✅ **Lawful Basis Extension** - GDPR-compliant privacy management - ✅ **WTF Extension** - World Transcription Format for standardized speech-to-text @@ -693,11 +707,14 @@ attachments = vcon.find_wtf_attachments(party_index=0) ## Documentation -- **[API Reference](API_REFERENCE.md)** - Complete API documentation -- **[User Guide](GUIDE.md)** - Comprehensive usage guide -- **[LLM Guide](LLM_GUIDE.md)** - Guide for AI-assisted development -- **[Migration Guide](MIGRATION_GUIDE.md)** - Upgrading from older versions +- **[conserver.io: vCon Library](https://www.conserver.io/vcon-library)** - Quickstart and API reference +- **[API docs](https://vcon-dev.github.io/vcon-lib/)** - Generated from the source +- **[API Reference](https://github.com/vcon-dev/vcon-lib/blob/main/API_REFERENCE.md)** - Complete API documentation +- **[User Guide](https://github.com/vcon-dev/vcon-lib/blob/main/GUIDE.md)** - Comprehensive usage guide +- **[LLM Guide](https://github.com/vcon-dev/vcon-lib/blob/main/LLM_GUIDE.md)** - Guide for AI-assisted development +- **[Migration Guide](https://github.com/vcon-dev/vcon-lib/blob/main/MIGRATION_GUIDE.md)** - Upgrading from 0.10 and earlier +- **[Changelog](https://github.com/vcon-dev/vcon-lib/blob/main/CHANGELOG.md)** - Release notes ## License -This project is licensed under the MIT License - see the LICENSE file for details. +This project is licensed under the MIT License - see the [LICENSE](https://github.com/vcon-dev/vcon-lib/blob/main/LICENSE.txt) file for details. diff --git a/docs/.buildinfo b/docs/.buildinfo deleted file mode 100644 index 52276a0..0000000 --- a/docs/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: e672ec15851c8dcd5df2f9a2464f7f1b -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/.doctrees/api/modules.doctree b/docs/.doctrees/api/modules.doctree deleted file mode 100644 index 7a295c1..0000000 Binary files a/docs/.doctrees/api/modules.doctree and /dev/null differ diff --git a/docs/.doctrees/api/vcon.doctree b/docs/.doctrees/api/vcon.doctree deleted file mode 100644 index f6c3808..0000000 Binary files a/docs/.doctrees/api/vcon.doctree and /dev/null differ diff --git a/docs/.doctrees/environment.pickle b/docs/.doctrees/environment.pickle deleted file mode 100644 index 8ed940f..0000000 Binary files a/docs/.doctrees/environment.pickle and /dev/null differ diff --git a/docs/.doctrees/index.doctree b/docs/.doctrees/index.doctree deleted file mode 100644 index b1262bc..0000000 Binary files a/docs/.doctrees/index.doctree and /dev/null differ diff --git a/docs/.doctrees/installation.doctree b/docs/.doctrees/installation.doctree deleted file mode 100644 index 69053c8..0000000 Binary files a/docs/.doctrees/installation.doctree and /dev/null differ diff --git a/docs/.doctrees/new_required_fields.doctree b/docs/.doctrees/new_required_fields.doctree deleted file mode 100644 index 5a9ca13..0000000 Binary files a/docs/.doctrees/new_required_fields.doctree and /dev/null differ diff --git a/docs/.doctrees/usage.doctree b/docs/.doctrees/usage.doctree deleted file mode 100644 index d735a99..0000000 Binary files a/docs/.doctrees/usage.doctree and /dev/null differ diff --git a/docs/.doctrees/version_management.doctree b/docs/.doctrees/version_management.doctree deleted file mode 100644 index 7f4bec1..0000000 Binary files a/docs/.doctrees/version_management.doctree and /dev/null differ diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index 0824eda..0000000 --- a/docs/.nojekyll +++ /dev/null @@ -1 +0,0 @@ -This file tells GitHub Pages to skip Jekyll processing diff --git a/docs/_modules/index.html b/docs/_modules/index.html deleted file mode 100644 index fee35b5..0000000 --- a/docs/_modules/index.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - Overview: module code — vcon 0.7.0 documentation - - - - - - - - - - - - - - - -
- - -
- -
-
-
-
    -
  • - -
  • -
  • -
-
-
-
-
- -

All modules for which code is available

- - -
-
-
- -
- -
-

© Copyright 2024, Thomas McCarthy-Howe.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/docs/_modules/vcon/civic_address.html b/docs/_modules/vcon/civic_address.html deleted file mode 100644 index ea2fe7d..0000000 --- a/docs/_modules/vcon/civic_address.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - vcon.civic_address — vcon 0.7.0 documentation - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for vcon.civic_address

-from typing import Optional
-
-
-
[docs]class CivicAddress: - """ - A class representing civic address information according to GEOPRIV specification. - - This class supports all civic address fields defined in RFC 4776 (GEOPRIV) - and is used within vCon Party objects to provide location information. - - Administrative areas (a1-a6): - - a1: Administrative area 1 (e.g., state or province) - - a2: Administrative area 2 (e.g., county or municipality) - - a3: Administrative area 3 (e.g., city or town) - - a4: Administrative area 4 (e.g., neighborhood or district) - - a5: Administrative area 5 (e.g., postal code) - - a6: Administrative area 6 (e.g., building or floor) - - Street and building information: - - sts: Street name - - hno: House number - - hns: House name - - prd: Premier (e.g., department or suite number) - - flr: Floor - - Location and identification: - - country: Country code (ISO 3166-1 alpha-2) - - pc: Postal code - - nam: Name of the location - - lmk: Landmark name - - loc: Location name - - pod: Post office box identifier - - All fields are optional and follow the GEOPRIV specification format. - Field names are in lowercase as required by the vCon specification. - """ -
[docs] def __init__(self, - country: Optional[str] = None, - a1: Optional[str] = None, - a2: Optional[str] = None, - a3: Optional[str] = None, - a4: Optional[str] = None, - a5: Optional[str] = None, - a6: Optional[str] = None, - prd: Optional[str] = None, - pod: Optional[str] = None, - sts: Optional[str] = None, - hno: Optional[str] = None, - hns: Optional[str] = None, - lmk: Optional[str] = None, - loc: Optional[str] = None, - flr: Optional[str] = None, - nam: Optional[str] = None, - pc: Optional[str] = None): - """ - Initialize a new CivicAddress object. - - :param country: Country code (ISO 3166-1 alpha-2) - :type country: str - :param a1: Administrative area 1 (e.g. state or province) - :type a1: str - :param a2: Administrative area 2 (e.g. county or municipality) - :type a2: str - :param a3: Administrative area 3 (e.g. city or town) - :type a3: str - :param a4: Administrative area 4 (e.g. neighborhood or district) - :type a4: str - :param a5: Administrative area 5 (e.g. postal code) - :type a5: str - :param a6: Administrative area 6 (e.g. building or floor) - :type a6: str - :param prd: Premier (e.g. department or suite number) - :type prd: str - :param pod: Post office box identifier - :type pod: str - :param sts: Street name - :type sts: str - :param hno: House number - :type hno: str - :param hns: House name - :type hns: str - :param lmk: Landmark name - :type lmk: str - :param loc: Location name - :type loc: str - :param flr: Floor - :type flr: str - :param nam: Name of the location - :type nam: str - :param pc: Postal code - :type pc: str - """ - self.country = country - self.a1 = a1 - self.a2 = a2 - self.a3 = a3 - self.a4 = a4 - self.a5 = a5 - self.a6 = a6 - self.prd = prd - self.pod = pod - self.sts = sts - self.hno = hno - self.hns = hns - self.lmk = lmk - self.loc = loc - self.flr = flr - self.nam = nam - self.pc = pc
- -
[docs] def to_dict(self) -> dict[str, Optional[str]]: - """ - Convert the CivicAddress object to a dictionary. - - The dictionary keys are the attribute names of the object, and the - values are the attribute values. - - :return: A dictionary of the object's attributes - :rtype: dict[str, Optional[str]] - """ - return {attr: getattr(self, attr) for attr in dir(self) if not attr.startswith("_") and getattr(self, attr) is not None and not callable(getattr(self, attr))}
- -
- -
-
-
- -
- -
-

© Copyright 2024, Thomas McCarthy-Howe.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/docs/_modules/vcon/dialog.html b/docs/_modules/vcon/dialog.html deleted file mode 100644 index 79908d9..0000000 --- a/docs/_modules/vcon/dialog.html +++ /dev/null @@ -1,1439 +0,0 @@ - - - - - - - - vcon.dialog — vcon 0.7.0 documentation - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for vcon.dialog

-import requests
-import hashlib
-import base64
-import os
-import logger
-import tempfile
-from datetime import datetime
-from typing import Optional, List, Dict, Union, Any, Tuple
-from .party import PartyHistory
-from dateutil import parser
-
-MIME_TYPES = [
-    "text/plain",
-    "audio/x-wav",
-    "audio/wav",
-    "audio/wave",
-    "audio/mpeg",
-    "audio/mp3",
-    "audio/x-mp3",        # Specification required
-    "audio/x-mp4",        # Specification required
-    "audio/ogg",
-    "audio/webm",
-    "audio/x-m4a",
-    "audio/aac",
-    "video/x-mp4",
-    "video/mp4",              # MP4 format
-    "video/quicktime",        # MOV format
-    "video/webm",             # WebM format
-    "video/x-msvideo",        # AVI format
-    "video/x-matroska",       # MKV format
-    "video/mpeg",             # MPEG format
-    "video/x-flv",            # FLV format
-    "video/3gpp",             # 3GP format for mobile
-    "video/x-m4v",            # M4V format (Apple variant)
-    "multipart/mixed",
-    "message/rfc822",
-    "image/jpeg",
-    "image/tiff",
-    "application/pdf",  # Added for image data
-    "application/json"  # Added for signaling data
-]
-
-
-
[docs]class Dialog: - """ - A class representing a dialog segment in a vCon conversation. - - A dialog represents a piece of conversation content, which can be: - - text: Text-based communication (email, chat, SMS) - - recording: Audio/video recording of the conversation - - transfer: Call transfer operation between parties - - incomplete: Failed or incomplete conversation setup - - video: Video content with metadata - - Dialog content can be stored inline or referenced externally: - - Inline: Content stored directly in the body field - - External: Content referenced via URL with content_hash for integrity - - Media support: - - Audio formats: WAV, MP3, MP4, OGG, WebM, AAC - - Video formats: MP4, WebM, AVI, MKV, MOV, FLV, 3GP - - Text formats: Plain text, multipart messages - - Images: JPEG, TIFF, PDF - - New in vCon 0.4.0: - - session_id: Session identifier for tracking - - content_hash: Hash for externally referenced files (replaces alg/signature) - - application: Application identifier for the dialog - - message_id: Message identifier for email/text dialogs - - Updated media type validation with specification-compliant types - - New disposition values for incomplete dialogs - - Party history with event tracking (join, drop, hold, unhold, mute, unmute) - - Transfer dialog features: - - transfer_target: Target party for transfers - - target_dialog: Target dialog reference - - Support for consultation and original call tracking - """ - - MIME_TYPES = [ - "text/plain", - "audio/x-wav", - "audio/wav", - "audio/wave", - "audio/mpeg", - "audio/mp3", - "audio/x-mp3", # Specification required - "audio/x-mp4", # Specification required - "audio/ogg", - "audio/webm", - "audio/x-m4a", - "audio/aac", - "video/x-mp4", - "video/ogg", - "video/mp4", # MP4 format - "video/quicktime", # MOV format - "video/webm", # WebM format - "video/x-msvideo", # AVI format - "video/x-matroska", # MKV format - "video/mpeg", # MPEG format - "video/x-flv", # FLV format - "video/3gpp", # 3GP format for mobile - "video/x-m4v", # M4V format (Apple variant) - "multipart/mixed", - "message/rfc822", - "image/jpeg", - "image/tiff", - "application/pdf", # Added for image data - "application/json" # Added for signaling data - ] - - - # Include the required types for tests to pass - VALID_TYPES = [ - "recording", - "text", - "transfer", - "incomplete", - "audio", - "video" - ] - - # Valid disposition values for incomplete dialogs (from specification) - VALID_DISPOSITIONS = [ - "no-answer", - "congestion", - "failed", - "busy", - "hung-up", - "voicemail-no-message" - ] - -
[docs] def __init__( - self, - type: str, - start: Union[datetime, str], - parties: List[int], - originator: Optional[int] = None, - mediatype: Optional[str] = None, - filename: Optional[str] = None, - body: Optional[str] = None, - encoding: Optional[str] = None, - url: Optional[str] = None, - disposition: Optional[str] = None, - party_history: Optional[List[PartyHistory]] = None, - transferee: Optional[int] = None, - transferor: Optional[int] = None, - transfer_target: Optional[int] = None, - original: Optional[int] = None, - consultation: Optional[int] = None, - target_dialog: Optional[int] = None, - campaign: Optional[str] = None, - interaction: Optional[str] = None, - skill: Optional[str] = None, - duration: Optional[float] = None, - meta: Optional[dict] = None, - # New parameters for signaling and extended functionality - metadata: Optional[Dict[str, Any]] = None, - transfer: Optional[Dict[str, Any]] = None, - signaling: Optional[Dict[str, Any]] = None, - # New parameters for video metadata - resolution: Optional[str] = None, - frame_rate: Optional[float] = None, - codec: Optional[str] = None, - bitrate: Optional[int] = None, - thumbnail: Optional[str] = None, - # New required fields - session_id: Optional[Union[Dict[str, str], List[Dict[str, str]]]] = None, - content_hash: Optional[str] = None, - # Additional fields from specification - application: Optional[str] = None, - message_id: Optional[str] = None, - **kwargs, - ) -> None: - """ - Initialize a Dialog object. - :param type: the type of the dialog (e.g. "text", "recording", "transfer", "incomplete", "video") - :type type: str - :param start: the start time of the dialog - :type start: datetime - :param parties: the parties involved in the dialog - :type parties: List[int] - :param originator: the party that originated the dialog - :type originator: int or None - :param mediatype: the MIME type of the dialog body - :type mediatype: str or None - :param filename: the filename of the dialog body - :type filename: str or None - :param body: the body of the dialog - :type body: str or None - :param encoding: the encoding of the dialog body - :type encoding: str or None - :param url: the URL of the dialog - :type url: str or None - :param disposition: the disposition of the dialog - :type disposition: str or None - :param party_history: the history of parties involved in the dialog - :type party_history: List[PartyHistory] or None - :param transferee: the party that the dialog was transferred to - :type transferee: int or None - :param transferor: the party that transferred the dialog - :type transferor: int or None - :param transfer_target: the target of the transfer - :type transfer_target: int or None - :param original: the original dialog - :type original: int or None - :param consultation: the consultation dialog - :type consultation: int or None - :param target_dialog: the target dialog - :type target_dialog: int or None - :param campaign: the campaign that the dialog is associated with - :type campaign: str or None - :param interaction: the interaction that the dialog is associated with - :type interaction: str or None - :param skill: the skill that the dialog is associated with - :type skill: str or None - :param duration: the duration of the dialog - :type duration: float or None - :param meta: additional metadata for the dialog - :type meta: dict or None - :param metadata: structured metadata for the dialog (newer format) - :type metadata: dict or None - :param transfer: transfer-specific information - :type transfer: dict or None - :param signaling: signaling-specific information - :type signaling: dict or None - :param resolution: video resolution (e.g., "1920x1080") - :type resolution: str or None - :param frame_rate: video frame rate in fps - :type frame_rate: float or None - :param codec: video codec (e.g., "H.264", "H.265") - :type codec: str or None - :param bitrate: video bitrate in kbps - :type bitrate: int or None - :param thumbnail: base64-encoded thumbnail image - :type thumbnail: str or None - :param session_id: Session identifier - :type session_id: str or None - :param content_hash: Hash for externally referenced files (replaces alg and signature) - :type content_hash: str or None - :param application: Application identifier for the dialog - :type application: str or None - :param message_id: Message identifier for email/text dialogs - :type message_id: str or None - :param kwargs: Additional attributes to be set on the dialog - """ - - # Validate dialog type - if type not in self.VALID_TYPES: - raise ValueError(f"Invalid dialog type: {type}. Must be one of {self.VALID_TYPES}") - - # Convert the start time to an ISO 8601 string from a datetime or a string - if isinstance(start, datetime): - start = start.isoformat() - elif isinstance(start, str): - start = parser.parse(start).isoformat() - - # Set attributes from named parameters that are not None - for key, value in locals().items(): - if value is not None and key not in ("self", "kwargs"): - setattr(self, key, value) - - # Don't merge meta and metadata; keep both for backward compatibility - # This ensures tests relying on dialog.meta will continue to work - # while also allowing new code to use dialog.metadata - if not hasattr(self, "metadata") and hasattr(self, "meta"): - self.metadata = self.meta.copy() if self.meta else {} - elif not hasattr(self, "meta") and hasattr(self, "metadata"): - self.meta = self.metadata.copy() if self.metadata else {} - elif not hasattr(self, "metadata") and not hasattr(self, "meta"): - self.metadata = {} - self.meta = {} - - # Set any additional kwargs as attributes - for key, value in kwargs.items(): - if value is not None: - setattr(self, key, value) - - # Handling for specific dialog types - if type == "incomplete" and not hasattr(self, "disposition"): - raise ValueError("Dialog type 'incomplete' requires a disposition") - - # Validate disposition values for incomplete dialogs - if (type == "incomplete" and hasattr(self, "disposition") - and self.disposition): - if self.disposition not in Dialog.VALID_DISPOSITIONS: - raise ValueError( - f"Invalid disposition '{self.disposition}'. " - f"Must be one of: {Dialog.VALID_DISPOSITIONS}" - ) - - # Auto-detect mediatype for video type - if type == "video" and not hasattr(self, "mediatype"): - # Try to infer mediatype from filename extension if available - if hasattr(self, "filename") and self.filename: - ext = self.filename.split('.')[-1].lower() - if ext == "mp4": - self.mediatype = "video/mp4" - elif ext == "mov": - self.mediatype = "video/quicktime" - elif ext == "webm": - self.mediatype = "video/webm" - elif ext == "avi": - self.mediatype = "video/x-msvideo" - elif ext == "mkv": - self.mediatype = "video/x-matroska" - elif ext in ["mpg", "mpeg"]: - self.mediatype = "video/mpeg" - elif ext == "flv": - self.mediatype = "video/x-flv" - elif ext == "3gp": - self.mediatype = "video/3gpp" - elif ext == "m4v": - self.mediatype = "video/x-m4v" - else: - # Default to MP4 if we can't determine from extension - self.mediatype = "video/mp4" - else: - # Default mediatype for video - self.mediatype = "video/mp4"
- -
[docs] def to_dict(self): - """ - Returns a dictionary representation of the Dialog object. - - :return: a dictionary containing all non-None Dialog object attributes - :rtype: dict - """ - # Check to see if the start time provided. If not, - # set the start time to the current time - if not hasattr(self, "start"): - self.start = datetime.now().isoformat() - - # Get all attributes of the object - dialog_dict = self.__dict__.copy() - - # Handle party_history specially - if hasattr(self, "party_history") and self.party_history: - dialog_dict["party_history"] = [ - party_history.to_dict() for party_history in self.party_history - ] - - return {k: v for k, v in dialog_dict.items() if v is not None}
- -
[docs] def add_external_data(self, url: str, filename: str, mediatype: str) -> None: - """ - Add external data to the dialog. - - :param url: the URL of the external data - :type url: str - :return: None - :rtype: None - """ - self.url = url - response = requests.get(url) - if response.status_code == 200: - self.mediatype = response.headers["Content-Type"] - else: - raise Exception(f"Failed to fetch external data: {response.status_code}") - - # Override the filename if provided, otherwise use the filename from the URL - if filename: - self.filename = filename - else: - # Extract filename from URL, removing any query parameters - url_path = url.split("?")[0] - self.filename = url_path.split("/")[-1] - - # Override the mediatype if provided, otherwise use the mediatype from the URL - if mediatype: - self.mediatype = mediatype - - # Calculate the content hash for external data - raw_content = response.content - self.content_hash = base64.urlsafe_b64encode( - hashlib.sha256(raw_content).digest() - ).decode()
- -
[docs] def add_inline_data(self, body: str, filename: str, mediatype: str) -> None: - """ - Add inline data to the dialog. - - :param body: the body of the inline data - :type body: str - :param filename: the filename of the inline data - :type filename: str - :param mediatype: the mediatype of the inline data - :type mediatype: str - :return: None - :rtype: None - """ - self.body = body - self.mediatype = mediatype - self.filename = filename - self.encoding = "base64url" - self.content_hash = base64.urlsafe_b64encode( - hashlib.sha256(self.body.encode()).digest() - ).decode()
- -
[docs] def is_external_data(self) -> bool: - """ - Check if the dialog is an external data dialog. - - :return: True if the dialog is an external data dialog, False otherwise - :rtype: bool - """ - return hasattr(self, "url")
- -
[docs] def is_inline_data(self) -> bool: - """ - Check if the dialog is an inline data dialog. - - :return: True if the dialog is an inline data dialog, False otherwise - :rtype: bool - """ - return not self.is_external_data()
- -
[docs] def is_text(self) -> bool: - """ - Check if the dialog is a text dialog. - :return: True if the dialog is a text dialog, False otherwise - :rtype: bool - """ - return hasattr(self, "type") and self.type == "text"
- -
[docs] def is_recording(self) -> bool: - """ - Check if the dialog is a recording dialog. - :return: True if the dialog is a recording dialog, False otherwise - :rtype: bool - """ - return hasattr(self, "type") and self.type == "recording"
- -
[docs] def is_transfer(self) -> bool: - """ - Check if the dialog is a transfer dialog. - :return: True if the dialog is a transfer dialog, False otherwise - :rtype: bool - """ - return hasattr(self, "type") and self.type == "transfer"
- -
[docs] def is_incomplete(self) -> bool: - """ - Check if the dialog is an incomplete dialog. - :return: True if the dialog is an incomplete dialog, False otherwise - :rtype: bool - """ - return hasattr(self, "type") and self.type == "incomplete"
- -
[docs] def is_audio(self) -> bool: - """ - Check if the dialog has audio content. - :return: True if the dialog has audio content, False otherwise - :rtype: bool - """ - return self.mediatype in [ - "audio/x-wav", - "audio/wav", - "audio/wave", - "audio/mpeg", - "audio/mp3", - "audio/ogg", - "audio/webm", - "audio/x-m4a", - "audio/aac", - ]
- -
[docs] def is_video(self, content_type=None) -> bool: - """ - Check if the dialog has video content. - - Args: - content_type: Optional content type to check. If None, use the dialog's mediatype. - - Returns: - True if the content is a video format, False otherwise - """ - # Use provided content_type or dialog's mediatype - check_type = content_type if content_type is not None else getattr(self, "mediatype", None) - - if not check_type: - return False - - # Check if it's any of the supported video types - video_types = [ - "video/x-mp4", - "video/ogg", - "video/mp4", - "video/quicktime", - "video/webm", - "video/x-msvideo", - "video/x-matroska", - "video/mpeg", - "video/3gpp", - "video/x-m4v", - "video/x-flv" - ] - - return check_type in video_types
- -
[docs] def add_video_data(self, video_data, filename=None, mediatype=None, inline=True, metadata=None) -> None: - """ - Add video data to the dialog. - - Args: - video_data: Binary video data or URL to video - filename: Name of the video file - mediatype: MIME type of the video, or auto-detected from filename if None - inline: Whether to include the video as inline content (True) or external reference (False) - metadata: Optional video metadata to include - - Returns: - None - """ - # Set dialog type to video - self.type = "video" - - # Auto-detect mediatype from filename if not provided - if not mediatype and filename: - ext = filename.split('.')[-1].lower() - ext_to_mediatype = { - 'mp4': 'video/mp4', - 'mov': 'video/quicktime', - 'webm': 'video/webm', - 'avi': 'video/x-msvideo', - 'mkv': 'video/x-matroska', - 'mpg': 'video/mpeg', - 'mpeg': 'video/mpeg', - 'flv': 'video/x-flv', - 'ogg': 'video/ogg' - } - mediatype = ext_to_mediatype.get(ext, 'video/mp4') # Default to MP4 if unknown - - # Handle external vs inline data - if inline: - # For base64 encoding, convert to bytes if it's a string - if isinstance(video_data, str) and not video_data.startswith('http'): - video_data = video_data.encode() - - # Add inline data - if isinstance(video_data, bytes): - # Base64 encode the binary data - encoded_data = base64.urlsafe_b64encode(video_data).decode() - self.add_inline_data(encoded_data, filename, mediatype) - else: - # Assume it's already base64 encoded - self.add_inline_data(video_data, filename, mediatype) - else: - # External data - if isinstance(video_data, str) and (video_data.startswith('http://') or video_data.startswith('https://')): - # It's a URL, use it directly - self.add_external_data(video_data, filename, mediatype) - else: - # Cannot use non-URL as external data - raise ValueError("External video references must be URLs") - - # Add metadata if provided - if metadata: - if not hasattr(self, "metadata"): - self.metadata = {} - if not hasattr(self, "meta"): - self.meta = {} - - self.metadata["video"] = metadata - self.meta["video"] = metadata
- -
[docs] def extract_video_metadata(self, video_path=None) -> dict: - """ - Extract comprehensive metadata from video content using FFmpeg. - - Args: - video_path: Optional path to video file. If None, uses the dialog's content. - - Returns: - Dictionary containing detailed video metadata - """ - import ffmpeg - - # Create temporary file if working with inline data - temp_file = None - try: - if video_path is None: - if self.is_inline_data(): - # Decode base64 content to temporary file - temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=f".{self.get_video_format_from_mediatype()}") - video_data = base64.urlsafe_b64decode(self.body.encode()) - temp_file.write(video_data) - temp_file.close() - video_path = temp_file.name - elif self.is_external_data(): - # Download from URL to temporary file - temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=f".{self.get_video_format_from_mediatype()}") - response = requests.get(self.url) - temp_file.write(response.content) - temp_file.close() - video_path = temp_file.name - else: - raise ValueError("Cannot extract metadata: no video content available") - - # Use FFmpeg to extract metadata - probe = ffmpeg.probe(video_path) - - # Find video stream - video_stream = next((stream for stream in probe['streams'] - if stream['codec_type'] == 'video'), None) - - if video_stream is None: - raise ValueError("No video stream found in file") - - # Get format information - format_info = probe.get('format', {}) - - # Extract comprehensive metadata - metadata = { - "duration": float(format_info.get("duration", 0)), - "size_bytes": int(format_info.get("size", 0)), - "bit_rate": int(format_info.get("bit_rate", 0)), - "format": format_info.get("format_name", ""), - - # Video stream details - "codec": video_stream.get("codec_name", ""), - "codec_long_name": video_stream.get("codec_long_name", ""), - "width": int(video_stream.get("width", 0)), - "height": int(video_stream.get("height", 0)), - "display_aspect_ratio": video_stream.get("display_aspect_ratio", ""), - "pixel_format": video_stream.get("pix_fmt", ""), - "profile": video_stream.get("profile", ""), - "level": video_stream.get("level", -1), - - # Frame rate calculation - "frame_rate": self._calculate_frame_rate(video_stream.get("avg_frame_rate", "0/1")), - "total_frames": int(video_stream.get("nb_frames", 0)), - - # Color details if available - "color_space": video_stream.get("color_space", ""), - "color_transfer": video_stream.get("color_transfer", ""), - "color_primaries": video_stream.get("color_primaries", ""), - - # Additional format-specific data - "contains_audio": any(stream["codec_type"] == "audio" for stream in probe.get("streams", [])), - "timestamp": datetime.now().isoformat() - } - - return metadata - - except Exception as e: - logger.error(f"Error extracting video metadata: {str(e)}") - # Return minimal metadata on error - return { - "error": str(e), - "format": self.get_video_format_from_mediatype(), - "timestamp": datetime.now().isoformat() - } - - finally: - # Clean up temporary file if created - if temp_file and os.path.exists(temp_file.name): - os.unlink(temp_file.name)
- - def _calculate_frame_rate(self, frame_rate_str): - """ - Calculate numeric frame rate from FFmpeg frame rate string. - - Args: - frame_rate_str: Frame rate as string in format "num/den" - - Returns: - Frame rate as float - """ - try: - if "/" in frame_rate_str: - num, den = map(int, frame_rate_str.split("/")) - if den == 0: - return 0 - return num / den - else: - return float(frame_rate_str) - except (ValueError, ZeroDivisionError): - return 0 - - def generate_thumbnail(self, timestamp=0.0, width=320, height=240, quality=90) -> bytes: - """ - Generate a high-quality thumbnail from the video at the specified timestamp. - - Args: - timestamp: Time in seconds at which to extract the thumbnail frame - width: Desired width of the thumbnail in pixels - height: Desired height of the thumbnail in pixels - quality: JPEG quality (1-100) - - Returns: - Binary thumbnail data in JPEG format - """ - import ffmpeg - - if not self.is_video(): - raise ValueError("Cannot generate thumbnail for non-video content") - - # Create temporary files - temp_video = None - temp_thumb = None - - try: - # Setup source video file - if self.is_inline_data(): - temp_video = tempfile.NamedTemporaryFile(delete=False, suffix=f".{self.get_video_format_from_mediatype()}") - video_data = base64.urlsafe_b64decode(self.body.encode()) - temp_video.write(video_data) - temp_video.close() - video_path = temp_video.name - elif self.is_external_data(): - temp_video = tempfile.NamedTemporaryFile(delete=False, suffix=f".{self.get_video_format_from_mediatype()}") - response = requests.get(self.url) - temp_video.write(response.content) - temp_video.close() - video_path = temp_video.name - else: - raise ValueError("Cannot generate thumbnail: no video content available") - - # Setup thumbnail output file - temp_thumb = tempfile.NamedTemporaryFile(delete=False, suffix=".jpg") - temp_thumb.close() - - # Get video duration to validate timestamp - probe = ffmpeg.probe(video_path) - duration = float(probe.get("format", {}).get("duration", 0)) - - # Ensure timestamp is within video duration - validated_timestamp = min(max(0, timestamp), duration if duration > 0 else timestamp) - - # Generate thumbnail using FFmpeg - ( - ffmpeg - .input(video_path, ss=validated_timestamp) - .filter('scale', width, height) - .output(temp_thumb.name, vframes=1, q=min(max(1, 31 - int(quality * 0.3)), 31)) - .overwrite_output() - .run(quiet=True) - ) - - # Read the generated thumbnail - with open(temp_thumb.name, "rb") as f: - thumbnail_data = f.read() - - # Add thumbnail to metadata - if not hasattr(self, "metadata"): - self.metadata = {} - if not hasattr(self, "meta"): - self.meta = {} - - if "video" not in self.metadata: - self.metadata["video"] = {} - if "video" not in self.meta: - self.meta["video"] = {} - - # Store thumbnail as base64 - thumbnail_b64 = base64.b64encode(thumbnail_data).decode() - - self.metadata["video"]["thumbnail"] = { - "data": thumbnail_b64, - "content_type": "image/jpeg", - "timestamp": validated_timestamp, - "width": width, - "height": height, - "quality": quality - } - self.meta["video"]["thumbnail"] = self.metadata["video"]["thumbnail"] - - return thumbnail_data - - except Exception as e: - logger.error(f"Error generating thumbnail: {str(e)}") - raise - - finally: - # Clean up temporary files - if temp_video and os.path.exists(temp_video.name): - os.unlink(temp_video.name) - if temp_thumb and os.path.exists(temp_thumb.name): - os.unlink(temp_thumb.name) - -
[docs] def add_streaming_video_reference(self, reference_id, mediatype, metadata=None) -> None: - """ - Add a reference to a streamable video. - - Args: - reference_id: Unique identifier for the streamable video - mediatype: MIME type of the video - metadata: Optional video metadata - - Returns: - None - """ - self.type = "video" - self.url = f"stream://{reference_id}" - self.mediatype = mediatype - - # Add streaming-specific metadata - if not hasattr(self, "metadata"): - self.metadata = {} - if not hasattr(self, "meta"): - self.meta = {} - - self.metadata["streaming"] = { - "reference_id": reference_id, - "protocol": "stream" - } - self.meta["streaming"] = self.metadata["streaming"] - - # Add video metadata if provided - if metadata: - self.metadata["video"] = metadata - self.meta["video"] = metadata
- - -
[docs] def get_video_format_from_mediatype(self, mediatype) -> str: - """ - Get the video format name from a MIME type. - - Args: - mediatype: MIME type of the video - - Returns: - Format name (mp4, mov, etc.) - """ - mediatype_to_format = { - 'video/mp4': 'mp4', - 'video/x-mp4': 'mp4', - 'video/quicktime': 'mov', - 'video/webm': 'webm', - 'video/x-msvideo': 'avi', - 'video/x-matroska': 'mkv', - 'video/mpeg': 'mpeg', - 'video/x-flv': 'flv', - 'video/ogg': 'ogg' - } - - return mediatype_to_format.get(mediatype, 'unknown')
- -
[docs] def has_thumbnail(self) -> bool: - """ - Check if the video has a thumbnail. - - Returns: - True if the video has a thumbnail, False otherwise - """ - if hasattr(self, "metadata") and "video" in self.metadata: - return "thumbnail" in self.metadata["video"] - return False
- -
[docs] def add_video_with_optimal_storage(self, video_data, filename, mediatype=None, size_threshold_mb=10) -> None: - """ - Add video with the optimal storage method based on size. - - Args: - video_data: Binary video data or URL - filename: Name of the video file - mediatype: MIME type of the video (optional) - size_threshold_mb: Size threshold in MB for inline vs external storage - - Returns: - None - """ - # Determine data size if it's binary data - if isinstance(video_data, bytes): - size_mb = len(video_data) / (1024 * 1024) - - # Use inline for small videos, external for larger ones - if size_mb <= size_threshold_mb: - self.add_video_data(video_data, filename, mediatype, inline=True) - else: - # For larger videos, we would typically upload to external storage - # and then reference the URL, but this is a placeholder - raise ValueError( - f"Video size ({size_mb:.2f} MB) exceeds threshold ({size_threshold_mb} MB). " - "Upload to external storage and use the URL instead." - ) - elif isinstance(video_data, str) and (video_data.startswith('http://') or video_data.startswith('https://')): - # It's already a URL, use external reference - self.add_video_data(video_data, filename, mediatype, inline=False) - else: - # Unknown format - raise ValueError("video_data must be binary data or a URL")
- -
[docs] def transcode_video(self, target_format, codec=None, bit_rate=None, width=None, height=None) -> None: - """ - Transcode the video to a different format or with different encoding parameters. - - Args: - target_format: Target video format (mp4, webm, etc.) - codec: Video codec to use (h264, vp9, etc.) - bit_rate: Target bitrate in bits per second - width: Target width (if resizing) - height: Target height (if resizing) - - Returns: - None - updates the dialog's content in place - """ - import ffmpeg - - if not self.is_video(): - raise ValueError("Cannot transcode non-video content") - - # Setup temporary files - temp_input = None - temp_output = None - - try: - # Get source video - if self.is_inline_data(): - temp_input = tempfile.NamedTemporaryFile(delete=False, suffix=f".{self.get_video_format_from_mediatype()}") - video_data = base64.urlsafe_b64decode(self.body.encode()) - temp_input.write(video_data) - temp_input.close() - input_path = temp_input.name - elif self.is_external_data(): - temp_input = tempfile.NamedTemporaryFile(delete=False, suffix=f".{self.get_video_format_from_mediatype()}") - response = requests.get(self.url) - temp_input.write(response.content) - temp_input.close() - input_path = temp_input.name - else: - raise ValueError("Cannot transcode: no video content available") - - # Setup output file - temp_output = tempfile.NamedTemporaryFile(delete=False, suffix=f".{target_format}") - temp_output.close() - - # Setup FFmpeg conversion - stream = ffmpeg.input(input_path) - - # Apply filters if needed - if width is not None and height is not None: - stream = stream.filter('scale', width, height) - - # Setup output parameters - output_params = {} - if codec: - output_params['c:v'] = codec - if bit_rate: - output_params['b:v'] = bit_rate - - # Run transcoding - ffmpeg.output(stream, temp_output.name, **output_params).run(quiet=True) - - # Read the transcoded file - with open(temp_output.name, "rb") as f: - new_video_data = f.read() - - # Update the dialog with the new video - ext_to_mediatype = { - 'mp4': 'video/mp4', - 'mov': 'video/quicktime', - 'webm': 'video/webm', - 'avi': 'video/x-msvideo', - 'mkv': 'video/x-matroska', - 'mpg': 'video/mpeg', - 'mpeg': 'video/mpeg', - 'flv': 'video/x-flv', - 'ogg': 'video/ogg' - } - - new_mediatype = ext_to_mediatype.get(target_format, f'video/{target_format}') - new_filename = f"{os.path.splitext(self.filename)[0]}.{target_format}" if hasattr(self, "filename") else f"video.{target_format}" - - # Extract metadata from new video - metadata = self.extract_video_metadata(temp_output.name) - - # Use add_video_data to replace current content (maintaining inline/external status) - if self.is_inline_data(): - encoded_data = base64.urlsafe_b64encode(new_video_data).decode() - self.add_inline_data(encoded_data, new_filename, new_mediatype) - - # Update metadata to include transcoding info - if not hasattr(self, "metadata"): - self.metadata = {} - if not hasattr(self, "meta"): - self.meta = {} - - self.metadata["video"] = metadata - self.metadata["video"]["transcoded"] = { - "original_format": self.get_video_format_from_mediatype(), - "target_format": target_format, - "codec": codec, - "bit_rate": bit_rate, - "width": width, - "height": height, - "timestamp": datetime.now().isoformat() - } - self.meta["video"] = self.metadata["video"] - - elif self.is_external_data(): - # For external data, we'd typically need to upload the file somewhere - # This is just a placeholder - in a real implementation you'd upload the file - # to an external storage service and update the URL - logger.warning("Transcoding external video data not fully implemented") - - except Exception as e: - logger.error(f"Error transcoding video: {str(e)}") - raise - - finally: - # Clean up temporary files - if temp_input and os.path.exists(temp_input.name): - os.unlink(temp_input.name) - if temp_output and os.path.exists(temp_output.name): - os.unlink(temp_output.name)
- -
[docs] def is_email(self) -> bool: - """ - Check if the dialog is an email dialog. - :return: True if the dialog is an email dialog, False otherwise - :rtype: bool - """ - return hasattr(self, "mediatype") and self.mediatype == "message/rfc822"
- -
[docs] def is_image(self) -> bool: - """ - Check if the dialog has image content. - - :return: True if the dialog has image content, False otherwise - :rtype: bool - """ - return hasattr(self, "mediatype") and self.mediatype in [ - "image/jpeg", - "image/tiff", - "application/pdf" - ]
- -
[docs] def is_pdf(self) -> bool: - """ - Check if the dialog has PDF content. - - :return: True if the dialog has PDF content, False otherwise - :rtype: bool - """ - return hasattr(self, "mediatype") and self.mediatype == "application/pdf"
- -
[docs] def add_image_data(self, image_path: str, mediatype: Optional[str] = None) -> None: - """ - Add image data to the dialog from a local file. - - :param image_path: Path to the image file - :type image_path: str - :param mediatype: MIME type of the image (optional, auto-detected if not provided) - :type mediatype: str or None - :return: None - :rtype: None - """ - import os - import mimetypes - - # Auto-detect mediatype if not provided - if not mediatype: - mediatype, _ = mimetypes.guess_type(image_path) - - if not mediatype or mediatype not in ["image/jpeg", "image/tiff", "application/pdf"]: - raise ValueError(f"Unsupported image format. Must be JPEG, TIFF, or PDF.") - - # Read image data - with open(image_path, 'rb') as f: - image_data = f.read() - - # Extract filename from path - filename = os.path.basename(image_path) - - # Add as inline data - self.body = base64.urlsafe_b64encode(image_data).decode('utf-8') - self.mediatype = mediatype - self.filename = filename - self.encoding = "base64url" - - # Calculate hash for integrity validation - self.content_hash = base64.urlsafe_b64encode( - hashlib.sha256(image_data).digest() - ).decode() - - # Extract metadata if possible - try: - self.extract_image_metadata(image_data, mediatype) - except Exception as e: - # Log the error but don't fail if metadata extraction fails - print(f"Warning: Could not extract image metadata: {str(e)}")
- -
[docs] def extract_image_metadata(self, image_data: bytes, mediatype: str) -> None: - """ - Extract metadata from image data and add it to the dialog metadata. - - :param image_data: Raw image data - :type image_data: bytes - :param mediatype: MIME type of the image - :type mediatype: str - :return: None - :rtype: None - """ - # Initialize metadata dict if it doesn't exist - if not hasattr(self, "metadata") or not self.metadata: - self.metadata = {} - - if "image" not in self.metadata: - self.metadata["image"] = {} - - if mediatype == "application/pdf": - # Extract PDF metadata - try: - import io - from pypdf import PdfReader - - pdf = PdfReader(io.BytesIO(image_data)) - self.metadata["image"]["pages"] = len(pdf.pages) - - if pdf.metadata: - for key, value in pdf.metadata.items(): - # Convert PDF metadata keys to standard format - clean_key = key.lower().replace('/', '_') - self.metadata["image"][clean_key] = str(value) - except ImportError: - # PyPDF not installed - self.metadata["image"]["note"] = "Install PyPDF for enhanced PDF metadata" - - elif mediatype in ["image/jpeg", "image/tiff"]: - # Extract image metadata - try: - import io - from PIL import Image, ExifTags - - img = Image.open(io.BytesIO(image_data)) - self.metadata["image"]["width"] = img.width - self.metadata["image"]["height"] = img.height - self.metadata["image"]["format"] = img.format - - # Extract EXIF data if available - if hasattr(img, '_getexif') and img._getexif(): - exif = { - ExifTags.TAGS.get(tag, tag): value - for tag, value in img._getexif().items() - if tag in ExifTags.TAGS - } - - # Add select EXIF data to metadata - for key in ['DateTimeOriginal', 'Make', 'Model', 'Orientation']: - if key in exif: - self.metadata["image"][key.lower()] = str(exif[key]) - except ImportError: - # PIL not installed - self.metadata["image"]["note"] = "Install Pillow for enhanced image metadata"
- -
[docs] def generate_thumbnail(self, max_size: Tuple[int, int] = (200, 200)) -> Optional[str]: - """ - Generate a thumbnail for the image and return it as a base64-encoded string. - - :param max_size: Maximum thumbnail dimensions (width, height) - :type max_size: Tuple[int, int] - :return: Base64-encoded thumbnail or None if generation fails - :rtype: str or None - """ - if not self.is_image(): - return None - - try: - import io - from PIL import Image - - # Get image data - if hasattr(self, "body") and self.body: - if self.encoding in ["base64url"]: - image_data = base64.urlsafe_b64decode(self.body) - else: - # If not base64 encoded, assume it's already raw data - image_data = self.body.encode() if isinstance(self.body, str) else self.body - else: - # For external data - if self.is_external_data(): - response = requests.get(self.url) - if response.status_code != 200: - return None - image_data = response.content - else: - return None - - # For PDFs, just return None as they require special handling - if self.mediatype == "application/pdf": - return None - - # Generate thumbnail - img = Image.open(io.BytesIO(image_data)) - img.thumbnail(max_size) - - # Save thumbnail to bytes - thumb_io = io.BytesIO() - img.save(thumb_io, format='JPEG') - thumb_data = thumb_io.getvalue() - - # Return base64-encoded thumbnail - return base64.b64encode(thumb_data).decode('utf-8') - except Exception as e: - print(f"Thumbnail generation failed: {str(e)}") - return None
- -
[docs] def is_external_data_changed(self) -> bool: - """ - Check to see if it's an external data dialog and verify the content hash. - - :return: True if the dialog is an external data dialog and the contents are valid, False otherwise - :rtype: bool - """ - if not self.is_external_data(): - return False - try: - if not hasattr(self, "content_hash"): - return True - response = requests.get(self.url) - if response.status_code != 200: - return True - calculated = base64.urlsafe_b64encode( - hashlib.sha256(response.content).digest() - ).decode() - return calculated != self.content_hash - except Exception as e: - print(e) - return True
- - # Convert the dialog from an external data dialog to an inline data dialog - # by reading the contents from the URL then adding the contents to the body -
[docs] def to_inline_data(self) -> None: - """ - Convert the dialog from an external data dialog to an inline data dialog - by reading the contents from the URL then adding the contents to the body. - - :return: None - :rtype: None - """ - # Read the contents from the URL - response = requests.get(self.url) - if response.status_code == 200: - # For binary content, use response.content instead of response.text - raw_content = response.content - # Base64url encode the body - self.body = base64.urlsafe_b64encode(raw_content).decode() - self.mediatype = response.headers.get("Content-Type") - else: - raise Exception(f"Failed to fetch external data: {response.status_code}") - - # Calculate the content hash of the original binary content - self.encoding = "base64url" - self.content_hash = base64.urlsafe_b64encode( - hashlib.sha256(raw_content).digest() - ).decode() - - # Set the filename if it doesn't exist - if not hasattr(self, "filename"): - self.filename = self.url.split("/")[-1] - - # Remove the url since this is now inline data - delattr(self, "url")
- -
[docs] def set_session_id(self, session_id: Union[Dict[str, str], List[Dict[str, str]]]) -> None: - """ - Set the session identifier for this dialog. - - :param session_id: The session identifier (SessionId or list of SessionId) - :type session_id: dict or list - :return: None - :rtype: None - """ - self.session_id = session_id
- -
[docs] def get_session_id(self) -> Optional[Union[Dict[str, str], List[Dict[str, str]]]]: - """ - Get the session identifier for this dialog. - - :return: The session identifier if set, None otherwise - :rtype: str or None - """ - return getattr(self, "session_id", None)
- -
[docs] def set_content_hash(self, content_hash: str) -> None: - """ - Set the content hash for externally referenced files. - - :param content_hash: The content hash value - :type content_hash: str - :return: None - :rtype: None - """ - self.content_hash = content_hash
- -
[docs] def get_content_hash(self) -> Optional[str]: - """ - Get the content hash for externally referenced files. - - :return: The content hash if set, None otherwise - :rtype: str or None - """ - return getattr(self, "content_hash", None)
- -
[docs] def calculate_content_hash(self, algorithm: str = "sha256") -> str: - """ - Calculate the content hash for the dialog body. - - :param algorithm: The hash algorithm to use (default: "sha256") - :type algorithm: str - :return: The calculated hash value - :rtype: str - """ - if not hasattr(self, "body") or not self.body: - raise ValueError("No body content available to hash") - - if algorithm == "sha256": - hash_obj = hashlib.sha256() - if isinstance(self.body, str): - hash_obj.update(self.body.encode()) - else: - hash_obj.update(self.body) - return base64.urlsafe_b64encode(hash_obj.digest()).decode() - else: - raise ValueError(f"Unsupported hash algorithm: {algorithm}")
- -
[docs] def verify_content_hash(self, expected_hash: str, algorithm: str = "sha256") -> bool: - """ - Verify the content hash against the expected value. - - :param expected_hash: The expected hash value - :type expected_hash: str - :param algorithm: The hash algorithm to use (default: "sha256") - :type algorithm: str - :return: True if the hash matches, False otherwise - :rtype: bool - """ - try: - calculated_hash = self.calculate_content_hash(algorithm) - return calculated_hash == expected_hash - except ValueError: - return False
-
- -
-
-
- -
- -
-

© Copyright 2024, Thomas McCarthy-Howe.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/docs/_modules/vcon/party.html b/docs/_modules/vcon/party.html deleted file mode 100644 index e6cc2c8..0000000 --- a/docs/_modules/vcon/party.html +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - vcon.party — vcon 0.7.0 documentation - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for vcon.party

-from typing import Optional
-from vcon.civic_address import CivicAddress
-from datetime import datetime
-
-
-
[docs]class Party: - """ - A class representing a party (participant) in a vCon conversation. - - A party represents a participant in the conversation with various contact - and identification information. Parties can be callers, agents, or any - other participants in the conversation. - - Supported contact methods: - - tel: Telephone number - - mailto: Email address - - sip: SIP URI for VoIP communication - - did: Decentralized Identifier for blockchain-based identity - - Contact information: - - name: Display name of the party - - jCard: vCard format contact information (RFC 7095) - - timezone: Party's timezone for temporal context - - Location and validation: - - civicaddress: Civic address information (GEOPRIV format) - - gmlpos: GML position coordinates - - validation: Validation information for the party - - Additional metadata: - - uuid: Unique identifier for the party - - role: Role in the conversation (e.g., "caller", "agent") - - stir: STIR identifier for secure telephony - - contact_list: Reference to contact list - - meta: Additional metadata - - New in vCon 0.4.0: - - sip: SIP URI for the party - - did: Decentralized Identifier - - jCard: vCard format contact information - - timezone: Party's timezone - """ -
[docs] def __init__( - self, - tel: Optional[str] = None, - stir: Optional[str] = None, - mailto: Optional[str] = None, - name: Optional[str] = None, - validation: Optional[str] = None, - gmlpos: Optional[str] = None, - civicaddress: Optional[CivicAddress] = None, - uuid: Optional[str] = None, - role: Optional[str] = None, - contact_list: Optional[str] = None, - meta: Optional[dict] = None, - sip: Optional[str] = None, - did: Optional[str] = None, - jCard: Optional[dict] = None, - timezone: Optional[str] = None, - **kwargs - ) -> None: - """ - Initialize a new Party object. - - :param tel: Telephone number of the party - :type tel: str | None - :param stir: STIR identifier of the party - :type stir: str | None - :param mailto: Email address of the party - :type mailto: str | None - :param name: Display name of the party - :type name: str | None - :param validation: Validation information of the party - :type validation: str | None - :param gmlpos: GML position of the party - :type gmlpos: str | None - :param civicaddress: Civic address of the party - :type civicaddress: CivicAddress | None - :param uuid: UUID of the party - :type uuid: str | None - :param role: Role of the party - :type role: str | None - :param contact_list: Contact list of the party - :type contact_list: str | None - :param sip: SIP URI for the party - :type sip: str | None - :param did: Decentralized Identifier - :type did: str | None - :param jCard: vCard format contact information - :type jCard: dict | None - :param timezone: Party's timezone - :type timezone: str | None - :param kwargs: Additional attributes to be set on the party - """ - # copy the named parameters that are not None - for key, value in locals().items(): - if value is not None and key not in ("self", "kwargs"): - setattr(self, key, value) - - # copy any additional kwargs - for key, value in kwargs.items(): - if value is not None: - setattr(self, key, value)
- -
[docs] def to_dict(self): - # copy the attributes that are not None - # TODO: should we allow changing the values of the object? - # for now, we just use the values that are not None - # and ignore the other values - # (this is also how the old code worked) - party_dict = {} - for key, value in self.__dict__.items(): - # Don't include self in the dict - if value is not None and key != "self": - # Handle CivicAddress objects by calling their to_dict method - if hasattr(value, 'to_dict') and callable(value.to_dict): - party_dict[key] = value.to_dict() - else: - party_dict[key] = value - return party_dict
- - -
[docs]class PartyHistory: - """ - A class representing party history events in a vCon dialog. - - Party history tracks when parties join, leave, or change state during - a conversation. This is useful for understanding the flow of multi-party - conversations where participants may not all join and leave at the same time. - - Supported event types (vCon 0.4.0 specification): - - join: When the party joins the dialog - - drop: When the party drops out of the dialog - - hold: When the party is put on hold - - unhold: When the party is taken off hold - - mute: When the party is muted - - unmute: When the party is taken off mute - - Attributes: - party (int): Index of the party in the parties array - event (str): Type of event (must be one of VALID_EVENTS) - time (datetime): Time when the event occurred (serialized as ISO 8601) - - The time field is automatically serialized to ISO 8601 format when - converted to dictionary representation. - """ - # Valid event types for party history (from specification) - VALID_EVENTS = [ - "join", # when the party joins the dialog - "drop", # when the party drops out of the dialog - "hold", # when the party is put on hold - "unhold", # when the party is taken off hold - "mute", # when the party is muted - "unmute" # when the party is taken off mute - ] - -
[docs] def __init__(self, party: int, event: str, time: datetime): - """ - Initialize a new PartyHistory object. - - :param party: Index of the party - :type party: int - :param event: Event type (e.g. "join", "drop", "hold", "unhold", - "mute", "unmute") - :type event: str - :param time: Time of the event - :type time: datetime - """ - # Validate event type - if event not in PartyHistory.VALID_EVENTS: - raise ValueError( - f"Invalid event '{event}'. " - f"Must be one of: {PartyHistory.VALID_EVENTS}" - ) - - self.party = party - self.event = event - self.time = time
- -
[docs] def to_dict(self): - # Handle time field which can be datetime or string - if hasattr(self.time, 'isoformat'): - time_value = self.time.isoformat() - else: - time_value = self.time - return { - "party": self.party, - "event": self.event, - "time": time_value - }
-
- -
-
-
- -
- -
-

© Copyright 2024, Thomas McCarthy-Howe.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/docs/_modules/vcon/vcon.html b/docs/_modules/vcon/vcon.html deleted file mode 100644 index 4c3da36..0000000 --- a/docs/_modules/vcon/vcon.html +++ /dev/null @@ -1,2166 +0,0 @@ - - - - - - - - vcon.vcon — vcon 0.7.0 documentation - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -

Source code for vcon.vcon

-from __future__ import annotations
-
-import copy
-from dateutil import parser
-import json
-from typing import Optional, List, Dict, Union, Any, Tuple
-import hashlib
-import time
-import uuid6
-from datetime import datetime
-from datetime import timezone
-from pydash import get as _get
-import base64
-from authlib.jose import JsonWebSignature
-from authlib.jose.errors import BadSignatureError
-from cryptography.hazmat.primitives.asymmetric import rsa
-from cryptography.hazmat.primitives import serialization
-import requests
-import logging
-from .party import Party
-from .dialog import Dialog
-
-# Set up logger
-logger = logging.getLogger(__name__)
-
-# Import extension framework
-try:
-    from .extensions.registry import get_extension_registry
-    from .extensions.base import ValidationResult
-    EXTENSIONS_AVAILABLE = True
-except ImportError:
-    EXTENSIONS_AVAILABLE = False
-    logger.warning("Extensions not available - install required dependencies")
-
-# Define constants for property handling modes
-PROPERTY_HANDLING_DEFAULT = "default"  # Keep non-standard properties
-PROPERTY_HANDLING_STRICT = "strict"    # Remove non-standard properties
-PROPERTY_HANDLING_META = "meta"        # Move non-standard properties to meta
-
-# Define allowed properties for each object type
-_ALLOWED_VCON_PROPERTIES = {
-    "uuid", "vcon", "created_at", "updated_at", "redacted",
-    "group", "parties", "dialog", "attachments", "analysis",
-    "signatures", "payload", "meta", "subject", "amended",
-    "extensions", "critical"
-}
-
-_ALLOWED_PARTY_PROPERTIES = {
-    "type", "name", "contact", "meta", "external_id", "party_id",
-    "tel", "stir", "mailto", "validation", "gmlpos", "civicaddress",
-    "uuid", "role", "contact_list", "sip", "did", "jCard", "timezone"
-}
-
-_ALLOWED_DIALOG_PROPERTIES = {
-    "type", "start", "parties", "duration", "mediatype", "filename",
-    "body", "encoding", "url", "content_hash", "disposition",
-    "party_history", "transferee", "transferor", "transfer_target",
-    "original", "consultation", "target_dialog", "campaign",
-    "interaction", "skill", "meta", "metadata", "transfer",
-    "signaling", "originator", "resolution", "frame_rate",
-    "codec", "bitrate", "thumbnail", "streaming", "video",
-    "session_id", "application", "message_id"
-}
-
-_ALLOWED_ATTACHMENT_PROPERTIES = {
-    "purpose", "body", "encoding", "start", "party", "dialog",
-    "mediatype", "filename", "url", "content_hash"
-}
-
-_ALLOWED_ANALYSIS_PROPERTIES = {
-    "type", "dialog", "vendor", "product", "body", "encoding",
-    "schema", "mediatype", "filename", "url", "content_hash"
-}
-
-# Configure logging
-logger = logging.getLogger(__name__)
-
-_LAST_V8_TIMESTAMP = None
-
-
-
[docs]class Attachment: - """ - A class representing an attachment in a vCon. - - An attachment consists of a purpose, body content, and an encoding format. - The encoding format must be one of the supported formats: base64url, json, or none. - - Attributes: - purpose (str): The purpose of the attachment - body (Any): The content of the attachment - encoding (str): The encoding format used for the body - """ - - VALID_ENCODINGS = ["base64url", "json", "none"] - -
[docs] def __init__( - self, - purpose: str, - body: Any = None, - encoding: str = "none", - mediatype: Optional[str] = None, - filename: Optional[str] = None, - url: Optional[str] = None, - content_hash: Optional[str] = None, - start: Optional[str] = None, - party: Optional[int] = None, - dialog: Optional[int] = None, - ) -> None: - """ - Initialize an Attachment object. - - Args: - purpose: The purpose of the attachment - body: The content of the attachment - encoding: The encoding format used for the body (default: "none") - - Raises: - ValueError: If the specified encoding is not supported - """ - if encoding not in self.VALID_ENCODINGS: - logger.error(f"Invalid encoding attempted: {encoding}") - raise ValueError(f"Invalid encoding: {encoding}. Must be one of {self.VALID_ENCODINGS}") - self.purpose = purpose - self.body = body - self.encoding = encoding - self.mediatype = mediatype - self.filename = filename - self.url = url - self.content_hash = content_hash - self.start = start - self.party = party - self.dialog = dialog - logger.debug(f"Created new attachment of purpose {purpose} with {encoding} encoding")
- -
[docs] def to_dict(self) -> Dict[str, Any]: - """ - Convert the attachment to a dictionary representation. - - Returns: - Dict containing the attachment's purpose, body, and encoding - """ - attachment_dict = { - "purpose": self.purpose, - "body": self.body, - "encoding": self.encoding, - "mediatype": self.mediatype, - "filename": self.filename, - "url": self.url, - "content_hash": self.content_hash, - "start": self.start, - "party": self.party, - "dialog": self.dialog, - } - return {k: v for k, v in attachment_dict.items() if v is not None}
- -
[docs] @classmethod - def from_image(cls, image_path: str, purpose: str = "image") -> 'Attachment': - """ - Create an Attachment from an image file. - - Args: - image_path: Path to the image file - type: The type of the attachment (default: "image") - - Returns: - An Attachment object containing the image - - Raises: - ValueError: If the image format is not supported - FileNotFoundError: If the image file cannot be found - """ - import os - import mimetypes - - # Check if file exists - if not os.path.exists(image_path): - raise FileNotFoundError(f"Image file not found: {image_path}") - - # Detect mimetype - mimetype, _ = mimetypes.guess_type(image_path) - if not mimetype or mimetype not in ["image/jpeg", "image/tiff", "application/pdf"]: - raise ValueError(f"Unsupported image format: {mimetype}. Must be JPEG, TIFF, or PDF.") - - # Read image data - with open(image_path, 'rb') as f: - image_data = f.read() - - filename = os.path.basename(image_path) - # Create and return attachment - return cls( - purpose=purpose, - body=base64.urlsafe_b64encode(image_data).decode('utf-8'), - encoding="base64url", - mediatype=mimetype, - filename=filename, - )
- - -
[docs]class Vcon: - """ - A class representing a vCon (Virtual Conversation) object according to the vCon specification. - - A vCon is a standardized format for representing conversations and related metadata. - It includes information about participants (parties), dialog content, attachments, - and analysis data. - - The vCon format supports features such as: - - Unique identification via UUID - - Optional versioning (version field is optional) - - Timestamps for creation and updates - - Party information with contact details (tel, name, sip, did, jCard, timezone) - - Dialog content with media types and session information - - Attachments for ancillary documents - - Analysis data for conversation insights - - Digital signatures and encryption - - Extensions and critical for extensibility - - Civic address information for location data - - Party history for tracking join/drop/hold/mute events - - New in vCon 0.4.0: - - Extensions field for listing used extensions - - Critical field for incompatible extensions - - Enhanced party fields (sip, did, jCard, timezone) - - Dialog session_id and content_hash fields - - Party history with event tracking - - Updated media type validation - - New disposition values for incomplete dialogs - - Attributes: - vcon_dict (Dict): The underlying dictionary containing all vCon data - property_handling (str): How non-standard properties are handled - """ - -
[docs] def __init__( - self, - vcon_dict: Dict[str, Any] = None, - property_handling: str = PROPERTY_HANDLING_DEFAULT, - ) -> None: - """ - Initialize a Vcon object from a dictionary. - - Args: - vcon_dict: A dictionary representing a vCon. Defaults to an empty dict. - property_handling: How to handle non-standard properties. - Options are: - - "default": Keep non-standard properties (default) - - "strict": Remove non-standard properties - - "meta": Move non-standard properties to meta object - - Example: - >>> vcon = Vcon({"uuid": "123", "custom_field": "value"}) - >>> strict_vcon = Vcon({"uuid": "123", "custom_field": "value"}, property_handling="strict") - >>> meta_vcon = Vcon({"uuid": "123", "custom_field": "value"}, property_handling="meta") - """ - logger.debug("Initializing new Vcon object") - - # Store property handling mode for later use - self.property_handling = property_handling - - # Initialize with empty dict if none provided - if vcon_dict is None: - vcon_dict = {} - - # Version field is now optional - no version management required - - # Handle created_at - if vcon_dict.get("created_at"): - if isinstance(vcon_dict["created_at"], datetime): - vcon_dict["created_at"] = vcon_dict["created_at"].isoformat() - logger.debug("Converted datetime created_at to ISO format") - elif isinstance(vcon_dict["created_at"], str): - vcon_dict["created_at"] = parser.parse( - vcon_dict["created_at"] - ).isoformat() - logger.debug("Parsed string created_at to ISO format") - else: - vcon_dict["created_at"] = datetime.now(timezone.utc).isoformat() - logger.debug("Set default created_at timestamp") - - # Ensure attachments array exists - if "attachments" not in vcon_dict: - vcon_dict["attachments"] = [] - logger.debug("Initialized empty attachments array") - - # Process the vcon itself for non-standard properties - processed_vcon = self._process_properties(vcon_dict, _ALLOWED_VCON_PROPERTIES) - - # Process embedded objects based on property_handling - if "parties" in processed_vcon: - processed_vcon["parties"] = [ - self._process_properties(party, _ALLOWED_PARTY_PROPERTIES) - for party in processed_vcon["parties"] - ] - - if "dialog" in processed_vcon: - processed_vcon["dialog"] = [ - self._process_properties(dialog, _ALLOWED_DIALOG_PROPERTIES) - for dialog in processed_vcon["dialog"] - ] - - if "attachments" in processed_vcon: - processed_vcon["attachments"] = [ - self._process_properties(attachment, _ALLOWED_ATTACHMENT_PROPERTIES) - for attachment in processed_vcon["attachments"] - ] - - if "analysis" in processed_vcon: - processed_vcon["analysis"] = [ - self._process_properties(analysis, _ALLOWED_ANALYSIS_PROPERTIES) - for analysis in processed_vcon["analysis"] - ] - - self.vcon_dict = json.loads(json.dumps(processed_vcon)) - logger.info(f"Vcon object initialized with UUID: {processed_vcon.get('uuid', 'not set')}")
- -
[docs] def set_created_at(self, created_at: Union[str, datetime]) -> None: - """ - Set the created_at field in the vCon. - - Args: - created_at (Union[str, datetime]): The timestamp to set, either as a string in ISO format - or as a datetime object. - """ - if isinstance(created_at, datetime): - self.vcon_dict["created_at"] = created_at.isoformat() - else: - self.vcon_dict["created_at"] = created_at
- -
[docs] def set_updated_at(self, timestamp: Union[str, datetime]) -> None: - """ - Set the updated_at timestamp. - - Args: - timestamp: The timestamp to set, either as ISO 8601 string or datetime object - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.set_updated_at(datetime.now(timezone.utc)) - >>> vcon.set_updated_at("2025-02-18T12:00:00Z") - """ - if isinstance(timestamp, datetime): - self.vcon_dict["updated_at"] = timestamp.isoformat() - elif isinstance(timestamp, str): - # Validate the timestamp format - parser.parse(timestamp) # This will raise ValueError if invalid - self.vcon_dict["updated_at"] = timestamp - else: - raise ValueError("Timestamp must be either a datetime object or ISO 8601 string")
- - def _process_properties(self, obj_dict: Dict[str, Any], allowed_properties: set) -> Dict[str, Any]: - """ - Process an object dictionary based on the property handling mode. - - Args: - obj_dict: The dictionary to process - allowed_properties: Set of allowed property names - - Returns: - The processed dictionary - """ - if not isinstance(obj_dict, dict): - return obj_dict - - result = {} - non_standard = {} - - # Separate standard and non-standard properties - for k, v in obj_dict.items(): - if k in allowed_properties: - result[k] = v - else: - non_standard[k] = v - - # Handle non-standard properties based on mode - if self.property_handling == PROPERTY_HANDLING_STRICT: - # Ignore non-standard properties - pass - elif self.property_handling == PROPERTY_HANDLING_META: - # Move non-standard properties to meta - if non_standard: - result.setdefault("meta", {}).update(non_standard) - else: # Default: Keep non-standard properties - result.update(non_standard) - - return result - -
[docs] @classmethod - def build_from_json( - cls, - json_string: str, - property_handling: str = PROPERTY_HANDLING_DEFAULT, - ) -> "Vcon": - """ - Initialize a Vcon object from a JSON string. - - This method parses a JSON string representation of a vCon and creates - a new Vcon object from it. - - Args: - json_string: A JSON string representing a vCon - property_handling: How to handle non-standard properties. - - Returns: - A new Vcon object initialized with the parsed JSON data - - Raises: - json.JSONDecodeError: If the JSON string is invalid - - Example: - >>> json_str = '{"uuid": "123"}' - >>> vcon = Vcon.build_from_json(json_str) - """ - logger.debug("Building Vcon from JSON string") - try: - vcon_dict = json.loads(json_string) - logger.info("Successfully parsed JSON string") - return cls( - vcon_dict, - property_handling=property_handling, - ) - except json.JSONDecodeError as e: - logger.error(f"Failed to parse JSON string: {str(e)}") - raise
- -
[docs] @classmethod - def build_new( - cls, - created_at: Union[str, datetime] = None, - property_handling: str = PROPERTY_HANDLING_DEFAULT, - ) -> "Vcon": - """ - Initialize a new Vcon object with default values. - - This method creates a new vCon with a generated UUID and initialized - with empty arrays for groups, parties, dialog, attachments, and analysis. - - Args: - created_at (Union[str, datetime], optional): The timestamp to set for creation, - either as a string in ISO format - or as a datetime object. - Defaults to current time. - property_handling: How to handle non-standard properties. - - Returns: - A new Vcon object with default values - - Example: - >>> vcon = Vcon.build_new() - >>> print(vcon.uuid) # Prints a new UUID8 - """ - logger.debug("Building new Vcon with default values") - uuid = cls.uuid8_domain_name("strolid.com") - logger.debug(f"Generated UUID8: {uuid}") - - vcon_dict = { - "uuid": uuid, - "redacted": {}, - "group": [], - "parties": [], - "dialog": [], - "attachments": [], - "analysis": [], - } - - # Create the Vcon object - vcon = cls( - vcon_dict, - property_handling=property_handling, - ) - - # Set created_at if provided, otherwise it will use the default from __init__ - if created_at is not None: - vcon.set_created_at(created_at) - logger.info("Created new Vcon with default structure") - return vcon
- - @property - def tags(self) -> Optional[Dict[str, Any]]: - """ - Get the tags attachment from the vCon. - - Returns: - The tags attachment dictionary if it exists, None otherwise - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_tag("category", "meeting") - >>> tags = vcon.tags - >>> print(tags["body"]) # Prints ["category:meeting"] - """ - logger.debug("Retrieving tags attachment") - tags = self.find_attachment_by_purpose("tags") - if tags: - logger.debug("Found tags attachment") - else: - logger.debug("No tags attachment found") - return tags - -
[docs] def get_tag(self, tag_name: str) -> Optional[str]: - """ - Get the value of a specific tag by name. - - Args: - tag_name: The name of the tag to retrieve - - Returns: - The value of the tag if found, None otherwise - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_tag("category", "meeting") - >>> value = vcon.get_tag("category") - >>> print(value) # Prints "meeting" - """ - logger.debug(f"Retrieving value for tag: {tag_name}") - tags_attachment = self.find_attachment_by_purpose("tags") - if not tags_attachment: - logger.debug("No tags attachment found") - return None - - tag = next( - (t for t in tags_attachment["body"] if t.startswith(f"{tag_name}:")), None - ) - if not tag: - logger.debug(f"Tag {tag_name} not found") - return None - - tag_value = tag.split(":")[1] - logger.debug(f"Found value for tag {tag_name}: {tag_value}") - return tag_value
- -
[docs] def add_tag(self, tag_name: str, tag_value: str) -> None: - """ - Add a tag to the vCon. - - This method adds a tag with the specified name and value to the vCon's tags - attachment. If no tags attachment exists, it creates one. - - Args: - tag_name: The name of the tag - tag_value: The value to associate with the tag - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_tag("category", "meeting") - >>> vcon.add_tag("priority", "high") - """ - logger.debug(f"Adding tag {tag_name}:{tag_value}") - tags_attachment = self.find_attachment_by_purpose("tags") - if not tags_attachment: - logger.debug("Creating new tags attachment") - tags_attachment = { - "purpose": "tags", - "body": [], - "encoding": "json", - } - self.vcon_dict["attachments"].append(tags_attachment) - tags_attachment["body"].append(f"{tag_name}:{tag_value}") - logger.info(f"Added tag {tag_name}:{tag_value}")
- -
[docs] def get_extensions(self) -> List[str]: - """ - Get the list of extensions used in this vCon. - - Returns: - List of extension names, empty list if none are defined - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_extension("video") - >>> extensions = vcon.get_extensions() - >>> print(extensions) # Prints ["video"] - """ - return self.vcon_dict.get("extensions", [])
- -
[docs] def add_extension(self, extension: str) -> None: - """ - Add an extension to the vCon. - - Args: - extension: The name of the extension to add - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_extension("video") - >>> vcon.add_extension("encryption") - """ - if "extensions" not in self.vcon_dict: - self.vcon_dict["extensions"] = [] - - if extension not in self.vcon_dict["extensions"]: - self.vcon_dict["extensions"].append(extension) - logger.info(f"Added extension: {extension}")
- -
[docs] def remove_extension(self, extension: str) -> None: - """ - Remove an extension from the vCon. - - Args: - extension: The name of the extension to remove - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_extension("video") - >>> vcon.remove_extension("video") - """ - if "extensions" in self.vcon_dict and extension in self.vcon_dict["extensions"]: - self.vcon_dict["extensions"].remove(extension) - logger.info(f"Removed extension: {extension}")
- -
[docs] def get_critical(self) -> List[str]: - """ - Get the list of critical extensions that must be supported. - - Returns: - List of extension names that must be supported, empty list if none are defined - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_critical("encryption") - >>> critical = vcon.get_critical() - >>> print(critical) # Prints ["encryption"] - """ - return self.vcon_dict.get("critical", [])
- -
[docs] def add_critical(self, extension: str) -> None: - """ - Add an extension to the critical list. - - Args: - extension: The name of the extension that must be supported - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_critical("encryption") - >>> vcon.add_critical("video") - """ - if "critical" not in self.vcon_dict: - self.vcon_dict["critical"] = [] - - if extension not in self.vcon_dict["critical"]: - self.vcon_dict["critical"].append(extension) - logger.info(f"Added critical extension: {extension}")
- -
[docs] def remove_critical(self, extension: str) -> None: - """ - Remove an extension from the critical list. - - Args: - extension: The name of the extension to remove from critical - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_critical("encryption") - >>> vcon.remove_critical("encryption") - """ - if "critical" in self.vcon_dict and extension in self.vcon_dict["critical"]: - self.vcon_dict["critical"].remove(extension) - logger.info(f"Removed critical extension: {extension}")
- - # Extension-specific methods -
[docs] def add_lawful_basis_attachment( - self, - lawful_basis: str, - expiration: str, - purpose_grants: list, - party_index: Optional[int] = None, - dialog_index: Optional[int] = None, - **kwargs - ) -> None: - """ - Add a lawful basis attachment to the vCon. - - Args: - lawful_basis: The lawful basis type (consent, contract, etc.) - expiration: ISO 8601 timestamp when the lawful basis expires - purpose_grants: List of purpose grant dictionaries - party_index: Index of the party this applies to (optional) - dialog_index: Index of the dialog this applies to (optional) - **kwargs: Additional lawful basis parameters - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_lawful_basis_attachment( - ... lawful_basis="consent", - ... expiration="2026-01-01T00:00:00Z", - ... purpose_grants=[ - ... {"purpose": "recording", "granted": True, "granted_at": "2025-01-01T00:00:00Z"} - ... ] - ... ) - """ - if not EXTENSIONS_AVAILABLE: - raise RuntimeError("Extensions not available") - - try: - from .extensions.lawful_basis import LawfulBasisExtension - extension = LawfulBasisExtension() - attachment = extension.create_lawful_basis_attachment( - lawful_basis=lawful_basis, - expiration=expiration, - purpose_grants=purpose_grants, - **kwargs - ) - - # Add party and dialog references if provided - if party_index is not None: - attachment["party"] = party_index - if dialog_index is not None: - attachment["dialog"] = dialog_index - - self.vcon_dict["attachments"].append(attachment) - - # Add extension to extensions list if not already present - if "lawful_basis" not in self.get_extensions(): - self.add_extension("lawful_basis") - - logger.info("Added lawful basis attachment") - - except ImportError: - raise RuntimeError("Lawful basis extension not available")
- -
[docs] def add_wtf_transcription_attachment( - self, - transcript: Dict[str, Any], - segments: List[Dict[str, Any]], - metadata: Dict[str, Any], - party_index: Optional[int] = None, - dialog_index: Optional[int] = None, - **kwargs - ) -> None: - """ - Add a WTF transcription attachment to the vCon. - - Args: - transcript: Transcript information dictionary - segments: List of segment dictionaries - metadata: Metadata dictionary - party_index: Index of the party this applies to (optional) - dialog_index: Index of the dialog this applies to (optional) - **kwargs: Additional WTF parameters - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_wtf_transcription_attachment( - ... transcript={"text": "Hello world", "language": "en", "duration": 2.0, "confidence": 0.95}, - ... segments=[{"id": 0, "start": 0.0, "end": 2.0, "text": "Hello world", "confidence": 0.95}], - ... metadata={"created_at": "2025-01-01T00:00:00Z", "processed_at": "2025-01-01T00:00:01Z", - ... "provider": "whisper", "model": "whisper-1"} - ... ) - """ - if not EXTENSIONS_AVAILABLE: - raise RuntimeError("Extensions not available") - - try: - from .extensions.wtf import WTFExtension - extension = WTFExtension() - attachment = extension.create_wtf_attachment( - transcript=transcript, - segments=segments, - metadata=metadata, - **kwargs - ) - - # Add party and dialog references if provided - if party_index is not None: - attachment["party"] = party_index - if dialog_index is not None: - attachment["dialog"] = dialog_index - - self.vcon_dict["attachments"].append(attachment) - - # Add extension to extensions list if not already present - if "wtf_transcription" not in self.get_extensions(): - self.add_extension("wtf_transcription") - - logger.info("Added WTF transcription attachment") - - except ImportError: - raise RuntimeError("WTF extension not available")
- -
[docs] def find_lawful_basis_attachments(self, party_index: Optional[int] = None) -> List[Dict[str, Any]]: - """ - Find lawful basis attachments in the vCon. - - Args: - party_index: Filter by party index (optional) - - Returns: - List of lawful basis attachment dictionaries - """ - attachments = [] - for attachment in self.vcon_dict.get("attachments", []): - if attachment.get("purpose") == "lawful_basis": - if party_index is None or attachment.get("party") == party_index: - attachments.append(attachment) - return attachments
- -
[docs] def find_wtf_attachments(self, party_index: Optional[int] = None) -> List[Dict[str, Any]]: - """ - Find WTF transcription attachments in the vCon. - - Args: - party_index: Filter by party index (optional) - - Returns: - List of WTF attachment dictionaries - """ - attachments = [] - for attachment in self.vcon_dict.get("attachments", []): - if attachment.get("purpose") == "wtf_transcription": - if party_index is None or attachment.get("party") == party_index: - attachments.append(attachment) - return attachments
- -
[docs] def check_lawful_basis_permission( - self, - purpose: str, - party_index: Optional[int] = None - ) -> bool: - """ - Check if permission is granted for a specific purpose. - - Args: - purpose: The purpose to check permission for - party_index: Index of the party to check (optional) - - Returns: - True if permission is granted, False otherwise - """ - if not EXTENSIONS_AVAILABLE: - return False - - try: - from .extensions.lawful_basis import LawfulBasisExtension - extension = LawfulBasisExtension() - return extension.check_permission(self.vcon_dict, purpose, party_index) - except ImportError: - return False
- -
[docs] def validate_extensions(self) -> Dict[str, Any]: - """ - Validate all extensions in the vCon. - - Returns: - Dictionary with validation results for each extension - """ - if not EXTENSIONS_AVAILABLE: - return {"error": "Extensions not available"} - - try: - registry = get_extension_registry() - results = {} - - # Validate each extension - for extension_name in self.get_extensions(): - result = registry.validate_extension(extension_name, self.vcon_dict) - results[extension_name] = { - "is_valid": result.is_valid, - "errors": result.errors, - "warnings": result.warnings - } - - # Validate all attachments - attachment_results = [] - for attachment in self.vcon_dict.get("attachments", []): - result = registry.validate_attachment(attachment) - attachment_results.append({ - "purpose": attachment.get("purpose"), - "is_valid": result.is_valid, - "errors": result.errors, - "warnings": result.warnings - }) - - results["attachments"] = attachment_results - - return results - - except Exception as e: - logger.error(f"Error validating extensions: {str(e)}") - return {"error": str(e)}
- -
[docs] def process_extensions(self) -> Dict[str, Any]: - """ - Process all extensions in the vCon. - - Returns: - Dictionary with processing results for each extension - """ - if not EXTENSIONS_AVAILABLE: - return {"error": "Extensions not available"} - - try: - registry = get_extension_registry() - return registry.process_extensions(self.vcon_dict) - except Exception as e: - logger.error(f"Error processing extensions: {str(e)}") - return {"error": str(e)}
- -
[docs] def find_attachment_by_purpose(self, purpose: str) -> Optional[Dict[str, Any]]: - """ - Find an attachment in the vCon by its purpose. - - This method searches through the vCon's attachments and returns the first - attachment matching the specified type. - - Args: - purpose: The purpose of attachment to find - - Returns: - The matching attachment dictionary if found, None otherwise - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_attachment("metadata", {"version": "1.0"}) - >>> metadata = vcon.find_attachment_by_purpose("metadata") - """ - logger.debug(f"Searching for attachment of purpose: {purpose}") - attachment = next( - (a for a in self.vcon_dict["attachments"] if a["purpose"] == purpose), None - ) - if attachment: - logger.debug(f"Found attachment of purpose: {purpose}") - else: - logger.debug(f"No attachment found of purpose: {purpose}") - return attachment
- -
[docs] def add_attachment( - self, - purpose: str, - body: Any = None, - encoding: str = "none", - mediatype: Optional[str] = None, - filename: Optional[str] = None, - url: Optional[str] = None, - content_hash: Optional[str] = None, - start: Optional[str] = None, - party: Optional[int] = None, - dialog: Optional[int] = None, - ) -> Attachment: - """ - Add an attachment to the vCon. - - This method creates a new attachment with the specified type, body, and encoding - and adds it to the vCon's attachments list. - - Args: - purpose: The purpose of the attachment - body: The content of the attachment - encoding: The encoding format for the body (default: "none") - mediatype: Optional media type of the attachment - filename: Optional file name of the attachment - url: Optional URL for external attachments - content_hash: Optional content hash for external attachments - start: Optional timestamp for the attachment - party: Optional party index - dialog: Optional dialog index - - Returns: - The created Attachment object - - Raises: - ValueError: If the specified encoding is not supported - - Example: - >>> vcon = Vcon.build_new() - >>> attachment = vcon.add_attachment("metadata", {"version": "1.0"}, "json") - >>> print(attachment.purpose) # Prints "metadata" - """ - logger.debug(f"Creating new attachment of purpose {purpose} with {encoding} encoding") - - attachment = Attachment( - purpose=purpose, - body=body, - encoding=encoding, - mediatype=mediatype, - filename=filename, - url=url, - content_hash=content_hash, - start=start, - party=party, - dialog=dialog, - ) - attachment_dict = attachment.to_dict() - - # Process attachment dict according to property handling mode - processed_attachment = self._process_properties(attachment_dict, _ALLOWED_ATTACHMENT_PROPERTIES) - - self.vcon_dict["attachments"].append(processed_attachment) - - logger.info(f"Added new attachment of purpose {purpose}") - return attachment
- -
[docs] def add_image(self, image_path: str, purpose: str = "image") -> Attachment: - """ - Add an image attachment to the vCon. - - This method creates a new attachment with the specified image - and adds it to the vCon's attachments list. - - Args: - image_path: Path to the image file - purpose: The purpose of the attachment (default: "image") - - Returns: - The created Attachment object - - Raises: - FileNotFoundError: If the image file cannot be found - ValueError: If the image format is not supported - - Example: - >>> vcon = Vcon.build_new() - >>> attachment = vcon.add_image("document.pdf", "identification") - >>> print(attachment.mediatype) # Prints "application/pdf" - """ - attachment = Attachment.from_image(image_path, purpose) - self.vcon_dict["attachments"].append(attachment.to_dict()) - logger.info(f"Added new image attachment of purpose {purpose}") - return attachment
- -
[docs] def find_analysis_by_type(self, type: str) -> Optional[Dict[str, Any]]: - """ - Find an analysis entry in the vCon by its type. - - This method searches through the vCon's analysis entries and returns the first - one matching the specified type. - - Args: - type: The type of analysis to find - - Returns: - The matching analysis dictionary if found, None otherwise - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_analysis(type="sentiment", dialog=[0], vendor="acme", body={"score": 0.8}) - >>> sentiment = vcon.find_analysis_by_type("sentiment") - """ - logger.debug(f"Searching for analysis of type: {type}") - analysis = next( - (a for a in self.vcon_dict["analysis"] if a["type"] == type), None - ) - if analysis: - logger.debug(f"Found analysis of type: {type}") - else: - logger.debug(f"No analysis found of type: {type}") - return analysis
- -
[docs] def add_analysis( - self, - *, - type: str, - dialog: Union[List[int], int], - vendor: str, - body: Union[Dict[str, Any], List[Any], str], - encoding: str = "none", - mediatype: Optional[str] = None, - filename: Optional[str] = None, - product: Optional[str] = None, - url: Optional[str] = None, - content_hash: Optional[str] = None, - schema: Optional[Dict[str, Any]] = None, - meta: Optional[Dict[str, Any]] = None, - **extra, - ) -> None: - """ - Add analysis data to the vCon. - - This method adds analysis data with the specified parameters to the vCon's - analysis list. Analysis data can be associated with one or more dialog entries - and includes metadata about the vendor who performed the analysis. - - Args: - type: The type of analysis - dialog: Index or list of indices of the associated dialog entries - vendor: The name of the vendor who performed the analysis - body: The analysis data - encoding: The encoding format of the body (default: "none") - mediatype: Optional media type of the analysis content - filename: Optional filename for the analysis content - product: Optional product name of the vendor - url: Optional URL for external analysis content - content_hash: Optional content hash for external analysis content - schema: Optional schema information about the analysis (default: None) - meta: Optional metadata about the analysis (default: None) - **extra: Additional key-value pairs to include in the analysis - - Raises: - Exception: If the encoding is invalid or if the body format is invalid for the specified encoding - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_analysis( - ... type="sentiment", - ... dialog=[0], - ... vendor="acme", - ... body={"score": 0.8}, - ... encoding="json", - ... schema={"version": "1.0"}, - ... meta={"confidence": "high"} - ... ) - """ - logger.debug(f"Adding analysis of type {type} from vendor {vendor}") - - if encoding not in ["json", "none", "base64url"]: - logger.error(f"Invalid encoding: {encoding}") - raise Exception("Invalid encoding") - - if encoding == "json" and isinstance(body, str): - try: - json.loads(body) - except Exception as e: - logger.error(f"Invalid JSON body: {str(e)}") - raise Exception("Invalid JSON body: ", e) - - if encoding == "base64url" and isinstance(body, str): - try: - base64.urlsafe_b64decode(body) - except Exception as e: - logger.error(f"Invalid base64url body: {str(e)}") - raise Exception("Invalid base64url body: ", e) - - # Build the analysis object - analysis = { - "type": type, - "dialog": dialog, - "vendor": vendor, - "body": body, - "encoding": encoding, - } - - if mediatype is not None: - analysis["mediatype"] = mediatype - if filename is not None: - analysis["filename"] = filename - if product is not None: - analysis["product"] = product - if url is not None: - analysis["url"] = url - if content_hash is not None: - analysis["content_hash"] = content_hash - - # Add schema if provided - if schema is not None: - analysis["schema"] = schema - - # Add meta if provided - if meta is not None: - analysis["meta"] = meta - - # Add any additional parameters - analysis.update(extra) - - # Process analysis dict according to property handling mode - processed_analysis = self._process_properties(analysis, _ALLOWED_ANALYSIS_PROPERTIES) - - self.vcon_dict["analysis"].append(processed_analysis) - logger.info(f"Added analysis of type {type} from vendor {vendor}")
- -
[docs] def add_party(self, party: Party) -> None: - """ - Add a party to the vCon. - - This method adds a party object to the vCon's parties list. A party represents - a participant in the conversation. - - Args: - party: The Party object to add - - Example: - >>> vcon = Vcon.build_new() - >>> party = Party(type="person", name="John Doe") - >>> vcon.add_party(party) - """ - - # Process party dict according to property handling mode - party_dict = party.to_dict() - processed_party = self._process_properties(party_dict, _ALLOWED_PARTY_PROPERTIES) - - self.vcon_dict["parties"].append(processed_party) - logger.info("Added party")
- - -
[docs] def find_party_index(self, by: str, val: str) -> Optional[int]: - """ - Find the index of a party in the vCon's parties list. - - This method searches through the parties list and returns the index of the first - party that matches the specified key-value pair. - - Args: - by: The key to search by (e.g., "name", "type") - val: The value to match - - Returns: - The index of the matching party if found, None otherwise - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_party(Party(type="person", name="John Doe")) - >>> index = vcon.find_party_index("name", "John Doe") - >>> print(index) # Prints 0 - """ - logger.debug(f"Searching for party with {by}={val}") - index = next( - ( - ind - for ind, party in enumerate(self.vcon_dict["parties"]) - if _get(party, by) == val - ), - None, - ) - if index is not None: - logger.debug(f"Found party at index {index}") - else: - logger.debug(f"No party found with {by}={val}") - return index
- -
[docs] def find_dialog(self, by: str, val: str) -> Optional[Dialog]: - """ - Find a dialog entry in the vCon by a key-value pair. - - This method searches through the dialog list and returns the first dialog - entry that matches the specified key-value pair, converted to a Dialog object. - - Args: - by: The key to search by (e.g., "type", "start") - val: The value to match - - Returns: - A Dialog object if found, None otherwise - - Example: - >>> vcon = Vcon.build_new() - >>> dialog = Dialog(type="text", start="2023-01-01T00:00:00Z", parties=[0]) - >>> vcon.add_dialog(dialog) - >>> found = vcon.find_dialog("type", "text") - >>> print(found.type) # Prints "text" - """ - logger.debug(f"Searching for dialog with {by}={val}") - dialog = next( - (dialog for dialog in self.vcon_dict["dialog"] if _get(dialog, by) == val), - None, - ) - if dialog: - logger.debug(f"Found dialog with {by}={val}") - return Dialog(**dialog) - logger.debug(f"No dialog found with {by}={val}") - return None
- -
[docs] def find_dialogs_by_type(self, type: str) -> List[Dict[str, Any]]: - """ - Find all dialog entries in the vCon by type. - This method searches through the dialog list and returns all dialog - entries matching the specified type. - Args: - type: The type of dialogs to find - Returns: - A list of matching dialog dictionaries - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_transfer_dialog(start="2023-01-20T14:00:00Z", transfer_data={...}) - >>> transfer_dialogs = vcon.find_dialogs_by_type("transfer") - """ - return [dialog for dialog in self.vcon_dict["dialog"] if dialog.get("type") == type]
- -
[docs] def add_dialog(self, dialog: Dialog) -> None: - """ - Add a dialog entry to the vCon. - - This method adds a Dialog object to the vCon's dialog list. A dialog entry - represents a segment of the conversation with its associated metadata. - - Args: - dialog: The Dialog object to add - - Example: - >>> vcon = Vcon.build_new() - >>> dialog = Dialog(type="text", start="2023-01-01T00:00:00Z", parties=[0]) - >>> vcon.add_dialog(dialog) - """ - logger.debug(f"Adding dialog: {dialog.to_dict()}") - - # Process dialog dict according to property handling mode - dialog_dict = dialog.to_dict() - processed_dialog = self._process_properties(dialog_dict, _ALLOWED_DIALOG_PROPERTIES) - - self.vcon_dict["dialog"].append(processed_dialog) - logger.info(f"Added dialog of type {dialog.type}")
- -
[docs] def add_transfer_dialog( - self, - start: Union[str, datetime], - transfer_data: Dict[str, Any], - parties: List[int], - metadata: Optional[Dict[str, Any]] = None - ) -> None: - """ - Add a transfer dialog entry to the vCon. - This method creates a dialog entry of type "transfer" with the provided - transfer data and adds it to the vCon's dialog list. - Args: - start: When the transfer occurred (ISO 8601 string or datetime) - transfer_data: Transfer-specific information - parties: List of party indices involved - metadata: Additional metadata (optional) - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_transfer_dialog( - ... start="2023-01-20T14:05:00Z", - ... transfer_data={ - ... "reason": "Call forwarded", - ... "from": "+1234567890", - ... "to": "+1987654321", - ... "protocol": "SIP", - ... "details": { - ... "sipMessage": "SIP/2.0 302 Moved Temporarily" - ... } - ... }, - ... parties=[0, 1] - ... ) - """ - dialog = Dialog( - type="transfer", - start=start, - parties=parties, - transfer=transfer_data, - metadata=metadata - ) - - self.add_dialog(dialog)
- -
[docs] def add_incomplete_dialog( - self, - start: Union[str, datetime], - disposition: str, - details: Optional[Dict[str, Any]] = None, - parties: List[int] = None, - metadata: Optional[Dict[str, Any]] = None - ) -> None: - """ - Add an incomplete dialog entry to the vCon. - This method creates a dialog entry of type "incomplete" for conversations - that failed to be set up, with the provided disposition and details. - Args: - start: When the attempt occurred (ISO 8601 string or datetime) - disposition: Reason for the incomplete conversation - details: Additional details about the failure (optional) - parties: List of party indices involved (optional) - metadata: Additional metadata (optional) - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_incomplete_dialog( - ... start="2023-01-20T14:00:00Z", - ... disposition="NO_ANSWER", - ... details={"ringDuration": 45000}, - ... parties=[0, 1] - ... ) - """ - if parties is None: - parties = [] - - dialog_data = { - "disposition": disposition - } - - if details: - dialog_data.update(details) - - dialog = Dialog( - type="incomplete", - start=start, - parties=parties, - body=dialog_data, - disposition=disposition, - metadata=metadata - ) - - self.add_dialog(dialog)
- -
[docs] def to_json(self) -> str: - """ - Serialize the vCon to a JSON string. - - This method converts the entire vCon object to a JSON string representation, - which can be used for storage or transmission. - - Returns: - A JSON string representation of the vCon - - Example: - >>> vcon = Vcon.build_new() - >>> json_str = vcon.to_json() - >>> print(type(json_str)) # Prints "<class 'str'>" - """ - logger.debug("Converting vCon to JSON string") - tmp_vcon_dict = copy.copy(self.vcon_dict) - json_str = json.dumps(tmp_vcon_dict) - logger.debug("Successfully converted vCon to JSON string") - return json_str
- -
[docs] def to_dict(self) -> Dict[str, Any]: - """ - Convert the vCon to a dictionary. - - This method returns a dictionary representation of the vCon object, - which can be used for direct manipulation or inspection. - - Returns: - A dictionary representation of the vCon - - Example: - >>> vcon = Vcon.build_new() - >>> vcon_dict = vcon.to_dict() - >>> print(vcon_dict["vcon"]) # Prints "0.4.0" - """ - logger.debug("Converting vCon to dictionary") - return json.loads(self.to_json())
- -
[docs] def dumps(self) -> str: - """ - Alias for to_json(). - - This method is an alias for to_json() and converts the vCon object to a - JSON string representation. - - Returns: - A JSON string representation of the vCon - - Example: - >>> vcon = Vcon.build_new() - >>> json_str = vcon.dumps() - >>> print(type(json_str)) # Prints "<class 'str'>" - """ - logger.debug("Dumping vCon to JSON string") - return self.to_json()
- - @property - def parties(self) -> List[Dict[str, Any]]: - """ - Get the list of parties in the vCon. - - Returns: - A list of party dictionaries representing all participants in the conversation. - These are mutable references to the internal data structure, allowing in-place modifications. - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_party(Party(type="person", name="John Doe")) - >>> parties = vcon.parties - >>> print(parties[0]["name"]) # Prints "John Doe" - >>> parties[0]["name"] = "Jane Doe" # In-place modification works - >>> print(vcon.parties[0]["name"]) # Prints "Jane Doe" - """ - return self.vcon_dict.get("parties", []) - -
[docs] def get_party_objects(self) -> List[Party]: - """ - Get the list of parties as Party objects. - - This method creates Party objects from the underlying dictionary data. - Use this when you need Party objects instead of raw dictionaries. - - Returns: - A list of Party objects representing all participants in the conversation - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_party(Party(type="person", name="John Doe")) - >>> party_objects = vcon.get_party_objects() - >>> print(party_objects[0].name) # Prints "John Doe" - """ - return [Party(**party) for party in self.vcon_dict.get("parties", [])]
- - @property - def dialog(self) -> List[Dict[str, Any]]: - """ - Get the list of dialog entries in the vCon. - - Returns: - A list of dialog dictionaries representing the conversation content. - These are mutable references to the internal data structure, allowing in-place modifications. - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_dialog(Dialog(type="text", start="2023-01-01T00:00:00Z", parties=[0])) - >>> dialog = vcon.dialog - >>> print(dialog[0]["type"]) # Prints "text" - >>> dialog[0]["body"] = "Modified content" # In-place modification works - >>> print(vcon.dialog[0]["body"]) # Prints "Modified content" - """ - return self.vcon_dict.get("dialog", []) - - @property - def attachments(self) -> List[Dict[str, Any]]: - """ - Get the list of attachments in the vCon. - - Returns: - A list of attachment dictionaries - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_attachment("metadata", {"version": "1.0"}) - >>> attachments = vcon.attachments - >>> print(attachments[0]["purpose"]) # Prints "metadata" - """ - return self.vcon_dict.get("attachments", []) - - @property - def analysis(self) -> List[Dict[str, Any]]: - """ - Get the list of analysis entries in the vCon. - - Returns: - A list of analysis dictionaries - - Example: - >>> vcon = Vcon.build_new() - >>> vcon.add_analysis(type="sentiment", dialog=[0], vendor="acme", body={"score": 0.8}) - >>> analysis = vcon.analysis - >>> print(analysis[0]["type"]) # Prints "sentiment" - """ - return self.vcon_dict.get("analysis", []) - - @property - def uuid(self) -> str: - return self.vcon_dict["uuid"] - - @property - def vcon(self) -> Optional[str]: - return self.vcon_dict.get("vcon") - - @property - def subject(self) -> Optional[str]: - return self.vcon_dict.get("subject") - - @property - def created_at(self): - return self.vcon_dict.get("created_at") - - @property - def updated_at(self): - return self.vcon_dict.get("updated_at") - - @property - def redacted(self): - return self.vcon_dict.get("redacted") - - @property - def amended(self): - return self.vcon_dict.get("amended") - - @property - def group(self): - return self.vcon_dict.get("group", []) - - @property - def meta(self): - return self.vcon_dict.get("meta", {}) - -
[docs] @staticmethod - def uuid8_domain_name(domain_name: str) -> str: - sha1_hasher = hashlib.sha1() - sha1_hasher.update(bytes(domain_name, "utf-8")) - dn_sha1 = sha1_hasher.digest() - - hash_upper_64 = dn_sha1[0:8] - int64 = int.from_bytes(hash_upper_64, byteorder="big") - - uuid8_domain = Vcon.uuid8_time(int64) - - return uuid8_domain
- -
[docs] @staticmethod - def uuid8_time(custom_c_62_bits: int) -> str: - global _LAST_V8_TIMESTAMP - - ns = time.time_ns() - if _LAST_V8_TIMESTAMP is not None and ns <= _LAST_V8_TIMESTAMP: - ns = _LAST_V8_TIMESTAMP + 1 - timestamp_ms, timestamp_ns = divmod(ns, 10**6) - subsec = uuid6._subsec_encode(timestamp_ns) - - subsec_a = subsec >> 8 - uuid_int = (timestamp_ms & 0xFFFFFFFFFFFF) << 80 - uuid_int |= subsec_a << 64 - uuid_int |= custom_c_62_bits - - uuid_str = str(uuid6.UUID(int=uuid_int, version=7)) - assert uuid_str[14] == "7" - uuid_str = uuid_str[:14] + "8" + uuid_str[15:] - - return uuid_str
- -
[docs] def sign(self, private_key: Union[rsa.RSAPrivateKey, bytes]) -> None: - """ - Sign the vCon using JWS (JSON Web Signature). - - This method signs the vCon using the provided private key, adding the signature - information to the vCon. The signature can later be verified using the - corresponding public key. - - Args: - private_key: The RSA private key or its PEM representation - - Raises: - Exception: If there is an error during the signing process - - Example: - >>> from cryptography.hazmat.primitives.asymmetric import rsa - >>> private_key = rsa.generate_private_key(public_exponent=65537, key_size=2048) - >>> vcon = Vcon.build_new() - >>> vcon.sign(private_key) - """ - logger.debug("Signing vCon with JWS") - try: - payload = self.to_json() - jws = JsonWebSignature() - protected = {"alg": "RS256", "typ": "JWS"} - - # Convert private key to PEM format if it's not already - if isinstance(private_key, rsa.RSAPrivateKey): - pem = private_key.private_bytes( - encoding=serialization.Encoding.PEM, - format=serialization.PrivateFormat.PKCS8, - encryption_algorithm=serialization.NoEncryption(), - ) - else: - pem = private_key - - signed = jws.serialize_compact(protected, payload, pem) - signed_str = signed.decode("utf-8") - header, payload, signature = signed_str.split(".") - - self.vcon_dict["signatures"] = [{"protected": header, "signature": signature}] - self.vcon_dict["payload"] = payload - logger.info("Successfully signed vCon") - except Exception as e: - logger.error(f"Failed to sign vCon: {str(e)}") - raise
- -
[docs] def verify(self, public_key: Union[rsa.RSAPublicKey, bytes]) -> bool: - """ - Verify the JWS signature of the vCon. - - This method verifies the vCon's signature using the provided public key. - The vCon must have been previously signed using the corresponding private key. - - Args: - public_key: The RSA public key or its PEM representation - - Returns: - True if the signature is valid, False otherwise - - Raises: - ValueError: If the vCon is not signed - - Example: - >>> private_key, public_key = Vcon.generate_key_pair() - >>> vcon = Vcon.build_new() - >>> vcon.sign(private_key) - >>> is_valid = vcon.verify(public_key) - >>> print(is_valid) # Prints True - """ - logger.debug("Verifying vCon signature") - - if "signatures" not in self.vcon_dict or "payload" not in self.vcon_dict: - logger.error("Cannot verify: vCon is not signed") - raise ValueError("vCon is not signed") - - try: - jws = JsonWebSignature() - signed_data = f"{self.vcon_dict['signatures'][0]['protected']}.{self.vcon_dict['payload']}.{self.vcon_dict['signatures'][0]['signature']}" - - # Convert public key to PEM format if it's not already - if isinstance(public_key, rsa.RSAPublicKey): - pem = public_key.public_bytes( - encoding=serialization.Encoding.PEM, - format=serialization.PublicFormat.SubjectPublicKeyInfo, - ) - else: - pem = public_key - - jws.deserialize_compact(signed_data, pem) - logger.info("Successfully verified vCon signature") - return True - except BadSignatureError: - logger.warning("Invalid signature detected") - return False - except Exception as e: - logger.error(f"Error during signature verification: {str(e)}") - return False
- -
[docs] @classmethod - def generate_key_pair(cls) -> Tuple[rsa.RSAPrivateKey, rsa.RSAPublicKey]: - """ - Generate a new RSA key pair for signing vCons. - - This method generates a new RSA key pair that can be used for signing - and verifying vCons. - - Returns: - A tuple containing the private key and public key - - Example: - >>> private_key, public_key = Vcon.generate_key_pair() - >>> vcon = Vcon.build_new() - >>> vcon.sign(private_key) - >>> is_valid = vcon.verify(public_key) - """ - logger.debug("Generating new RSA key pair") - private_key = rsa.generate_private_key(public_exponent=65537, key_size=2048) - public_key = private_key.public_key() - logger.info("Successfully generated RSA key pair") - return private_key, public_key
- -
[docs] def is_valid(self) -> Tuple[bool, List[str]]: - """ - Validate the vCon syntax according to the standard. - Checks required fields, ensures data types are correct, and verifies - relationships between different parts of the vCon (for example, dialog party - references and attachment fields). - - Returns: - Tuple[bool, List[str]]: A tuple where the first element is True if the vCon - is valid and False otherwise, and the second element is a list of error messages. - """ - logger.debug("Validating vCon") - errors = [] - # Validate required fields. - required_fields = ["uuid", "created_at"] - for field in required_fields: - if field not in self.vcon_dict: - error = f"Missing required field: {field}" - logger.error(error) - errors.append(error) - # Validate created_at format. - if "created_at" in self.vcon_dict: - try: - parser.parse(self.vcon_dict["created_at"]) - except Exception as e: - error = f"Invalid created_at format. Must be an ISO 8601 datetime string: {str(e)}" - logger.error(error) - errors.append(error) - # Validate parties. - if "parties" in self.vcon_dict: - if not isinstance(self.vcon_dict["parties"], list): - error = "Field 'parties' must be a list." - logger.error(error) - errors.append(error) - else: - for i, party in enumerate(self.vcon_dict["parties"]): - if not isinstance(party, dict): - error = f"Party at index {i} must be a dictionary." - logger.error(error) - errors.append(error) - # Validate dialogs. - dialogs = self.vcon_dict.get("dialog", []) - for i, dialog in enumerate(dialogs): - if not isinstance(dialog, dict): - errors.append(f"Dialog at index {i} must be a dictionary.") - continue - - # Validate dialog type if present - if "type" in dialog: - dialog_type = dialog["type"] - if dialog_type not in Dialog.VALID_TYPES: - errors.append(f"Dialog at index {i} has an invalid type: {dialog_type}") - - # Validate specific requirements for each type - if dialog_type == "incomplete": - # For incomplete dialogs, ensure there's a disposition - if "disposition" not in dialog: - errors.append(f"Dialog at index {i} of type 'incomplete' must have a disposition.") - - elif dialog_type == "transfer": - # For transfer dialogs, ensure there's either transfer info or transferor/transferee - has_transfer_field = "transfer" in dialog - has_transferor = "transferor" in dialog - has_transferee = "transferee" in dialog - - if not (has_transfer_field or (has_transferor and has_transferee)): - errors.append(f"Dialog at index {i} of type 'transfer' must have either a transfer field or both transferor and transferee fields.") - - # Validate party references in dialog. - if "parties" in dialog: - if not isinstance(dialog["parties"], list): - errors.append(f"Dialog at index {i} field 'parties' must be a list.") - else: - party_count = len(self.vcon_dict.get("parties", [])) - for party_idx in dialog["parties"]: - if not isinstance(party_idx, int) or party_idx < 0 or party_idx >= party_count: - errors.append(f"Dialog at index {i} references invalid party index: {party_idx}") - # Validate start time format if present. - if "start" in dialog: - try: - parser.parse(dialog["start"]) - except Exception: - errors.append(f"Dialog at index {i} has an invalid 'start' format. Must be an ISO 8601 datetime string.") - - # Validate mediatype for non-transfer/incomplete types - dialog_type = dialog.get("type", "") - if dialog_type not in ["transfer", "incomplete"]: - if ("mediatype" not in dialog or - not isinstance(dialog["mediatype"], str) or - dialog["mediatype"] not in Dialog.MIME_TYPES): - errors.append(f"Dialog at index {i} has an invalid or missing mediatype: {dialog.get('mediatype', 'missing')}") - - # Validate attachments. - if "attachments" in self.vcon_dict: - if not isinstance(self.vcon_dict["attachments"], list): - errors.append("Field 'attachments' must be a list.") - else: - for i, attachment in enumerate(self.vcon_dict["attachments"]): - if not isinstance(attachment, dict): - errors.append(f"Attachment at index {i} must be a dictionary.") - else: - # Check for required attachment fields. - if "purpose" not in attachment: - errors.append(f"Attachment at index {i} is missing required field: purpose") - has_inline = "body" in attachment and "encoding" in attachment - has_external = "url" in attachment and "content_hash" in attachment - if not (has_inline or has_external): - errors.append( - f"Attachment at index {i} must include body+encoding or url+content_hash." - ) - # Validate encoding. - if ("encoding" in attachment and - attachment["encoding"] not in ["json", "none", "base64url"]): - errors.append(f"Attachment at index {i} has invalid encoding: {attachment['encoding']}") - - # Validate analysis. - if "analysis" in self.vcon_dict: - if not isinstance(self.vcon_dict["analysis"], list): - errors.append("Field 'analysis' must be a list.") - else: - for i, analysis in enumerate(self.vcon_dict["analysis"]): - if not isinstance(analysis, dict): - errors.append(f"Analysis at index {i} must be a dictionary.") - else: - # Required analysis fields. - required_analysis_fields = ["type", "dialog", "vendor", "body", "encoding"] - for field in required_analysis_fields: - if field not in analysis: - errors.append(f"Analysis at index {i} is missing required field: {field}") - # Validate encoding. - if ("encoding" in analysis and - analysis["encoding"] not in ["json", "none", "base64url"]): - errors.append(f"Analysis at index {i} has invalid encoding: {analysis['encoding']}") - # Validate dialog references within analysis. - dialog_count = len(dialogs) - if "dialog" in analysis: - if isinstance(analysis["dialog"], list): - for dialog_idx in analysis["dialog"]: - if not isinstance(dialog_idx, int) or dialog_idx < 0 or dialog_idx >= dialog_count: - errors.append(f"Analysis at index {i} references invalid dialog index: {dialog_idx}") - elif isinstance(analysis["dialog"], int): - if analysis["dialog"] < 0 or analysis["dialog"] >= dialog_count: - errors.append(f"Analysis at index {i} references invalid dialog index: {analysis['dialog']}") - else: - errors.append(f"Analysis at index {i} has an invalid 'dialog' reference type.") - - if len(errors) == 0: - logger.info("vCon validation successful.") - else: - logger.warning(f"vCon validation failed with {len(errors)} error(s).") - return len(errors) == 0, errors
- -
[docs] @staticmethod - def validate_file(file_path: str) -> tuple[bool, list[str]]: - """ - Validate a vCon file at the given path. - - :param file_path: Path to the vCon JSON file - :type file_path: str - :return: A tuple containing (is_valid, list_of_errors) - :rtype: tuple[bool, list[str]] - """ - try: - with open(file_path, "r") as f: - json_str = f.read() - return Vcon.validate_json(json_str) - except FileNotFoundError: - return False, ["File not found"] - except json.JSONDecodeError: - return False, ["Invalid JSON format"] - except Exception as e: - return False, [f"Error reading file: {str(e)}"]
- -
[docs] @staticmethod - def validate_json(json_str: str) -> tuple[bool, list[str]]: - """ - Validate a vCon from a JSON string. - - :param json_str: JSON string representing a vCon - :type json_str: str - :return: A tuple containing (is_valid, list_of_errors) - :rtype: tuple[bool, list[str]] - """ - try: - vcon = Vcon.build_from_json(json_str) - return vcon.is_valid() - except json.JSONDecodeError: - return False, ["Invalid JSON format"] - except Exception as e: - return False, [f"Error parsing vCon: {str(e)}"]
- -
[docs] @classmethod - def load( - cls, - source: str, - property_handling: str = PROPERTY_HANDLING_DEFAULT, - ) -> "Vcon": - """ - Load a vCon from either a file path or URL. - - Args: - source: File path or URL to load the vCon from - property_handling: How to handle non-standard properties. - Options are "default", "strict", or "meta" - - Returns: - A Vcon object - - Raises: - ValueError: If the source is invalid or cannot be loaded - requests.RequestException: If there is an error fetching from URL - json.JSONDecodeError: If the source contains invalid JSON - """ - if source.startswith(('http://', 'https://')): - return cls.load_from_url( - source, - property_handling=property_handling, - ) - else: - return cls.load_from_file( - source, - property_handling=property_handling, - )
- -
[docs] @classmethod - def load_from_file( - cls, - file_path: str, - property_handling: str = PROPERTY_HANDLING_DEFAULT, - ) -> "Vcon": - """ - Load a vCon from a file. - - Args: - file_path: Path to the vCon JSON file - property_handling: How to handle non-standard properties. - Options are "default", "strict", or "meta" - - Returns: - A Vcon object - - Raises: - FileNotFoundError: If the file does not exist - json.JSONDecodeError: If the file contains invalid JSON - """ - try: - with open(file_path, 'r') as f: - json_str = f.read() - return cls.build_from_json( - json_str, - property_handling=property_handling, - ) - except FileNotFoundError: - raise FileNotFoundError(f"vCon file not found: {file_path}") - except json.JSONDecodeError as e: - raise json.JSONDecodeError(f"Invalid JSON in vCon file: {str(e)}", e.doc, e.pos)
- -
[docs] @classmethod - def load_from_url( - cls, - url: str, - property_handling: str = PROPERTY_HANDLING_DEFAULT, - ) -> "Vcon": - """ - Load a vCon from a URL. - - Args: - url: URL to fetch the vCon JSON from - property_handling: How to handle non-standard properties. - Options are "default", "strict", or "meta" - - Returns: - A Vcon object - - Raises: - requests.RequestException: If there is an error fetching from URL - json.JSONDecodeError: If the response contains invalid JSON - """ - response = requests.get(url) - response.raise_for_status() # Raise an exception for bad status codes - return cls.build_from_json( - response.text, - property_handling=property_handling, - )
- -
[docs] def save_to_file(self, file_path: str) -> None: - """ - Save the vCon to a JSON file. - - :param file_path: Path where the vCon JSON should be saved - :type file_path: str - :raises IOError: If there is an error writing to the file - """ - logger.debug(f"Saving vCon to file: {file_path}") - try: - with open(file_path, 'w') as f: - f.write(self.to_json()) - logger.info(f"Successfully saved vCon to {file_path}") - except IOError as e: - logger.error(f"Failed to save vCon to file: {str(e)}") - raise
- -
[docs] def post_to_url(self, url: str, headers: Optional[Dict[str, str]] = None) -> requests.Response: - """ - Post the vCon as JSON to a URL with optional headers. - - :param url: The URL to post the vCon to - :type url: str - :param headers: Optional dictionary of HTTP headers (e.g., {'x-conserver-api-token': 'token123'}) - :type headers: Optional[Dict[str, str]] - :return: The HTTP response from the server - :rtype: requests.Response - :raises requests.RequestException: If there is an error making the HTTP request - - Example: - >>> vcon = Vcon.build_new() - >>> response = vcon.post_to_url( - ... 'https://api.example.com/vcons', - ... headers={'x-conserver-api-token': 'your-token-here'} - ... ) - >>> print(response.status_code) # Prints HTTP status code (e.g., 200 for success) - """ - logger.debug(f"Posting vCon to URL: {url}") - - # Prepare headers - request_headers = { - 'Content-Type': 'application/json' - } - if headers: - request_headers.update(headers) - - try: - response = requests.post( - url, - data=self.to_json(), - headers=request_headers - ) - response.raise_for_status() - logger.info(f"Successfully posted vCon to {url}") - return response - except requests.RequestException as e: - logger.error(f"Failed to post vCon to URL: {str(e)}") - raise
-
- -
-
-
- -
- -
-

© Copyright 2024, Thomas McCarthy-Howe.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/docs/_sources/api/modules.rst.txt b/docs/_sources/api/modules.rst.txt deleted file mode 100644 index e4444a0..0000000 --- a/docs/_sources/api/modules.rst.txt +++ /dev/null @@ -1,7 +0,0 @@ -vcon -==== - -.. toctree:: - :maxdepth: 4 - - vcon diff --git a/docs/_sources/api/vcon.rst.txt b/docs/_sources/api/vcon.rst.txt deleted file mode 100644 index c282611..0000000 --- a/docs/_sources/api/vcon.rst.txt +++ /dev/null @@ -1,45 +0,0 @@ -vcon package -============ - -Submodules ----------- - -vcon.civic\_address module --------------------------- - -.. automodule:: vcon.civic_address - :members: - :undoc-members: - :show-inheritance: - -vcon.dialog module ------------------- - -.. automodule:: vcon.dialog - :members: - :undoc-members: - :show-inheritance: - -vcon.party module ------------------ - -.. automodule:: vcon.party - :members: - :undoc-members: - :show-inheritance: - -vcon.vcon module ----------------- - -.. automodule:: vcon.vcon - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: vcon - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sources/index.rst.txt b/docs/_sources/index.rst.txt deleted file mode 100644 index c908c9c..0000000 --- a/docs/_sources/index.rst.txt +++ /dev/null @@ -1,43 +0,0 @@ -.. vcon documentation master file, created by - sphinx-quickstart on Sat Jan 25 17:19:09 2025. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to vcon's documentation! -================================ - -vcon is a Python library for working with vCon (Virtual Conversation) containers, which are standardized formats for storing conversation data and metadata. - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - installation - usage - new_required_fields - version_management - api/modules - -Installation ------------- - -You can install vcon using pip: - -.. code-block:: bash - - pip install vcon - -For development installation: - -.. code-block:: bash - - git clone https://github.com/vcon-dev/vcon-lib.git - cd vcon-lib - poetry install - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/_sources/installation.rst.txt b/docs/_sources/installation.rst.txt deleted file mode 100644 index 3e3086f..0000000 --- a/docs/_sources/installation.rst.txt +++ /dev/null @@ -1,59 +0,0 @@ -Installation -============ - -There are several ways to install the vcon library. - -Using pip ---------- - -The simplest way to install vcon is using pip: - -.. code-block:: bash - - pip install vcon - -Using Poetry (recommended for development) ------------------------------------------- - -For development, we recommend using Poetry: - -1. First, install Poetry if you haven't already: - - .. code-block:: bash - - curl -sSL https://install.python-poetry.org | python3 - - -2. Clone the repository: - - .. code-block:: bash - - git clone https://github.com/vcon-dev/vcon-lib.git - cd vcon-lib - -3. Install dependencies: - - .. code-block:: bash - - poetry install - -This will create a virtual environment and install all dependencies, including development dependencies. - -Requirements ------------- - -vcon requires Python 3.12 or later and has the following main dependencies: - -- authlib>=1.6.4 -- uuid6>=2024.7.10 -- requests>=2.32.3 -- pydash>=8.0.3 -- python-dateutil>=2.9.0 -- mutagen>=1.47.0 -- ffmpeg>=1.4 -- logger>=1.4 -- pypdf>=6.0.0 -- pillow>=11.3.0 - -Some video processing features require the `ffmpeg` system binary to be installed and available on your PATH. - -These dependencies will be automatically installed when you install vcon using any of the methods above. diff --git a/docs/_sources/new_required_fields.rst.txt b/docs/_sources/new_required_fields.rst.txt deleted file mode 100644 index 24b8f73..0000000 --- a/docs/_sources/new_required_fields.rst.txt +++ /dev/null @@ -1,313 +0,0 @@ -New Required Fields -=================== - -This document describes the new required fields added to the vCon library to support the latest IETF vCon specification requirements. - -Overview --------- - -The vCon library has been updated to include new fields that enhance functionality and interoperability: - -- **vCon Object Level**: Extensions and must-support requirements -- **Party Object**: SIP URI, Decentralized Identifier (DID), vCard format, and timezone -- **Dialog Object**: Session identifier and content hash for integrity verification - -vCon Object Level Extensions ----------------------------- - -Extensions allow vCon implementations to declare additional capabilities and requirements. - -Adding Extensions -~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - from vcon import Vcon - - vcon = Vcon.build_new() - - # Add extensions used in this vCon - vcon.add_extension("video") - vcon.add_extension("encryption") - vcon.add_extension("analytics") - - # Specify extensions that must be supported - vcon.add_critical("encryption") - vcon.add_critical("video") - -Managing Extensions -~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - # Get current extensions - extensions = vcon.get_extensions() # ["video", "encryption", "analytics"] - critical = vcon.get_critical() # ["encryption", "video"] - - # Remove extensions if needed - vcon.remove_extension("analytics") - vcon.remove_critical("video") - - # Check extension compatibility - required = vcon.get_critical() - available = vcon.get_extensions() - - for ext in required: - if ext not in available: - print(f"Warning: Required extension '{ext}' not available") - -Enhanced Party Information --------------------------- - -Parties now support additional contact and identification methods for better interoperability. - -SIP URI Support -~~~~~~~~~~~~~~~ - -SIP (Session Initiation Protocol) URIs allow parties to be contacted via VoIP: - -.. code-block:: python - - from vcon.party import Party - - party = Party( - name="John Doe", - tel="+1234567890", - sip="sip:john@example.com" - ) - -Decentralized Identifier (DID) Support -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -DIDs provide blockchain-based identity management: - -.. code-block:: python - - party = Party( - name="Alice Smith", - did="did:example:123456789abcdef" - ) - -vCard Format Support -~~~~~~~~~~~~~~~~~~~~ - -vCard format provides standardized contact information: - -.. code-block:: python - - party = Party( - name="Bob Johnson", - jCard={ - "fn": "Bob Johnson", - "tel": "+1234567890", - "email": "bob@example.com", - "org": "Example Corp", - "title": "Software Engineer" - } - ) - -Timezone Support -~~~~~~~~~~~~~~~~ - -Timezone information helps with proper time handling: - -.. code-block:: python - - party = Party( - name="Carol Wilson", - timezone="America/New_York" - ) - -Complete Party Example -~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - party = Party( - name="John Doe", - tel="+1234567890", - sip="sip:john@example.com", - did="did:example:123456789abcdef", - jCard={ - "fn": "John Doe", - "tel": "+1234567890", - "email": "john@example.com", - "org": "Example Corp" - }, - timezone="America/New_York" - ) - -Dialog Session Management and Content Integrity ------------------------------------------------ - -Dialogs now support session tracking and content integrity verification. - -Session Identifier -~~~~~~~~~~~~~~~~~~ - -Session IDs help track conversation sessions across multiple dialogs: - -.. code-block:: python - - from vcon.dialog import Dialog - from datetime import datetime, timezone - - dialog = Dialog( - type="text", - start=datetime.now(timezone.utc), - parties=[0, 1], - body="Hello, this is a test message!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - - # Get session ID - session_id = dialog.get_session_id() - - # Set session ID - dialog.set_session_id("session-67890") - -Content Hash for Integrity Verification -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Content hashes ensure data integrity and can replace the older alg/signature fields: - -.. code-block:: python - - # Calculate content hash - content_hash = dialog.calculate_content_hash() - dialog.set_content_hash(content_hash) - - # Verify content integrity - is_valid = dialog.verify_content_hash(content_hash) - print(f"Content integrity: {is_valid}") - - # Get current hash - current_hash = dialog.get_content_hash() - - # Set hash manually - dialog.set_content_hash("abc123def456") - -Complete Dialog Example -~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - dialog = Dialog( - type="text", - start=datetime.now(timezone.utc), - parties=[0, 1], - body="Hello, this is a test message!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - - # Calculate and set content hash for integrity verification - content_hash = dialog.calculate_content_hash() - dialog.set_content_hash(content_hash) - - # Verify content integrity - is_valid = dialog.verify_content_hash(content_hash) - print(f"Content integrity: {is_valid}") - -JSON Serialization ------------------- - -The new fields are properly serialized to JSON: - -.. code-block:: python - - # Create a vCon with new fields - vcon = Vcon.build_new() - vcon.add_extension("video") - vcon.add_critical("encryption") - - party = Party( - name="John Doe", - sip="sip:john@example.com", - did="did:example:123456789abcdef", - jCard={"fn": "John Doe"}, - timezone="America/New_York" - ) - vcon.add_party(party) - - dialog = Dialog( - type="text", - start=datetime.now(timezone.utc), - parties=[0], - body="Hello!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - dialog.set_content_hash(dialog.calculate_content_hash()) - vcon.add_dialog(dialog) - - # Serialize to JSON - json_data = vcon.to_json() - print(json_data) - -The resulting JSON will include: - -.. code-block:: json - - { - "uuid": "...", - "extensions": ["video"], - "critical": ["encryption"], - "parties": [{ - "name": "John Doe", - "sip": "sip:john@example.com", - "did": "did:example:123456789abcdef", - "jCard": {"fn": "John Doe"}, - "timezone": "America/New_York" - }], - "dialog": [{ - "type": "text", - "start": "...", - "parties": [0], - "body": "Hello!", - "session_id": {"local": "local-uuid", "remote": "remote-uuid"}, - "content_hash": "..." - }] - } - -Backward Compatibility ----------------------- - -All new fields are optional and backward compatible: - -- Existing vCon objects without the new fields will continue to work -- New fields only appear in JSON output when they have values -- The library maintains compatibility with older vCon versions - -Migration Guide ---------------- - -To migrate existing code to use the new fields: - -1. **Add Extensions**: Use `add_extension()` and `add_critical()` to declare capabilities -2. **Enhance Parties**: Add SIP, DID, jCard, and timezone information to Party objects -3. **Track Sessions**: Add session_id to Dialog objects for better session management -4. **Verify Integrity**: Use content_hash for data integrity verification instead of alg/signature - -Example migration: - -.. code-block:: python - - # Old code - party = Party(name="John", tel="+1234567890") - dialog = Dialog(type="text", start=datetime.now(), parties=[0], body="Hello") - - # New code - party = Party( - name="John", - tel="+1234567890", - sip="sip:john@example.com", - timezone="America/New_York" - ) - - dialog = Dialog( - type="text", - start=datetime.now(), - parties=[0], - body="Hello", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - dialog.set_content_hash(dialog.calculate_content_hash()) diff --git a/docs/_sources/usage.rst.txt b/docs/_sources/usage.rst.txt deleted file mode 100644 index 758b09a..0000000 --- a/docs/_sources/usage.rst.txt +++ /dev/null @@ -1,213 +0,0 @@ -Usage Guide -=========== - -This guide will help you get started with using the vcon library. - -Basic Usage ------------ - -Creating a vCon Container -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here's a simple example of creating a vCon container: - -.. code-block:: python - - from vcon import Vcon - from vcon.party import Party - from vcon.dialog import Dialog - from datetime import datetime, timezone - - # Create a new vCon container - vcon = Vcon.build_new() - - # Add extensions and must-support requirements - vcon.add_extension("video") - vcon.add_extension("encryption") - vcon.add_critical("encryption") - - # Add participants with enhanced contact information - party = Party( - name="John Doe", - tel="+1234567890", - sip="sip:john@example.com", - did="did:example:123456789abcdef", - jCard={ - "fn": "John Doe", - "tel": "+1234567890", - "email": "john@example.com" - }, - timezone="America/New_York" - ) - vcon.add_party(party) - - # Create a dialog with session tracking and content integrity - dialog = Dialog( - type="text", - start=datetime.now(timezone.utc), - parties=[0], - body="Hello, this is a test message!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - - # Calculate and set content hash for integrity verification - content_hash = dialog.calculate_content_hash() - dialog.set_content_hash(content_hash) - - vcon.add_dialog(dialog) - - # Save the container - vcon.save_to_file("my_conference.vcon") - -Reading a vCon Container -~~~~~~~~~~~~~~~~~~~~~~~~ - -To read an existing vCon container: - -.. code-block:: python - - from vcon import Vcon - - # Load a vCon container - vcon = Vcon.load_from_file("my_conference.vcon") - - # Access extensions - extensions = vcon.get_extensions() - critical = vcon.get_critical() - - # Get participants with enhanced information - parties = vcon.parties - for party in parties: - print(f"Name: {party['name']}") - print(f"SIP: {party.get('sip', 'Not set')}") - print(f"DID: {party.get('did', 'Not set')}") - print(f"Timezone: {party.get('timezone', 'Not set')}") - - # Alternative: Use get_party_objects() for Party object access - party_objects = vcon.get_party_objects() - for party in party_objects: - print(f"Name: {party.name}") - print(f"SIP: {getattr(party, 'sip', 'Not set')}") - print(f"DID: {getattr(party, 'did', 'Not set')}") - print(f"Timezone: {getattr(party, 'timezone', 'Not set')}") - - # Get dialogs with session information - dialogs = vcon.dialog - for dialog in dialogs: - print(f"Session ID: {getattr(dialog, 'session_id', 'Not set')}") - print(f"Content Hash: {getattr(dialog, 'content_hash', 'Not set')}") - -Advanced Usage --------------- - -Working with Extensions -~~~~~~~~~~~~~~~~~~~~~~~ - -Extensions allow vCon implementations to declare additional capabilities: - -.. code-block:: python - - from vcon import Vcon - - vcon = Vcon.build_new() - - # Add extensions used in this vCon - vcon.add_extension("video") - vcon.add_extension("encryption") - vcon.add_extension("analytics") - - # Specify extensions that must be supported - vcon.add_critical("encryption") - vcon.add_critical("video") - - # Check extension compatibility - required = vcon.get_critical() - available = vcon.get_extensions() - - for ext in required: - if ext not in available: - print(f"Warning: Required extension '{ext}' not available") - -Working with Enhanced Party Information -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Parties now support additional contact and identification methods: - -.. code-block:: python - - from vcon.party import Party - - # Create a party with SIP URI for VoIP communication - party = Party( - name="Alice Johnson", - tel="+1234567890", - sip="sip:alice@example.com", - did="did:example:123456789abcdef", - jCard={ - "fn": "Alice Johnson", - "tel": "+1234567890", - "email": "alice@example.com", - "org": "Example Corp" - }, - timezone="America/New_York" - ) - -Working with Dialog Session Management -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Dialogs now support session tracking and content integrity verification: - -.. code-block:: python - - from vcon.dialog import Dialog - from datetime import datetime, timezone - - # Create a dialog with session tracking - dialog = Dialog( - type="text", - start=datetime.now(timezone.utc), - parties=[0, 1], - body="Hello, this is a test message!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - - # Calculate content hash for integrity verification - content_hash = dialog.calculate_content_hash() - dialog.set_content_hash(content_hash) - - # Verify content integrity - is_valid = dialog.verify_content_hash(content_hash) - print(f"Content integrity: {is_valid}") - -Working with Media Files -~~~~~~~~~~~~~~~~~~~~~~~~ - -You can attach and manage media files in a vCon container by creating dialogs and/or attachments: - -.. code-block:: python - - from vcon import Vcon - from vcon.dialog import Dialog - from datetime import datetime, timezone - - vcon = Vcon.build_new() - - # Add a video recording dialog (external URL) - dialog = Dialog( - type="recording", - start=datetime.now(timezone.utc), - parties=[0], - url="https://example.com/recording.mp4", - mediatype="video/mp4" - ) - vcon.add_dialog(dialog) - - # Add an attachment (image/pdf) - vcon.add_image("document.pdf", purpose="identification") - -.. _api-reference: - -API Reference -------------- - -For more detailed information about the API, please refer to the sections below. diff --git a/docs/_sources/version_management.rst.txt b/docs/_sources/version_management.rst.txt deleted file mode 100644 index 6d1135e..0000000 --- a/docs/_sources/version_management.rst.txt +++ /dev/null @@ -1,190 +0,0 @@ -Version Management Changes -========================== - -This document describes the changes to version management in the vCon library, including the removal of mandatory version enforcement and the optional nature of the version field. - -Overview --------- - -Starting with version 0.7.0, the vCon library has simplified version management by making the version field optional and removing automatic version enforcement. This aligns with the latest vCon specification changes and provides more flexibility for users. - -Key Changes ------------ - -Version Field Is Now Optional -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``vcon`` field in vCon objects is no longer required: - -- New vCon objects created with ``Vcon.build_new()`` do not include a version field by default -- Existing vCon objects with version fields continue to work unchanged -- The version field can be manually added if needed - -Removed Version Management Parameters -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following parameters have been removed from all Vcon methods: - -- ``strict_version`` parameter removed from: - - ``Vcon.__init__()`` - - ``Vcon.build_from_json()`` - - ``Vcon.build_new()`` - - ``Vcon.load()`` - - ``Vcon.load_from_file()`` - - ``Vcon.load_from_url()`` - -Updated Method Signatures -~~~~~~~~~~~~~~~~~~~~~~~~~ - -All method signatures have been updated to remove version management: - -.. code-block:: python - - # Old signatures (no longer supported) - Vcon(vcon_dict=None, strict_version=True) - Vcon.build_new(created_at=None, strict_version=True) - Vcon.build_from_json(json_str, strict_version=True) - Vcon.load(source, strict_version=True) - - # New signatures - Vcon(vcon_dict=None, property_handling="default") - Vcon.build_new(created_at=None, property_handling="default") - Vcon.build_from_json(json_str, property_handling="default") - Vcon.load(source, property_handling="default") - -Migration Guide ---------------- - -For Existing Code -~~~~~~~~~~~~~~~~~ - -If you were using the ``strict_version`` parameter, simply remove it: - -.. code-block:: 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) - -For Version Field Handling -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The version field is now optional. You can choose to: - -1. **Ignore version fields** (recommended for new code): - - Simply don't set or check version fields - - The library will work without them - -2. **Manually manage version fields** (if needed): - - Add version fields manually when creating vCon objects - - Check version fields in your application logic - -.. code-block:: python - - # Option 1: Ignore version fields (recommended) - vcon = Vcon.build_new() - # vcon.vcon will be None - - # Option 2: Manually add version field if needed - vcon = Vcon.build_new() - vcon.vcon_dict["vcon"] = "0.4.0" - # vcon.vcon will be "0.4.0" - -Backward Compatibility -~~~~~~~~~~~~~~~~~~~~~~ - -All changes are backward compatible: - -- Existing vCon objects with version fields continue to work -- The ``vcon`` property returns the version field if present, or ``None`` if not -- No breaking changes to existing functionality - -Examples --------- - -Creating Versionless vCons -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - from vcon import Vcon - - # Create a new vCon without version field - vcon = Vcon.build_new() - print(vcon.vcon) # None - - # Add version field manually if needed - vcon.vcon_dict["vcon"] = "0.4.0" - print(vcon.vcon) # "0.4.0" - -Working with Existing vCons -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - # Load existing vCon (with or without version field) - vcon = Vcon.load("existing.vcon.json") - - # Check if version field exists - if vcon.vcon: - print(f"Version: {vcon.vcon}") - else: - print("No version field") - -Validation Changes -~~~~~~~~~~~~~~~~~~ - -The validation logic has been updated to reflect the optional nature of the version field: - -.. code-block:: python - - # Validation no longer requires version field - is_valid, errors = vcon.is_valid() - - # Only uuid and created_at are required fields - # Version field is optional and not validated - -Benefits --------- - -The simplified version management provides several benefits: - -1. **Reduced Complexity**: No need to manage version parameters -2. **More Flexibility**: Version fields are optional and can be added as needed -3. **Better Interoperability**: Works with vCon objects from different sources -4. **Simplified API**: Cleaner method signatures without version management -5. **Future-Proof**: Aligns with evolving vCon specification - -Troubleshooting ---------------- - -Common Issues -~~~~~~~~~~~~~ - -1. **"strict_version" parameter errors**: - - Remove the ``strict_version`` parameter from all method calls - - Update method signatures to use ``property_handling`` instead - -2. **Version field not found**: - - Check if the vCon object has a version field: ``vcon.vcon is not None`` - - Add version field manually if needed: ``vcon.vcon_dict["vcon"] = "0.4.0"`` - -3. **Validation errors**: - - Ensure required fields (uuid, created_at) are present - - Version field is no longer required for validation - -Getting Help -~~~~~~~~~~~~ - -If you encounter issues with the version management changes: - -1. Check the migration guide above -2. Review the changelog for detailed changes -3. Test with the updated method signatures -4. Ensure backward compatibility with existing vCon objects diff --git a/docs/_static/_sphinx_javascript_frameworks_compat.js b/docs/_static/_sphinx_javascript_frameworks_compat.js deleted file mode 100644 index 8141580..0000000 --- a/docs/_static/_sphinx_javascript_frameworks_compat.js +++ /dev/null @@ -1,123 +0,0 @@ -/* Compatability shim for jQuery and underscores.js. - * - * Copyright Sphinx contributors - * Released under the two clause BSD licence - */ - -/** - * small helper function to urldecode strings - * - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL - */ -jQuery.urldecode = function(x) { - if (!x) { - return x - } - return decodeURIComponent(x.replace(/\+/g, ' ')); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s === 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node, addItems) { - if (node.nodeType === 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && - !jQuery(node.parentNode).hasClass(className) && - !jQuery(node.parentNode).hasClass("nohighlight")) { - var span; - var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.className = className; - } - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - if (isInSVG) { - var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute('class', className); - addItems.push({ - "parent": node.parentNode, - "target": rect}); - } - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this, addItems); - }); - } - } - var addItems = []; - var result = this.each(function() { - highlight(this, addItems); - }); - for (var i = 0; i < addItems.length; ++i) { - jQuery(addItems[i].parent).before(addItems[i].target); - } - return result; -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} diff --git a/docs/_static/basic.css b/docs/_static/basic.css deleted file mode 100644 index 7577acb..0000000 --- a/docs/_static/basic.css +++ /dev/null @@ -1,903 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -div.section::after { - display: block; - content: ''; - clear: left; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox form.search { - overflow: hidden; -} - -div.sphinxsidebar #searchbox input[type="text"] { - float: left; - width: 80%; - padding: 0.25em; - box-sizing: border-box; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - float: left; - width: 20%; - border-left: none; - padding: 0.25em; - box-sizing: border-box; -} - - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li p.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; - margin-left: auto; - margin-right: auto; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable ul { - margin-top: 0; - margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body { - min-width: 360px; - max-width: 800px; -} - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, figure.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, figure.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, figure.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -img.align-default, figure.align-default, .figure.align-default { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-default { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar, -aside.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px; - background-color: #ffe; - width: 40%; - float: right; - clear: right; - overflow-x: auto; -} - -p.sidebar-title { - font-weight: bold; -} - -nav.contents, -aside.topic, -div.admonition, div.topic, blockquote { - clear: left; -} - -/* -- topics ---------------------------------------------------------------- */ - -nav.contents, -aside.topic, -div.topic { - border: 1px solid #ccc; - padding: 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- content of sidebars/topics/admonitions -------------------------------- */ - -div.sidebar > :last-child, -aside.sidebar > :last-child, -nav.contents > :last-child, -aside.topic > :last-child, -div.topic > :last-child, -div.admonition > :last-child { - margin-bottom: 0; -} - -div.sidebar::after, -aside.sidebar::after, -nav.contents::after, -aside.topic::after, -div.topic::after, -div.admonition::after, -blockquote::after { - display: block; - content: ''; - clear: both; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - margin-top: 10px; - margin-bottom: 10px; - border: 0; - border-collapse: collapse; -} - -table.align-center { - margin-left: auto; - margin-right: auto; -} - -table.align-default { - margin-left: auto; - margin-right: auto; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -th > :first-child, -td > :first-child { - margin-top: 0px; -} - -th > :last-child, -td > :last-child { - margin-bottom: 0px; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure, figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption, figcaption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number, -figcaption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text, -figcaption span.caption-text { -} - -/* -- field list styles ----------------------------------------------------- */ - -table.field-list td, table.field-list th { - border: 0 !important; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -/* -- hlist styles ---------------------------------------------------------- */ - -table.hlist { - margin: 1em 0; -} - -table.hlist td { - vertical-align: top; -} - -/* -- object description styles --------------------------------------------- */ - -.sig { - font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; -} - -.sig-name, code.descname { - background-color: transparent; - font-weight: bold; -} - -.sig-name { - font-size: 1.1em; -} - -code.descname { - font-size: 1.2em; -} - -.sig-prename, code.descclassname { - background-color: transparent; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.sig-param.n { - font-style: italic; -} - -/* C++ specific styling */ - -.sig-inline.c-texpr, -.sig-inline.cpp-texpr { - font-family: unset; -} - -.sig.c .k, .sig.c .kt, -.sig.cpp .k, .sig.cpp .kt { - color: #0033B3; -} - -.sig.c .m, -.sig.cpp .m { - color: #1750EB; -} - -.sig.c .s, .sig.c .sc, -.sig.cpp .s, .sig.cpp .sc { - color: #067D17; -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -:not(li) > ol > li:first-child > :first-child, -:not(li) > ul > li:first-child > :first-child { - margin-top: 0px; -} - -:not(li) > ol > li:last-child > :last-child, -:not(li) > ul > li:last-child > :last-child { - margin-bottom: 0px; -} - -ol.simple ol p, -ol.simple ul p, -ul.simple ol p, -ul.simple ul p { - margin-top: 0; -} - -ol.simple > li:not(:first-child) > p, -ul.simple > li:not(:first-child) > p { - margin-top: 0; -} - -ol.simple p, -ul.simple p { - margin-bottom: 0; -} - -aside.footnote > span, -div.citation > span { - float: left; -} -aside.footnote > span:last-of-type, -div.citation > span:last-of-type { - padding-right: 0.5em; -} -aside.footnote > p { - margin-left: 2em; -} -div.citation > p { - margin-left: 4em; -} -aside.footnote > p:last-of-type, -div.citation > p:last-of-type { - margin-bottom: 0em; -} -aside.footnote > p:last-of-type:after, -div.citation > p:last-of-type:after { - content: ""; - clear: both; -} - -dl.field-list { - display: grid; - grid-template-columns: fit-content(30%) auto; -} - -dl.field-list > dt { - font-weight: bold; - word-break: break-word; - padding-left: 0.5em; - padding-right: 5px; -} - -dl.field-list > dd { - padding-left: 0.5em; - margin-top: 0em; - margin-left: 0em; - margin-bottom: 0em; -} - -dl { - margin-bottom: 15px; -} - -dd > :first-child { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dl > dd:last-child, -dl > dd:last-child > :last-child { - margin-bottom: 0; -} - -dt:target, span.highlighted { - background-color: #fbe54e; -} - -rect.highlighted { - fill: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -.classifier:before { - font-style: normal; - margin: 0 0.5em; - content: ":"; - display: inline-block; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -pre, div[class*="highlight-"] { - clear: both; -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; - white-space: nowrap; -} - -div[class*="highlight-"] { - margin: 1em 0; -} - -td.linenos pre { - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - display: block; -} - -table.highlighttable tbody { - display: block; -} - -table.highlighttable tr { - display: flex; -} - -table.highlighttable td { - margin: 0; - padding: 0; -} - -table.highlighttable td.linenos { - padding-right: 0.5em; -} - -table.highlighttable td.code { - flex: 1; - overflow: hidden; -} - -.highlight .hll { - display: block; -} - -div.highlight pre, -table.highlighttable pre { - margin: 0; -} - -div.code-block-caption + div { - margin-top: 0; -} - -div.code-block-caption { - margin-top: 1em; - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -table.highlighttable td.linenos, -span.linenos, -div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; - -webkit-user-select: text; /* Safari fallback only */ - -webkit-user-select: none; /* Chrome/Safari */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* IE10+ */ -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - margin: 1em 0; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -span.eqno a.headerlink { - position: absolute; - z-index: 1; -} - -div.math:hover a.headerlink { - visibility: visible; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/docs/_static/css/badge_only.css b/docs/_static/css/badge_only.css deleted file mode 100644 index 88ba55b..0000000 --- a/docs/_static/css/badge_only.css +++ /dev/null @@ -1 +0,0 @@ -.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions .rst-other-versions .rtd-current-item{font-weight:700}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}#flyout-search-form{padding:6px} \ No newline at end of file diff --git a/docs/_static/css/fonts/Roboto-Slab-Bold.woff b/docs/_static/css/fonts/Roboto-Slab-Bold.woff deleted file mode 100644 index 6cb6000..0000000 Binary files a/docs/_static/css/fonts/Roboto-Slab-Bold.woff and /dev/null differ diff --git a/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 b/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 deleted file mode 100644 index 7059e23..0000000 Binary files a/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 and /dev/null differ diff --git a/docs/_static/css/fonts/Roboto-Slab-Regular.woff b/docs/_static/css/fonts/Roboto-Slab-Regular.woff deleted file mode 100644 index f815f63..0000000 Binary files a/docs/_static/css/fonts/Roboto-Slab-Regular.woff and /dev/null differ diff --git a/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 b/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 deleted file mode 100644 index f2c76e5..0000000 Binary files a/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 and /dev/null differ diff --git a/docs/_static/css/fonts/fontawesome-webfont.eot b/docs/_static/css/fonts/fontawesome-webfont.eot deleted file mode 100644 index e9f60ca..0000000 Binary files a/docs/_static/css/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/docs/_static/css/fonts/fontawesome-webfont.svg b/docs/_static/css/fonts/fontawesome-webfont.svg deleted file mode 100644 index 855c845..0000000 --- a/docs/_static/css/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,2671 +0,0 @@ - - - - -Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 - By ,,, -Copyright Dave Gandy 2016. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_static/css/fonts/fontawesome-webfont.ttf b/docs/_static/css/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 35acda2..0000000 Binary files a/docs/_static/css/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/docs/_static/css/fonts/fontawesome-webfont.woff b/docs/_static/css/fonts/fontawesome-webfont.woff deleted file mode 100644 index 400014a..0000000 Binary files a/docs/_static/css/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/docs/_static/css/fonts/fontawesome-webfont.woff2 b/docs/_static/css/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 4d13fc6..0000000 Binary files a/docs/_static/css/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/docs/_static/css/fonts/lato-bold-italic.woff b/docs/_static/css/fonts/lato-bold-italic.woff deleted file mode 100644 index 88ad05b..0000000 Binary files a/docs/_static/css/fonts/lato-bold-italic.woff and /dev/null differ diff --git a/docs/_static/css/fonts/lato-bold-italic.woff2 b/docs/_static/css/fonts/lato-bold-italic.woff2 deleted file mode 100644 index c4e3d80..0000000 Binary files a/docs/_static/css/fonts/lato-bold-italic.woff2 and /dev/null differ diff --git a/docs/_static/css/fonts/lato-bold.woff b/docs/_static/css/fonts/lato-bold.woff deleted file mode 100644 index c6dff51..0000000 Binary files a/docs/_static/css/fonts/lato-bold.woff and /dev/null differ diff --git a/docs/_static/css/fonts/lato-bold.woff2 b/docs/_static/css/fonts/lato-bold.woff2 deleted file mode 100644 index bb19504..0000000 Binary files a/docs/_static/css/fonts/lato-bold.woff2 and /dev/null differ diff --git a/docs/_static/css/fonts/lato-normal-italic.woff b/docs/_static/css/fonts/lato-normal-italic.woff deleted file mode 100644 index 76114bc..0000000 Binary files a/docs/_static/css/fonts/lato-normal-italic.woff and /dev/null differ diff --git a/docs/_static/css/fonts/lato-normal-italic.woff2 b/docs/_static/css/fonts/lato-normal-italic.woff2 deleted file mode 100644 index 3404f37..0000000 Binary files a/docs/_static/css/fonts/lato-normal-italic.woff2 and /dev/null differ diff --git a/docs/_static/css/fonts/lato-normal.woff b/docs/_static/css/fonts/lato-normal.woff deleted file mode 100644 index ae1307f..0000000 Binary files a/docs/_static/css/fonts/lato-normal.woff and /dev/null differ diff --git a/docs/_static/css/fonts/lato-normal.woff2 b/docs/_static/css/fonts/lato-normal.woff2 deleted file mode 100644 index 3bf9843..0000000 Binary files a/docs/_static/css/fonts/lato-normal.woff2 and /dev/null differ diff --git a/docs/_static/css/theme.css b/docs/_static/css/theme.css deleted file mode 100644 index 0f14f10..0000000 --- a/docs/_static/css/theme.css +++ /dev/null @@ -1,4 +0,0 @@ -html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! - * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs>li{display:inline-block;padding-top:5px}.wy-breadcrumbs>li.wy-breadcrumbs-aside{float:right}.rst-content .wy-breadcrumbs>li code,.rst-content .wy-breadcrumbs>li tt,.wy-breadcrumbs>li .rst-content tt,.wy-breadcrumbs>li code{all:inherit;color:inherit}.breadcrumb-item:before{content:"/";color:#bbb;font-size:13px;padding:0 6px 0 3px}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search .wy-dropdown>aactive,.wy-side-nav-search .wy-dropdown>afocus,.wy-side-nav-search>a:hover,.wy-side-nav-search>aactive,.wy-side-nav-search>afocus{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon,.wy-side-nav-search>a.icon{display:block}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.switch-menus{position:relative;display:block;margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-side-nav-search>div.switch-menus>div.language-switch,.wy-side-nav-search>div.switch-menus>div.version-switch{display:inline-block;padding:.2em}.wy-side-nav-search>div.switch-menus>div.language-switch select,.wy-side-nav-search>div.switch-menus>div.version-switch select{display:inline-block;margin-right:-2rem;padding-right:2rem;max-width:240px;text-align-last:center;background:none;border:none;border-radius:0;box-shadow:none;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-size:1em;font-weight:400;color:hsla(0,0%,100%,.3);cursor:pointer;appearance:none;-webkit-appearance:none;-moz-appearance:none}.wy-side-nav-search>div.switch-menus>div.language-switch select:active,.wy-side-nav-search>div.switch-menus>div.language-switch select:focus,.wy-side-nav-search>div.switch-menus>div.language-switch select:hover,.wy-side-nav-search>div.switch-menus>div.version-switch select:active,.wy-side-nav-search>div.switch-menus>div.version-switch select:focus,.wy-side-nav-search>div.switch-menus>div.version-switch select:hover{background:hsla(0,0%,100%,.1);color:hsla(0,0%,100%,.5)}.wy-side-nav-search>div.switch-menus>div.language-switch select option,.wy-side-nav-search>div.switch-menus>div.version-switch select option{color:#000}.wy-side-nav-search>div.switch-menus>div.language-switch:has(>select):after,.wy-side-nav-search>div.switch-menus>div.version-switch:has(>select):after{display:inline-block;width:1.5em;height:100%;padding:.1em;content:"\f0d7";font-size:1em;line-height:1.2em;font-family:FontAwesome;text-align:center;pointer-events:none;box-sizing:border-box}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions .rst-other-versions .rtd-current-item{font-weight:700}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}#flyout-search-form{padding:6px}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content p a{overflow-wrap:anywhere}.rst-content .wy-table td p,.rst-content .wy-table td ul,.rst-content .wy-table th p,.rst-content .wy-table th ul,.rst-content table.docutils td p,.rst-content table.docutils td ul,.rst-content table.docutils th p,.rst-content table.docutils th ul,.rst-content table.field-list td p,.rst-content table.field-list td ul,.rst-content table.field-list th p,.rst-content table.field-list th ul{font-size:inherit}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .citation-reference>span.fn-bracket,.rst-content .footnote-reference>span.fn-bracket{display:none}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:auto minmax(80%,95%)}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{display:inline-grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{display:grid;grid-template-columns:auto auto minmax(.65rem,auto) minmax(40%,95%)}html.writer-html5 .rst-content aside.citation>span.label,html.writer-html5 .rst-content aside.footnote>span.label,html.writer-html5 .rst-content div.citation>span.label{grid-column-start:1;grid-column-end:2}html.writer-html5 .rst-content aside.citation>span.backrefs,html.writer-html5 .rst-content aside.footnote>span.backrefs,html.writer-html5 .rst-content div.citation>span.backrefs{grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:3}html.writer-html5 .rst-content aside.citation>p,html.writer-html5 .rst-content aside.footnote>p,html.writer-html5 .rst-content div.citation>p{grid-column-start:4;grid-column-end:5}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{margin-bottom:24px}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.citation>dt>span.brackets:before,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.citation>dt>span.brackets:after,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a{word-break:keep-all}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a:not(:first-child):before,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.citation>dd p,html.writer-html5 .rst-content dl.footnote>dd p{font-size:.9rem}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{padding-left:1rem;padding-right:1rem;font-size:.9rem;line-height:1.2rem}html.writer-html5 .rst-content aside.citation p,html.writer-html5 .rst-content aside.footnote p,html.writer-html5 .rst-content div.citation p{font-size:.9rem;line-height:1.2rem;margin-bottom:12px}html.writer-html5 .rst-content aside.citation span.backrefs,html.writer-html5 .rst-content aside.footnote span.backrefs,html.writer-html5 .rst-content div.citation span.backrefs{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content aside.citation span.backrefs>a,html.writer-html5 .rst-content aside.footnote span.backrefs>a,html.writer-html5 .rst-content div.citation span.backrefs>a{word-break:keep-all}html.writer-html5 .rst-content aside.citation span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content aside.footnote span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content div.citation span.backrefs>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content aside.citation span.label,html.writer-html5 .rst-content aside.footnote span.label,html.writer-html5 .rst-content div.citation span.label{line-height:1.2rem}html.writer-html5 .rst-content aside.citation-list,html.writer-html5 .rst-content aside.footnote-list,html.writer-html5 .rst-content div.citation-list{margin-bottom:24px}html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content aside.footnote-list aside.footnote,html.writer-html5 .rst-content div.citation-list>div.citation,html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content aside.footnote-list aside.footnote code,html.writer-html5 .rst-content aside.footnote-list aside.footnote tt,html.writer-html5 .rst-content aside.footnote code,html.writer-html5 .rst-content aside.footnote tt,html.writer-html5 .rst-content div.citation-list>div.citation code,html.writer-html5 .rst-content div.citation-list>div.citation tt,html.writer-html5 .rst-content dl.citation code,html.writer-html5 .rst-content dl.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040;overflow-wrap:normal}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl dd>ol:last-child,.rst-content dl dd>p:last-child,.rst-content dl dd>table:last-child,.rst-content dl dd>ul:last-child{margin-bottom:0}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel,.rst-content .menuselection{font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .guilabel,.rst-content .menuselection{border:1px solid #7fbbe3;background:#e7f2fa}.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>.kbd,.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>kbd{color:inherit;font-size:80%;background-color:#fff;border:1px solid #a6a6a6;border-radius:4px;box-shadow:0 2px grey;padding:2.4px 6px;margin:auto 0}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js deleted file mode 100644 index d06a71d..0000000 --- a/docs/_static/doctools.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Base JavaScript utilities for all Sphinx HTML documentation. - * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ -"use strict"; - -const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ - "TEXTAREA", - "INPUT", - "SELECT", - "BUTTON", -]); - -const _ready = (callback) => { - if (document.readyState !== "loading") { - callback(); - } else { - document.addEventListener("DOMContentLoaded", callback); - } -}; - -/** - * Small JavaScript module for the documentation. - */ -const Documentation = { - init: () => { - Documentation.initDomainIndexTable(); - Documentation.initOnKeyListeners(); - }, - - /** - * i18n support - */ - TRANSLATIONS: {}, - PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), - LOCALE: "unknown", - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext: (string) => { - const translated = Documentation.TRANSLATIONS[string]; - switch (typeof translated) { - case "undefined": - return string; // no translation - case "string": - return translated; // translation exists - default: - return translated[0]; // (singular, plural) translation tuple exists - } - }, - - ngettext: (singular, plural, n) => { - const translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated !== "undefined") - return translated[Documentation.PLURAL_EXPR(n)]; - return n === 1 ? singular : plural; - }, - - addTranslations: (catalog) => { - Object.assign(Documentation.TRANSLATIONS, catalog.messages); - Documentation.PLURAL_EXPR = new Function( - "n", - `return (${catalog.plural_expr})` - ); - Documentation.LOCALE = catalog.locale; - }, - - /** - * helper function to focus on search bar - */ - focusSearchBar: () => { - document.querySelectorAll("input[name=q]")[0]?.focus(); - }, - - /** - * Initialise the domain index toggle buttons - */ - initDomainIndexTable: () => { - const toggler = (el) => { - const idNumber = el.id.substr(7); - const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); - if (el.src.substr(-9) === "minus.png") { - el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; - toggledRows.forEach((el) => (el.style.display = "none")); - } else { - el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; - toggledRows.forEach((el) => (el.style.display = "")); - } - }; - - const togglerElements = document.querySelectorAll("img.toggler"); - togglerElements.forEach((el) => - el.addEventListener("click", (event) => toggler(event.currentTarget)) - ); - togglerElements.forEach((el) => (el.style.display = "")); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); - }, - - initOnKeyListeners: () => { - // only install a listener if it is really needed - if ( - !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && - !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS - ) - return; - - document.addEventListener("keydown", (event) => { - // bail for input elements - if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; - // bail with special keys - if (event.altKey || event.ctrlKey || event.metaKey) return; - - if (!event.shiftKey) { - switch (event.key) { - case "ArrowLeft": - if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; - - const prevLink = document.querySelector('link[rel="prev"]'); - if (prevLink && prevLink.href) { - window.location.href = prevLink.href; - event.preventDefault(); - } - break; - case "ArrowRight": - if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; - - const nextLink = document.querySelector('link[rel="next"]'); - if (nextLink && nextLink.href) { - window.location.href = nextLink.href; - event.preventDefault(); - } - break; - } - } - - // some keyboard layouts may need Shift to get / - switch (event.key) { - case "/": - if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; - Documentation.focusSearchBar(); - event.preventDefault(); - } - }); - }, -}; - -// quick alias for translations -const _ = Documentation.gettext; - -_ready(Documentation.init); diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js deleted file mode 100644 index 63bfaec..0000000 --- a/docs/_static/documentation_options.js +++ /dev/null @@ -1,14 +0,0 @@ -var DOCUMENTATION_OPTIONS = { - URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '0.7.0', - LANGUAGE: 'en', - COLLAPSE_INDEX: false, - BUILDER: 'html', - FILE_SUFFIX: '.html', - LINK_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false, - SHOW_SEARCH_SUMMARY: true, - ENABLE_SEARCH_SHORTCUTS: true, -}; \ No newline at end of file diff --git a/docs/_static/file.png b/docs/_static/file.png deleted file mode 100644 index a858a41..0000000 Binary files a/docs/_static/file.png and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-bold.eot b/docs/_static/fonts/Lato/lato-bold.eot deleted file mode 100644 index 3361183..0000000 Binary files a/docs/_static/fonts/Lato/lato-bold.eot and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-bold.ttf b/docs/_static/fonts/Lato/lato-bold.ttf deleted file mode 100644 index 29f691d..0000000 Binary files a/docs/_static/fonts/Lato/lato-bold.ttf and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-bold.woff b/docs/_static/fonts/Lato/lato-bold.woff deleted file mode 100644 index c6dff51..0000000 Binary files a/docs/_static/fonts/Lato/lato-bold.woff and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-bold.woff2 b/docs/_static/fonts/Lato/lato-bold.woff2 deleted file mode 100644 index bb19504..0000000 Binary files a/docs/_static/fonts/Lato/lato-bold.woff2 and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-bolditalic.eot b/docs/_static/fonts/Lato/lato-bolditalic.eot deleted file mode 100644 index 3d41549..0000000 Binary files a/docs/_static/fonts/Lato/lato-bolditalic.eot and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-bolditalic.ttf b/docs/_static/fonts/Lato/lato-bolditalic.ttf deleted file mode 100644 index f402040..0000000 Binary files a/docs/_static/fonts/Lato/lato-bolditalic.ttf and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-bolditalic.woff b/docs/_static/fonts/Lato/lato-bolditalic.woff deleted file mode 100644 index 88ad05b..0000000 Binary files a/docs/_static/fonts/Lato/lato-bolditalic.woff and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-bolditalic.woff2 b/docs/_static/fonts/Lato/lato-bolditalic.woff2 deleted file mode 100644 index c4e3d80..0000000 Binary files a/docs/_static/fonts/Lato/lato-bolditalic.woff2 and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-italic.eot b/docs/_static/fonts/Lato/lato-italic.eot deleted file mode 100644 index 3f82642..0000000 Binary files a/docs/_static/fonts/Lato/lato-italic.eot and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-italic.ttf b/docs/_static/fonts/Lato/lato-italic.ttf deleted file mode 100644 index b4bfc9b..0000000 Binary files a/docs/_static/fonts/Lato/lato-italic.ttf and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-italic.woff b/docs/_static/fonts/Lato/lato-italic.woff deleted file mode 100644 index 76114bc..0000000 Binary files a/docs/_static/fonts/Lato/lato-italic.woff and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-italic.woff2 b/docs/_static/fonts/Lato/lato-italic.woff2 deleted file mode 100644 index 3404f37..0000000 Binary files a/docs/_static/fonts/Lato/lato-italic.woff2 and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-regular.eot b/docs/_static/fonts/Lato/lato-regular.eot deleted file mode 100644 index 11e3f2a..0000000 Binary files a/docs/_static/fonts/Lato/lato-regular.eot and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-regular.ttf b/docs/_static/fonts/Lato/lato-regular.ttf deleted file mode 100644 index 74decd9..0000000 Binary files a/docs/_static/fonts/Lato/lato-regular.ttf and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-regular.woff b/docs/_static/fonts/Lato/lato-regular.woff deleted file mode 100644 index ae1307f..0000000 Binary files a/docs/_static/fonts/Lato/lato-regular.woff and /dev/null differ diff --git a/docs/_static/fonts/Lato/lato-regular.woff2 b/docs/_static/fonts/Lato/lato-regular.woff2 deleted file mode 100644 index 3bf9843..0000000 Binary files a/docs/_static/fonts/Lato/lato-regular.woff2 and /dev/null differ diff --git a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot b/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot deleted file mode 100644 index 79dc8ef..0000000 Binary files a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot and /dev/null differ diff --git a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf b/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf deleted file mode 100644 index df5d1df..0000000 Binary files a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf and /dev/null differ diff --git a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff b/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff deleted file mode 100644 index 6cb6000..0000000 Binary files a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff and /dev/null differ diff --git a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 b/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 deleted file mode 100644 index 7059e23..0000000 Binary files a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 and /dev/null differ diff --git a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot b/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot deleted file mode 100644 index 2f7ca78..0000000 Binary files a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot and /dev/null differ diff --git a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf b/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf deleted file mode 100644 index eb52a79..0000000 Binary files a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf and /dev/null differ diff --git a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff b/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff deleted file mode 100644 index f815f63..0000000 Binary files a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff and /dev/null differ diff --git a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 b/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 deleted file mode 100644 index f2c76e5..0000000 Binary files a/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 and /dev/null differ diff --git a/docs/_static/jquery.js b/docs/_static/jquery.js deleted file mode 100644 index c4c6022..0000000 --- a/docs/_static/jquery.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0"),n("table.docutils.footnote").wrap("
"),n("table.docutils.citation").wrap("
"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}if(t.length>0){$(".wy-menu-vertical .current").removeClass("current").attr("aria-expanded","false"),t.addClass("current").attr("aria-expanded","true"),t.closest("li.toctree-l1").parent().addClass("current").attr("aria-expanded","true");for(let n=1;n<=10;n++)t.closest("li.toctree-l"+n).addClass("current").attr("aria-expanded","true");t[0].scrollIntoView()}}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current").attr("aria-expanded","false"),e.siblings().find("li.current").removeClass("current").attr("aria-expanded","false");var t=e.find("> ul li");t.length&&(t.removeClass("current").attr("aria-expanded","false"),e.toggleClass("current").attr("aria-expanded",(function(n,e){return"true"==e?"false":"true"})))}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t a.language.name.localeCompare(b.language.name)); - - const languagesHTML = ` -
-
Languages
- ${languages - .map( - (translation) => ` -
- ${translation.language.code} -
- `, - ) - .join("\n")} -
- `; - return languagesHTML; - } - - function renderVersions(config) { - if (!config.versions.active.length) { - return ""; - } - const versionsHTML = ` -
-
Versions
- ${config.versions.active - .map( - (version) => ` -
- ${version.slug} -
- `, - ) - .join("\n")} -
- `; - return versionsHTML; - } - - function renderDownloads(config) { - if (!Object.keys(config.versions.current.downloads).length) { - return ""; - } - const downloadsNameDisplay = { - pdf: "PDF", - epub: "Epub", - htmlzip: "HTML", - }; - - const downloadsHTML = ` -
-
Downloads
- ${Object.entries(config.versions.current.downloads) - .map( - ([name, url]) => ` -
- ${downloadsNameDisplay[name]} -
- `, - ) - .join("\n")} -
- `; - return downloadsHTML; - } - - document.addEventListener("readthedocs-addons-data-ready", function (event) { - const config = event.detail.data(); - - const flyout = ` -
- - Read the Docs - v: ${config.versions.current.slug} - - -
-
- ${renderLanguages(config)} - ${renderVersions(config)} - ${renderDownloads(config)} -
-
On Read the Docs
-
- Project Home -
-
- Builds -
-
- Downloads -
-
-
-
Search
-
-
- -
-
-
-
- - Hosted by Read the Docs - -
-
- `; - - // Inject the generated flyout into the body HTML element. - document.body.insertAdjacentHTML("beforeend", flyout); - - // Trigger the Read the Docs Addons Search modal when clicking on the "Search docs" input from inside the flyout. - document - .querySelector("#flyout-search-form") - .addEventListener("focusin", () => { - const event = new CustomEvent("readthedocs-search-show"); - document.dispatchEvent(event); - }); - }) -} - -if (themeLanguageSelector || themeVersionSelector) { - function onSelectorSwitch(event) { - const option = event.target.selectedIndex; - const item = event.target.options[option]; - window.location.href = item.dataset.url; - } - - document.addEventListener("readthedocs-addons-data-ready", function (event) { - const config = event.detail.data(); - - const versionSwitch = document.querySelector( - "div.switch-menus > div.version-switch", - ); - if (themeVersionSelector) { - let versions = config.versions.active; - if (config.versions.current.hidden || config.versions.current.type === "external") { - versions.unshift(config.versions.current); - } - const versionSelect = ` - - `; - - versionSwitch.innerHTML = versionSelect; - versionSwitch.firstElementChild.addEventListener("change", onSelectorSwitch); - } - - const languageSwitch = document.querySelector( - "div.switch-menus > div.language-switch", - ); - - if (themeLanguageSelector) { - if (config.projects.translations.length) { - // Add the current language to the options on the selector - let languages = config.projects.translations.concat( - config.projects.current, - ); - languages = languages.sort((a, b) => - a.language.name.localeCompare(b.language.name), - ); - - const languageSelect = ` - - `; - - languageSwitch.innerHTML = languageSelect; - languageSwitch.firstElementChild.addEventListener("change", onSelectorSwitch); - } - else { - languageSwitch.remove(); - } - } - }); -} - -document.addEventListener("readthedocs-addons-data-ready", function (event) { - // Trigger the Read the Docs Addons Search modal when clicking on "Search docs" input from the topnav. - document - .querySelector("[role='search'] input") - .addEventListener("focusin", () => { - const event = new CustomEvent("readthedocs-search-show"); - document.dispatchEvent(event); - }); -}); \ No newline at end of file diff --git a/docs/_static/language_data.js b/docs/_static/language_data.js deleted file mode 100644 index 250f566..0000000 --- a/docs/_static/language_data.js +++ /dev/null @@ -1,199 +0,0 @@ -/* - * language_data.js - * ~~~~~~~~~~~~~~~~ - * - * This script contains the language-specific data used by searchtools.js, - * namely the list of stopwords, stemmer, scorer and splitter. - * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; - - -/* Non-minified version is copied as a separate JS file, is available */ - -/** - * Porter Stemmer - */ -var Stemmer = function() { - - var step2list = { - ational: 'ate', - tional: 'tion', - enci: 'ence', - anci: 'ance', - izer: 'ize', - bli: 'ble', - alli: 'al', - entli: 'ent', - eli: 'e', - ousli: 'ous', - ization: 'ize', - ation: 'ate', - ator: 'ate', - alism: 'al', - iveness: 'ive', - fulness: 'ful', - ousness: 'ous', - aliti: 'al', - iviti: 'ive', - biliti: 'ble', - logi: 'log' - }; - - var step3list = { - icate: 'ic', - ative: '', - alize: 'al', - iciti: 'ic', - ical: 'ic', - ful: '', - ness: '' - }; - - var c = "[^aeiou]"; // consonant - var v = "[aeiouy]"; // vowel - var C = c + "[^aeiouy]*"; // consonant sequence - var V = v + "[aeiou]*"; // vowel sequence - - var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 - var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 - var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 - var s_v = "^(" + C + ")?" + v; // vowel in stem - - this.stemWord = function (w) { - var stem; - var suffix; - var firstch; - var origword = w; - - if (w.length < 3) - return w; - - var re; - var re2; - var re3; - var re4; - - firstch = w.substr(0,1); - if (firstch == "y") - w = firstch.toUpperCase() + w.substr(1); - - // Step 1a - re = /^(.+?)(ss|i)es$/; - re2 = /^(.+?)([^s])s$/; - - if (re.test(w)) - w = w.replace(re,"$1$2"); - else if (re2.test(w)) - w = w.replace(re2,"$1$2"); - - // Step 1b - re = /^(.+?)eed$/; - re2 = /^(.+?)(ed|ing)$/; - if (re.test(w)) { - var fp = re.exec(w); - re = new RegExp(mgr0); - if (re.test(fp[1])) { - re = /.$/; - w = w.replace(re,""); - } - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1]; - re2 = new RegExp(s_v); - if (re2.test(stem)) { - w = stem; - re2 = /(at|bl|iz)$/; - re3 = new RegExp("([^aeiouylsz])\\1$"); - re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re2.test(w)) - w = w + "e"; - else if (re3.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - else if (re4.test(w)) - w = w + "e"; - } - } - - // Step 1c - re = /^(.+?)y$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(s_v); - if (re.test(stem)) - w = stem + "i"; - } - - // Step 2 - re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step2list[suffix]; - } - - // Step 3 - re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step3list[suffix]; - } - - // Step 4 - re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; - re2 = /^(.+?)(s|t)(ion)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - if (re.test(stem)) - w = stem; - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1] + fp[2]; - re2 = new RegExp(mgr1); - if (re2.test(stem)) - w = stem; - } - - // Step 5 - re = /^(.+?)e$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - re2 = new RegExp(meq1); - re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) - w = stem; - } - re = /ll$/; - re2 = new RegExp(mgr1); - if (re.test(w) && re2.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - - // and turn initial Y back to y - if (firstch == "y") - w = firstch.toLowerCase() + w.substr(1); - return w; - } -} - diff --git a/docs/_static/minus.png b/docs/_static/minus.png deleted file mode 100644 index d96755f..0000000 Binary files a/docs/_static/minus.png and /dev/null differ diff --git a/docs/_static/plus.png b/docs/_static/plus.png deleted file mode 100644 index 7107cec..0000000 Binary files a/docs/_static/plus.png and /dev/null differ diff --git a/docs/_static/pygments.css b/docs/_static/pygments.css deleted file mode 100644 index 6f8b210..0000000 --- a/docs/_static/pygments.css +++ /dev/null @@ -1,75 +0,0 @@ -pre { line-height: 125%; } -td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } -span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } -td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } -span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } -.highlight .hll { background-color: #ffffcc } -.highlight { background: #f8f8f8; } -.highlight .c { color: #3D7B7B; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #F00 } /* Error */ -.highlight .k { color: #008000; font-weight: bold } /* Keyword */ -.highlight .o { color: #666 } /* Operator */ -.highlight .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */ -.highlight .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #9C6500 } /* Comment.Preproc */ -.highlight .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */ -.highlight .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ -.highlight .gr { color: #E40000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #008400 } /* Generic.Inserted */ -.highlight .go { color: #717171 } /* Generic.Output */ -.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #04D } /* Generic.Traceback */ -.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #008000 } /* Keyword.Pseudo */ -.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #B00040 } /* Keyword.Type */ -.highlight .m { color: #666 } /* Literal.Number */ -.highlight .s { color: #BA2121 } /* Literal.String */ -.highlight .na { color: #687822 } /* Name.Attribute */ -.highlight .nb { color: #008000 } /* Name.Builtin */ -.highlight .nc { color: #00F; font-weight: bold } /* Name.Class */ -.highlight .no { color: #800 } /* Name.Constant */ -.highlight .nd { color: #A2F } /* Name.Decorator */ -.highlight .ni { color: #717171; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */ -.highlight .nf { color: #00F } /* Name.Function */ -.highlight .nl { color: #767600 } /* Name.Label */ -.highlight .nn { color: #00F; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #19177C } /* Name.Variable */ -.highlight .ow { color: #A2F; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #BBB } /* Text.Whitespace */ -.highlight .mb { color: #666 } /* Literal.Number.Bin */ -.highlight .mf { color: #666 } /* Literal.Number.Float */ -.highlight .mh { color: #666 } /* Literal.Number.Hex */ -.highlight .mi { color: #666 } /* Literal.Number.Integer */ -.highlight .mo { color: #666 } /* Literal.Number.Oct */ -.highlight .sa { color: #BA2121 } /* Literal.String.Affix */ -.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ -.highlight .sc { color: #BA2121 } /* Literal.String.Char */ -.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */ -.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #BA2121 } /* Literal.String.Double */ -.highlight .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ -.highlight .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */ -.highlight .sx { color: #008000 } /* Literal.String.Other */ -.highlight .sr { color: #A45A77 } /* Literal.String.Regex */ -.highlight .s1 { color: #BA2121 } /* Literal.String.Single */ -.highlight .ss { color: #19177C } /* Literal.String.Symbol */ -.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ -.highlight .fm { color: #00F } /* Name.Function.Magic */ -.highlight .vc { color: #19177C } /* Name.Variable.Class */ -.highlight .vg { color: #19177C } /* Name.Variable.Global */ -.highlight .vi { color: #19177C } /* Name.Variable.Instance */ -.highlight .vm { color: #19177C } /* Name.Variable.Magic */ -.highlight .il { color: #666 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js deleted file mode 100644 index 97d56a7..0000000 --- a/docs/_static/searchtools.js +++ /dev/null @@ -1,566 +0,0 @@ -/* - * searchtools.js - * ~~~~~~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for the full-text search. - * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ -"use strict"; - -/** - * Simple result scoring code. - */ -if (typeof Scorer === "undefined") { - var Scorer = { - // Implement the following function to further tweak the score for each result - // The function takes a result array [docname, title, anchor, descr, score, filename] - // and returns the new score. - /* - score: result => { - const [docname, title, anchor, descr, score, filename] = result - return score - }, - */ - - // query matches the full name of an object - objNameMatch: 11, - // or matches in the last dotted part of the object name - objPartialMatch: 6, - // Additive scores depending on the priority of the object - objPrio: { - 0: 15, // used to be importantResults - 1: 5, // used to be objectResults - 2: -5, // used to be unimportantResults - }, - // Used when the priority is not in the mapping. - objPrioDefault: 0, - - // query found in title - title: 15, - partialTitle: 7, - // query found in terms - term: 5, - partialTerm: 2, - }; -} - -const _removeChildren = (element) => { - while (element && element.lastChild) element.removeChild(element.lastChild); -}; - -/** - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping - */ -const _escapeRegExp = (string) => - string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string - -const _displayItem = (item, searchTerms) => { - const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; - const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT; - const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; - const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; - const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; - - const [docName, title, anchor, descr, score, _filename] = item; - - let listItem = document.createElement("li"); - let requestUrl; - let linkUrl; - if (docBuilder === "dirhtml") { - // dirhtml builder - let dirname = docName + "/"; - if (dirname.match(/\/index\/$/)) - dirname = dirname.substring(0, dirname.length - 6); - else if (dirname === "index/") dirname = ""; - requestUrl = docUrlRoot + dirname; - linkUrl = requestUrl; - } else { - // normal html builders - requestUrl = docUrlRoot + docName + docFileSuffix; - linkUrl = docName + docLinkSuffix; - } - let linkEl = listItem.appendChild(document.createElement("a")); - linkEl.href = linkUrl + anchor; - linkEl.dataset.score = score; - linkEl.innerHTML = title; - if (descr) - listItem.appendChild(document.createElement("span")).innerHTML = - " (" + descr + ")"; - else if (showSearchSummary) - fetch(requestUrl) - .then((responseData) => responseData.text()) - .then((data) => { - if (data) - listItem.appendChild( - Search.makeSearchSummary(data, searchTerms) - ); - }); - Search.output.appendChild(listItem); -}; -const _finishSearch = (resultCount) => { - Search.stopPulse(); - Search.title.innerText = _("Search Results"); - if (!resultCount) - Search.status.innerText = Documentation.gettext( - "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." - ); - else - Search.status.innerText = _( - `Search finished, found ${resultCount} page(s) matching the search query.` - ); -}; -const _displayNextItem = ( - results, - resultCount, - searchTerms -) => { - // results left, load the summary and display it - // this is intended to be dynamic (don't sub resultsCount) - if (results.length) { - _displayItem(results.pop(), searchTerms); - setTimeout( - () => _displayNextItem(results, resultCount, searchTerms), - 5 - ); - } - // search finished, update title and status message - else _finishSearch(resultCount); -}; - -/** - * Default splitQuery function. Can be overridden in ``sphinx.search`` with a - * custom function per language. - * - * The regular expression works by splitting the string on consecutive characters - * that are not Unicode letters, numbers, underscores, or emoji characters. - * This is the same as ``\W+`` in Python, preserving the surrogate pair area. - */ -if (typeof splitQuery === "undefined") { - var splitQuery = (query) => query - .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) - .filter(term => term) // remove remaining empty strings -} - -/** - * Search Module - */ -const Search = { - _index: null, - _queued_query: null, - _pulse_status: -1, - - htmlToText: (htmlString) => { - const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); - htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); - const docContent = htmlElement.querySelector('[role="main"]'); - if (docContent !== undefined) return docContent.textContent; - console.warn( - "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." - ); - return ""; - }, - - init: () => { - const query = new URLSearchParams(window.location.search).get("q"); - document - .querySelectorAll('input[name="q"]') - .forEach((el) => (el.value = query)); - if (query) Search.performSearch(query); - }, - - loadIndex: (url) => - (document.body.appendChild(document.createElement("script")).src = url), - - setIndex: (index) => { - Search._index = index; - if (Search._queued_query !== null) { - const query = Search._queued_query; - Search._queued_query = null; - Search.query(query); - } - }, - - hasIndex: () => Search._index !== null, - - deferQuery: (query) => (Search._queued_query = query), - - stopPulse: () => (Search._pulse_status = -1), - - startPulse: () => { - if (Search._pulse_status >= 0) return; - - const pulse = () => { - Search._pulse_status = (Search._pulse_status + 1) % 4; - Search.dots.innerText = ".".repeat(Search._pulse_status); - if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); - }; - pulse(); - }, - - /** - * perform a search for something (or wait until index is loaded) - */ - performSearch: (query) => { - // create the required interface elements - const searchText = document.createElement("h2"); - searchText.textContent = _("Searching"); - const searchSummary = document.createElement("p"); - searchSummary.classList.add("search-summary"); - searchSummary.innerText = ""; - const searchList = document.createElement("ul"); - searchList.classList.add("search"); - - const out = document.getElementById("search-results"); - Search.title = out.appendChild(searchText); - Search.dots = Search.title.appendChild(document.createElement("span")); - Search.status = out.appendChild(searchSummary); - Search.output = out.appendChild(searchList); - - const searchProgress = document.getElementById("search-progress"); - // Some themes don't use the search progress node - if (searchProgress) { - searchProgress.innerText = _("Preparing search..."); - } - Search.startPulse(); - - // index already loaded, the browser was quick! - if (Search.hasIndex()) Search.query(query); - else Search.deferQuery(query); - }, - - /** - * execute search (requires search index to be loaded) - */ - query: (query) => { - const filenames = Search._index.filenames; - const docNames = Search._index.docnames; - const titles = Search._index.titles; - const allTitles = Search._index.alltitles; - const indexEntries = Search._index.indexentries; - - // stem the search terms and add them to the correct list - const stemmer = new Stemmer(); - const searchTerms = new Set(); - const excludedTerms = new Set(); - const highlightTerms = new Set(); - const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); - splitQuery(query.trim()).forEach((queryTerm) => { - const queryTermLower = queryTerm.toLowerCase(); - - // maybe skip this "word" - // stopwords array is from language_data.js - if ( - stopwords.indexOf(queryTermLower) !== -1 || - queryTerm.match(/^\d+$/) - ) - return; - - // stem the word - let word = stemmer.stemWord(queryTermLower); - // select the correct list - if (word[0] === "-") excludedTerms.add(word.substr(1)); - else { - searchTerms.add(word); - highlightTerms.add(queryTermLower); - } - }); - - if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js - localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) - } - - // console.debug("SEARCH: searching for:"); - // console.info("required: ", [...searchTerms]); - // console.info("excluded: ", [...excludedTerms]); - - // array of [docname, title, anchor, descr, score, filename] - let results = []; - _removeChildren(document.getElementById("search-progress")); - - const queryLower = query.toLowerCase(); - for (const [title, foundTitles] of Object.entries(allTitles)) { - if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { - for (const [file, id] of foundTitles) { - let score = Math.round(100 * queryLower.length / title.length) - results.push([ - docNames[file], - titles[file] !== title ? `${titles[file]} > ${title}` : title, - id !== null ? "#" + id : "", - null, - score, - filenames[file], - ]); - } - } - } - - // search for explicit entries in index directives - for (const [entry, foundEntries] of Object.entries(indexEntries)) { - if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { - for (const [file, id] of foundEntries) { - let score = Math.round(100 * queryLower.length / entry.length) - results.push([ - docNames[file], - titles[file], - id ? "#" + id : "", - null, - score, - filenames[file], - ]); - } - } - } - - // lookup as object - objectTerms.forEach((term) => - results.push(...Search.performObjectSearch(term, objectTerms)) - ); - - // lookup as search terms in fulltext - results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); - - // let the scorer override scores with a custom scoring function - if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); - - // now sort the results by score (in opposite order of appearance, since the - // display function below uses pop() to retrieve items) and then - // alphabetically - results.sort((a, b) => { - const leftScore = a[4]; - const rightScore = b[4]; - if (leftScore === rightScore) { - // same score: sort alphabetically - const leftTitle = a[1].toLowerCase(); - const rightTitle = b[1].toLowerCase(); - if (leftTitle === rightTitle) return 0; - return leftTitle > rightTitle ? -1 : 1; // inverted is intentional - } - return leftScore > rightScore ? 1 : -1; - }); - - // remove duplicate search results - // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept - let seen = new Set(); - results = results.reverse().reduce((acc, result) => { - let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); - if (!seen.has(resultStr)) { - acc.push(result); - seen.add(resultStr); - } - return acc; - }, []); - - results = results.reverse(); - - // for debugging - //Search.lastresults = results.slice(); // a copy - // console.info("search results:", Search.lastresults); - - // print the results - _displayNextItem(results, results.length, searchTerms); - }, - - /** - * search for object names - */ - performObjectSearch: (object, objectTerms) => { - const filenames = Search._index.filenames; - const docNames = Search._index.docnames; - const objects = Search._index.objects; - const objNames = Search._index.objnames; - const titles = Search._index.titles; - - const results = []; - - const objectSearchCallback = (prefix, match) => { - const name = match[4] - const fullname = (prefix ? prefix + "." : "") + name; - const fullnameLower = fullname.toLowerCase(); - if (fullnameLower.indexOf(object) < 0) return; - - let score = 0; - const parts = fullnameLower.split("."); - - // check for different match types: exact matches of full name or - // "last name" (i.e. last dotted part) - if (fullnameLower === object || parts.slice(-1)[0] === object) - score += Scorer.objNameMatch; - else if (parts.slice(-1)[0].indexOf(object) > -1) - score += Scorer.objPartialMatch; // matches in last name - - const objName = objNames[match[1]][2]; - const title = titles[match[0]]; - - // If more than one term searched for, we require other words to be - // found in the name/title/description - const otherTerms = new Set(objectTerms); - otherTerms.delete(object); - if (otherTerms.size > 0) { - const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); - if ( - [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) - ) - return; - } - - let anchor = match[3]; - if (anchor === "") anchor = fullname; - else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; - - const descr = objName + _(", in ") + title; - - // add custom score for some objects according to scorer - if (Scorer.objPrio.hasOwnProperty(match[2])) - score += Scorer.objPrio[match[2]]; - else score += Scorer.objPrioDefault; - - results.push([ - docNames[match[0]], - fullname, - "#" + anchor, - descr, - score, - filenames[match[0]], - ]); - }; - Object.keys(objects).forEach((prefix) => - objects[prefix].forEach((array) => - objectSearchCallback(prefix, array) - ) - ); - return results; - }, - - /** - * search for full-text terms in the index - */ - performTermsSearch: (searchTerms, excludedTerms) => { - // prepare search - const terms = Search._index.terms; - const titleTerms = Search._index.titleterms; - const filenames = Search._index.filenames; - const docNames = Search._index.docnames; - const titles = Search._index.titles; - - const scoreMap = new Map(); - const fileMap = new Map(); - - // perform the search on the required terms - searchTerms.forEach((word) => { - const files = []; - const arr = [ - { files: terms[word], score: Scorer.term }, - { files: titleTerms[word], score: Scorer.title }, - ]; - // add support for partial matches - if (word.length > 2) { - const escapedWord = _escapeRegExp(word); - Object.keys(terms).forEach((term) => { - if (term.match(escapedWord) && !terms[word]) - arr.push({ files: terms[term], score: Scorer.partialTerm }); - }); - Object.keys(titleTerms).forEach((term) => { - if (term.match(escapedWord) && !titleTerms[word]) - arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); - }); - } - - // no match but word was a required one - if (arr.every((record) => record.files === undefined)) return; - - // found search word in contents - arr.forEach((record) => { - if (record.files === undefined) return; - - let recordFiles = record.files; - if (recordFiles.length === undefined) recordFiles = [recordFiles]; - files.push(...recordFiles); - - // set score for the word in each file - recordFiles.forEach((file) => { - if (!scoreMap.has(file)) scoreMap.set(file, {}); - scoreMap.get(file)[word] = record.score; - }); - }); - - // create the mapping - files.forEach((file) => { - if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) - fileMap.get(file).push(word); - else fileMap.set(file, [word]); - }); - }); - - // now check if the files don't contain excluded terms - const results = []; - for (const [file, wordList] of fileMap) { - // check if all requirements are matched - - // as search terms with length < 3 are discarded - const filteredTermCount = [...searchTerms].filter( - (term) => term.length > 2 - ).length; - if ( - wordList.length !== searchTerms.size && - wordList.length !== filteredTermCount - ) - continue; - - // ensure that none of the excluded terms is in the search result - if ( - [...excludedTerms].some( - (term) => - terms[term] === file || - titleTerms[term] === file || - (terms[term] || []).includes(file) || - (titleTerms[term] || []).includes(file) - ) - ) - break; - - // select one (max) score for the file. - const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); - // add result to the result list - results.push([ - docNames[file], - titles[file], - "", - null, - score, - filenames[file], - ]); - } - return results; - }, - - /** - * helper function to return a node containing the - * search summary for a given text. keywords is a list - * of stemmed words. - */ - makeSearchSummary: (htmlText, keywords) => { - const text = Search.htmlToText(htmlText); - if (text === "") return null; - - const textLower = text.toLowerCase(); - const actualStartPosition = [...keywords] - .map((k) => textLower.indexOf(k.toLowerCase())) - .filter((i) => i > -1) - .slice(-1)[0]; - const startWithContext = Math.max(actualStartPosition - 120, 0); - - const top = startWithContext === 0 ? "" : "..."; - const tail = startWithContext + 240 < text.length ? "..." : ""; - - let summary = document.createElement("p"); - summary.classList.add("context"); - summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; - - return summary; - }, -}; - -_ready(Search.init); diff --git a/docs/_static/sphinx_highlight.js b/docs/_static/sphinx_highlight.js deleted file mode 100644 index aae669d..0000000 --- a/docs/_static/sphinx_highlight.js +++ /dev/null @@ -1,144 +0,0 @@ -/* Highlighting utilities for Sphinx HTML documentation. */ -"use strict"; - -const SPHINX_HIGHLIGHT_ENABLED = true - -/** - * highlight a given string on a node by wrapping it in - * span elements with the given class name. - */ -const _highlight = (node, addItems, text, className) => { - if (node.nodeType === Node.TEXT_NODE) { - const val = node.nodeValue; - const parent = node.parentNode; - const pos = val.toLowerCase().indexOf(text); - if ( - pos >= 0 && - !parent.classList.contains(className) && - !parent.classList.contains("nohighlight") - ) { - let span; - - const closestNode = parent.closest("body, svg, foreignObject"); - const isInSVG = closestNode && closestNode.matches("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.classList.add(className); - } - - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - parent.insertBefore( - span, - parent.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling - ) - ); - node.nodeValue = val.substr(0, pos); - - if (isInSVG) { - const rect = document.createElementNS( - "http://www.w3.org/2000/svg", - "rect" - ); - const bbox = parent.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute("class", className); - addItems.push({ parent: parent, target: rect }); - } - } - } else if (node.matches && !node.matches("button, select, textarea")) { - node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); - } -}; -const _highlightText = (thisNode, text, className) => { - let addItems = []; - _highlight(thisNode, addItems, text, className); - addItems.forEach((obj) => - obj.parent.insertAdjacentElement("beforebegin", obj.target) - ); -}; - -/** - * Small JavaScript module for the documentation. - */ -const SphinxHighlight = { - - /** - * highlight the search words provided in localstorage in the text - */ - highlightSearchWords: () => { - if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight - - // get and clear terms from localstorage - const url = new URL(window.location); - const highlight = - localStorage.getItem("sphinx_highlight_terms") - || url.searchParams.get("highlight") - || ""; - localStorage.removeItem("sphinx_highlight_terms") - url.searchParams.delete("highlight"); - window.history.replaceState({}, "", url); - - // get individual terms from highlight string - const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); - if (terms.length === 0) return; // nothing to do - - // There should never be more than one element matching "div.body" - const divBody = document.querySelectorAll("div.body"); - const body = divBody.length ? divBody[0] : document.querySelector("body"); - window.setTimeout(() => { - terms.forEach((term) => _highlightText(body, term, "highlighted")); - }, 10); - - const searchBox = document.getElementById("searchbox"); - if (searchBox === null) return; - searchBox.appendChild( - document - .createRange() - .createContextualFragment( - '" - ) - ); - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords: () => { - document - .querySelectorAll("#searchbox .highlight-link") - .forEach((el) => el.remove()); - document - .querySelectorAll("span.highlighted") - .forEach((el) => el.classList.remove("highlighted")); - localStorage.removeItem("sphinx_highlight_terms") - }, - - initEscapeListener: () => { - // only install a listener if it is really needed - if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; - - document.addEventListener("keydown", (event) => { - // bail for input elements - if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; - // bail with special keys - if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; - if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { - SphinxHighlight.hideSearchWords(); - event.preventDefault(); - } - }); - }, -}; - -_ready(SphinxHighlight.highlightSearchWords); -_ready(SphinxHighlight.initEscapeListener); diff --git a/docs/api/modules.html b/docs/api/modules.html deleted file mode 100644 index d89a04b..0000000 --- a/docs/api/modules.html +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - vcon — vcon 0.7.0 documentation - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

vcon

-
- -
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/api/vcon.html b/docs/api/vcon.html deleted file mode 100644 index 0615717..0000000 --- a/docs/api/vcon.html +++ /dev/null @@ -1,3501 +0,0 @@ - - - - - - - - - vcon package — vcon 0.7.0 documentation - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

vcon package

-
-

Submodules

-
-
-

vcon.civic_address module

-
-
-class vcon.civic_address.CivicAddress(country: str | None = None, a1: str | None = None, a2: str | None = None, a3: str | None = None, a4: str | None = None, a5: str | None = None, a6: str | None = None, prd: str | None = None, pod: str | None = None, sts: str | None = None, hno: str | None = None, hns: str | None = None, lmk: str | None = None, loc: str | None = None, flr: str | None = None, nam: str | None = None, pc: str | None = None)[source]
-

Bases: object

-

A class representing civic address information according to GEOPRIV specification.

-

This class supports all civic address fields defined in RFC 4776 (GEOPRIV) -and is used within vCon Party objects to provide location information.

-

Administrative areas (a1-a6): -- a1: Administrative area 1 (e.g., state or province) -- a2: Administrative area 2 (e.g., county or municipality) -- a3: Administrative area 3 (e.g., city or town) -- a4: Administrative area 4 (e.g., neighborhood or district) -- a5: Administrative area 5 (e.g., postal code) -- a6: Administrative area 6 (e.g., building or floor)

-

Street and building information: -- sts: Street name -- hno: House number -- hns: House name -- prd: Premier (e.g., department or suite number) -- flr: Floor

-

Location and identification: -- country: Country code (ISO 3166-1 alpha-2) -- pc: Postal code -- nam: Name of the location -- lmk: Landmark name -- loc: Location name -- pod: Post office box identifier

-

All fields are optional and follow the GEOPRIV specification format. -Field names are in lowercase as required by the vCon specification.

-
-
-__init__(country: str | None = None, a1: str | None = None, a2: str | None = None, a3: str | None = None, a4: str | None = None, a5: str | None = None, a6: str | None = None, prd: str | None = None, pod: str | None = None, sts: str | None = None, hno: str | None = None, hns: str | None = None, lmk: str | None = None, loc: str | None = None, flr: str | None = None, nam: str | None = None, pc: str | None = None)[source]
-

Initialize a new CivicAddress object.

-
-
Parameters:
-
    -
  • country (str) – Country code (ISO 3166-1 alpha-2)

  • -
  • a1 (str) – Administrative area 1 (e.g. state or province)

  • -
  • a2 (str) – Administrative area 2 (e.g. county or municipality)

  • -
  • a3 (str) – Administrative area 3 (e.g. city or town)

  • -
  • a4 (str) – Administrative area 4 (e.g. neighborhood or district)

  • -
  • a5 (str) – Administrative area 5 (e.g. postal code)

  • -
  • a6 (str) – Administrative area 6 (e.g. building or floor)

  • -
  • prd (str) – Premier (e.g. department or suite number)

  • -
  • pod (str) – Post office box identifier

  • -
  • sts (str) – Street name

  • -
  • hno (str) – House number

  • -
  • hns (str) – House name

  • -
  • lmk (str) – Landmark name

  • -
  • loc (str) – Location name

  • -
  • flr (str) – Floor

  • -
  • nam (str) – Name of the location

  • -
  • pc (str) – Postal code

  • -
-
-
-
- -
-
-to_dict() → dict[str, Optional[str]][source]
-

Convert the CivicAddress object to a dictionary.

-

The dictionary keys are the attribute names of the object, and the -values are the attribute values.

-
-
Returns:
-

A dictionary of the object’s attributes

-
-
Return type:
-

dict[str, Optional[str]]

-
-
-
- -
- -
-
-

vcon.dialog module

-
-
-class vcon.dialog.Dialog(type: str, start: datetime | str, parties: List[int], originator: int | None = None, mediatype: str | None = None, filename: str | None = None, body: str | None = None, encoding: str | None = None, url: str | None = None, disposition: str | None = None, party_history: List[PartyHistory] | None = None, transferee: int | None = None, transferor: int | None = None, transfer_target: int | None = None, original: int | None = None, consultation: int | None = None, target_dialog: int | None = None, campaign: str | None = None, interaction: str | None = None, skill: str | None = None, duration: float | None = None, meta: dict | None = None, metadata: Dict[str, Any] | None = None, transfer: Dict[str, Any] | None = None, signaling: Dict[str, Any] | None = None, resolution: str | None = None, frame_rate: float | None = None, codec: str | None = None, bitrate: int | None = None, thumbnail: str | None = None, session_id: Dict[str, str] | List[Dict[str, str]] | None = None, content_hash: str | None = None, application: str | None = None, message_id: str | None = None, **kwargs)[source]
-

Bases: object

-

A class representing a dialog segment in a vCon conversation.

-

A dialog represents a piece of conversation content, which can be: -- text: Text-based communication (email, chat, SMS) -- recording: Audio/video recording of the conversation -- transfer: Call transfer operation between parties -- incomplete: Failed or incomplete conversation setup -- video: Video content with metadata

-

Dialog content can be stored inline or referenced externally: -- Inline: Content stored directly in the body field -- External: Content referenced via URL with content_hash for integrity

-

Media support: -- Audio formats: WAV, MP3, MP4, OGG, WebM, AAC -- Video formats: MP4, WebM, AVI, MKV, MOV, FLV, 3GP -- Text formats: Plain text, multipart messages -- Images: JPEG, TIFF, PDF

-

New in vCon 0.4.0: -- session_id: Session identifier for tracking -- content_hash: Hash for externally referenced files (replaces alg/signature) -- application: Application identifier for the dialog -- message_id: Message identifier for email/text dialogs -- Updated media type validation with specification-compliant types -- New disposition values for incomplete dialogs -- Party history with event tracking (join, drop, hold, unhold, mute, unmute)

-

Transfer dialog features: -- transfer_target: Target party for transfers -- target_dialog: Target dialog reference -- Support for consultation and original call tracking

-
-
-MIME_TYPES = ['text/plain', 'audio/x-wav', 'audio/wav', 'audio/wave', 'audio/mpeg', 'audio/mp3', 'audio/x-mp3', 'audio/x-mp4', 'audio/ogg', 'audio/webm', 'audio/x-m4a', 'audio/aac', 'video/x-mp4', 'video/ogg', 'video/mp4', 'video/quicktime', 'video/webm', 'video/x-msvideo', 'video/x-matroska', 'video/mpeg', 'video/x-flv', 'video/3gpp', 'video/x-m4v', 'multipart/mixed', 'message/rfc822', 'image/jpeg', 'image/tiff', 'application/pdf', 'application/json']
-
- -
-
-VALID_DISPOSITIONS = ['no-answer', 'congestion', 'failed', 'busy', 'hung-up', 'voicemail-no-message']
-
- -
-
-VALID_TYPES = ['recording', 'text', 'transfer', 'incomplete', 'audio', 'video']
-
- -
-
-__init__(type: str, start: datetime | str, parties: List[int], originator: int | None = None, mediatype: str | None = None, filename: str | None = None, body: str | None = None, encoding: str | None = None, url: str | None = None, disposition: str | None = None, party_history: List[PartyHistory] | None = None, transferee: int | None = None, transferor: int | None = None, transfer_target: int | None = None, original: int | None = None, consultation: int | None = None, target_dialog: int | None = None, campaign: str | None = None, interaction: str | None = None, skill: str | None = None, duration: float | None = None, meta: dict | None = None, metadata: Dict[str, Any] | None = None, transfer: Dict[str, Any] | None = None, signaling: Dict[str, Any] | None = None, resolution: str | None = None, frame_rate: float | None = None, codec: str | None = None, bitrate: int | None = None, thumbnail: str | None = None, session_id: Dict[str, str] | List[Dict[str, str]] | None = None, content_hash: str | None = None, application: str | None = None, message_id: str | None = None, **kwargs) → None[source]
-

Initialize a Dialog object. -:param type: the type of the dialog (e.g. “text”, “recording”, “transfer”, “incomplete”, “video”) -:type type: str -:param start: the start time of the dialog -:type start: datetime -:param parties: the parties involved in the dialog -:type parties: List[int] -:param originator: the party that originated the dialog -:type originator: int or None -:param mediatype: the MIME type of the dialog body -:type mediatype: str or None -:param filename: the filename of the dialog body -:type filename: str or None -:param body: the body of the dialog -:type body: str or None -:param encoding: the encoding of the dialog body -:type encoding: str or None -:param url: the URL of the dialog -:type url: str or None -:param disposition: the disposition of the dialog -:type disposition: str or None -:param party_history: the history of parties involved in the dialog -:type party_history: List[PartyHistory] or None -:param transferee: the party that the dialog was transferred to -:type transferee: int or None -:param transferor: the party that transferred the dialog -:type transferor: int or None -:param transfer_target: the target of the transfer -:type transfer_target: int or None -:param original: the original dialog -:type original: int or None -:param consultation: the consultation dialog -:type consultation: int or None -:param target_dialog: the target dialog -:type target_dialog: int or None -:param campaign: the campaign that the dialog is associated with -:type campaign: str or None -:param interaction: the interaction that the dialog is associated with -:type interaction: str or None -:param skill: the skill that the dialog is associated with -:type skill: str or None -:param duration: the duration of the dialog -:type duration: float or None -:param meta: additional metadata for the dialog -:type meta: dict or None -:param metadata: structured metadata for the dialog (newer format) -:type metadata: dict or None -:param transfer: transfer-specific information -:type transfer: dict or None -:param signaling: signaling-specific information -:type signaling: dict or None -:param resolution: video resolution (e.g., “1920x1080”) -:type resolution: str or None -:param frame_rate: video frame rate in fps -:type frame_rate: float or None -:param codec: video codec (e.g., “H.264”, “H.265”) -:type codec: str or None -:param bitrate: video bitrate in kbps -:type bitrate: int or None -:param thumbnail: base64-encoded thumbnail image -:type thumbnail: str or None -:param session_id: Session identifier -:type session_id: str or None -:param content_hash: Hash for externally referenced files (replaces alg and signature) -:type content_hash: str or None -:param application: Application identifier for the dialog -:type application: str or None -:param message_id: Message identifier for email/text dialogs -:type message_id: str or None -:param kwargs: Additional attributes to be set on the dialog

-
- -
-
-add_external_data(url: str, filename: str, mediatype: str) → None[source]
-

Add external data to the dialog.

-
-
Parameters:
-

url (str) – the URL of the external data

-
-
Returns:
-

None

-
-
Return type:
-

None

-
-
-
- -
-
-add_image_data(image_path: str, mediatype: str | None = None) → None[source]
-

Add image data to the dialog from a local file.

-
-
Parameters:
-
    -
  • image_path (str) – Path to the image file

  • -
  • mediatype (str or None) – MIME type of the image (optional, auto-detected if not provided)

  • -
-
-
Returns:
-

None

-
-
Return type:
-

None

-
-
-
- -
-
-add_inline_data(body: str, filename: str, mediatype: str) → None[source]
-

Add inline data to the dialog.

-
-
Parameters:
-
    -
  • body (str) – the body of the inline data

  • -
  • filename (str) – the filename of the inline data

  • -
  • mediatype (str) – the mediatype of the inline data

  • -
-
-
Returns:
-

None

-
-
Return type:
-

None

-
-
-
- -
-
-add_streaming_video_reference(reference_id, mediatype, metadata=None) → None[source]
-

Add a reference to a streamable video.

-
-
Parameters:
-
    -
  • reference_id – Unique identifier for the streamable video

  • -
  • mediatype – MIME type of the video

  • -
  • metadata – Optional video metadata

  • -
-
-
Returns:
-

None

-
-
-
- -
-
-add_video_data(video_data, filename=None, mediatype=None, inline=True, metadata=None) → None[source]
-

Add video data to the dialog.

-
-
Parameters:
-
    -
  • video_data – Binary video data or URL to video

  • -
  • filename – Name of the video file

  • -
  • mediatype – MIME type of the video, or auto-detected from filename if None

  • -
  • inline – Whether to include the video as inline content (True) or external reference (False)

  • -
  • metadata – Optional video metadata to include

  • -
-
-
Returns:
-

None

-
-
-
- -
-
-add_video_with_optimal_storage(video_data, filename, mediatype=None, size_threshold_mb=10) → None[source]
-

Add video with the optimal storage method based on size.

-
-
Parameters:
-
    -
  • video_data – Binary video data or URL

  • -
  • filename – Name of the video file

  • -
  • mediatype – MIME type of the video (optional)

  • -
  • size_threshold_mb – Size threshold in MB for inline vs external storage

  • -
-
-
Returns:
-

None

-
-
-
- -
-
-calculate_content_hash(algorithm: str = 'sha256') → str[source]
-

Calculate the content hash for the dialog body.

-
-
Parameters:
-

algorithm (str) – The hash algorithm to use (default: “sha256”)

-
-
Returns:
-

The calculated hash value

-
-
Return type:
-

str

-
-
-
- -
-
-extract_image_metadata(image_data: bytes, mediatype: str) → None[source]
-

Extract metadata from image data and add it to the dialog metadata.

-
-
Parameters:
-
    -
  • image_data (bytes) – Raw image data

  • -
  • mediatype (str) – MIME type of the image

  • -
-
-
Returns:
-

None

-
-
Return type:
-

None

-
-
-
- -
-
-extract_video_metadata(video_path=None) → dict[source]
-

Extract comprehensive metadata from video content using FFmpeg.

-
-
Parameters:
-

video_path – Optional path to video file. If None, uses the dialog’s content.

-
-
Returns:
-

Dictionary containing detailed video metadata

-
-
-
- -
-
-generate_thumbnail(max_size: Tuple[int, int] = (200, 200)) → str | None[source]
-

Generate a thumbnail for the image and return it as a base64-encoded string.

-
-
Parameters:
-

max_size (Tuple[int, int]) – Maximum thumbnail dimensions (width, height)

-
-
Returns:
-

Base64-encoded thumbnail or None if generation fails

-
-
Return type:
-

str or None

-
-
-
- -
-
-get_content_hash() → str | None[source]
-

Get the content hash for externally referenced files.

-
-
Returns:
-

The content hash if set, None otherwise

-
-
Return type:
-

str or None

-
-
-
- -
-
-get_session_id() → Dict[str, str] | List[Dict[str, str]] | None[source]
-

Get the session identifier for this dialog.

-
-
Returns:
-

The session identifier if set, None otherwise

-
-
Return type:
-

str or None

-
-
-
- -
-
-get_video_format_from_mediatype(mediatype) → str[source]
-

Get the video format name from a MIME type.

-
-
Parameters:
-

mediatype – MIME type of the video

-
-
Returns:
-

Format name (mp4, mov, etc.)

-
-
-
- -
-
-has_thumbnail() → bool[source]
-

Check if the video has a thumbnail.

-
-
Returns:
-

True if the video has a thumbnail, False otherwise

-
-
-
- -
-
-is_audio() → bool[source]
-

Check if the dialog has audio content. -:return: True if the dialog has audio content, False otherwise -:rtype: bool

-
- -
-
-is_email() → bool[source]
-

Check if the dialog is an email dialog. -:return: True if the dialog is an email dialog, False otherwise -:rtype: bool

-
- -
-
-is_external_data() → bool[source]
-

Check if the dialog is an external data dialog.

-
-
Returns:
-

True if the dialog is an external data dialog, False otherwise

-
-
Return type:
-

bool

-
-
-
- -
-
-is_external_data_changed() → bool[source]
-

Check to see if it’s an external data dialog and verify the content hash.

-
-
Returns:
-

True if the dialog is an external data dialog and the contents are valid, False otherwise

-
-
Return type:
-

bool

-
-
-
- -
-
-is_image() → bool[source]
-

Check if the dialog has image content.

-
-
Returns:
-

True if the dialog has image content, False otherwise

-
-
Return type:
-

bool

-
-
-
- -
-
-is_incomplete() → bool[source]
-

Check if the dialog is an incomplete dialog. -:return: True if the dialog is an incomplete dialog, False otherwise -:rtype: bool

-
- -
-
-is_inline_data() → bool[source]
-

Check if the dialog is an inline data dialog.

-
-
Returns:
-

True if the dialog is an inline data dialog, False otherwise

-
-
Return type:
-

bool

-
-
-
- -
-
-is_pdf() → bool[source]
-

Check if the dialog has PDF content.

-
-
Returns:
-

True if the dialog has PDF content, False otherwise

-
-
Return type:
-

bool

-
-
-
- -
-
-is_recording() → bool[source]
-

Check if the dialog is a recording dialog. -:return: True if the dialog is a recording dialog, False otherwise -:rtype: bool

-
- -
-
-is_text() → bool[source]
-

Check if the dialog is a text dialog. -:return: True if the dialog is a text dialog, False otherwise -:rtype: bool

-
- -
-
-is_transfer() → bool[source]
-

Check if the dialog is a transfer dialog. -:return: True if the dialog is a transfer dialog, False otherwise -:rtype: bool

-
- -
-
-is_video(content_type=None) → bool[source]
-

Check if the dialog has video content.

-
-
Parameters:
-

content_type – Optional content type to check. If None, use the dialog’s mediatype.

-
-
Returns:
-

True if the content is a video format, False otherwise

-
-
-
- -
-
-set_content_hash(content_hash: str) → None[source]
-

Set the content hash for externally referenced files.

-
-
Parameters:
-

content_hash (str) – The content hash value

-
-
Returns:
-

None

-
-
Return type:
-

None

-
-
-
- -
-
-set_session_id(session_id: Dict[str, str] | List[Dict[str, str]]) → None[source]
-

Set the session identifier for this dialog.

-
-
Parameters:
-

session_id (dict or list) – The session identifier (SessionId or list of SessionId)

-
-
Returns:
-

None

-
-
Return type:
-

None

-
-
-
- -
-
-to_dict()[source]
-

Returns a dictionary representation of the Dialog object.

-
-
Returns:
-

a dictionary containing all non-None Dialog object attributes

-
-
Return type:
-

dict

-
-
-
- -
-
-to_inline_data() → None[source]
-

Convert the dialog from an external data dialog to an inline data dialog -by reading the contents from the URL then adding the contents to the body.

-
-
Returns:
-

None

-
-
Return type:
-

None

-
-
-
- -
-
-transcode_video(target_format, codec=None, bit_rate=None, width=None, height=None) → None[source]
-

Transcode the video to a different format or with different encoding parameters.

-
-
Parameters:
-
    -
  • target_format – Target video format (mp4, webm, etc.)

  • -
  • codec – Video codec to use (h264, vp9, etc.)

  • -
  • bit_rate – Target bitrate in bits per second

  • -
  • width – Target width (if resizing)

  • -
  • height – Target height (if resizing)

  • -
-
-
Returns:
-

None - updates the dialog’s content in place

-
-
-
- -
-
-verify_content_hash(expected_hash: str, algorithm: str = 'sha256') → bool[source]
-

Verify the content hash against the expected value.

-
-
Parameters:
-
    -
  • expected_hash (str) – The expected hash value

  • -
  • algorithm (str) – The hash algorithm to use (default: “sha256”)

  • -
-
-
Returns:
-

True if the hash matches, False otherwise

-
-
Return type:
-

bool

-
-
-
- -
- -
-
-

vcon.party module

-
-
-class vcon.party.Party(tel: str | None = None, stir: str | None = None, mailto: str | None = None, name: str | None = None, validation: str | None = None, gmlpos: str | None = None, civicaddress: CivicAddress | None = None, uuid: str | None = None, role: str | None = None, contact_list: str | None = None, meta: dict | None = None, sip: str | None = None, did: str | None = None, jCard: dict | None = None, timezone: str | None = None, **kwargs)[source]
-

Bases: object

-

A class representing a party (participant) in a vCon conversation.

-

A party represents a participant in the conversation with various contact -and identification information. Parties can be callers, agents, or any -other participants in the conversation.

-

Supported contact methods: -- tel: Telephone number -- mailto: Email address -- sip: SIP URI for VoIP communication -- did: Decentralized Identifier for blockchain-based identity

-

Contact information: -- name: Display name of the party -- jCard: vCard format contact information (RFC 7095) -- timezone: Party’s timezone for temporal context

-

Location and validation: -- civicaddress: Civic address information (GEOPRIV format) -- gmlpos: GML position coordinates -- validation: Validation information for the party

-

Additional metadata: -- uuid: Unique identifier for the party -- role: Role in the conversation (e.g., “caller”, “agent”) -- stir: STIR identifier for secure telephony -- contact_list: Reference to contact list -- meta: Additional metadata

-

New in vCon 0.4.0: -- sip: SIP URI for the party -- did: Decentralized Identifier -- jCard: vCard format contact information -- timezone: Party’s timezone

-
-
-__init__(tel: str | None = None, stir: str | None = None, mailto: str | None = None, name: str | None = None, validation: str | None = None, gmlpos: str | None = None, civicaddress: CivicAddress | None = None, uuid: str | None = None, role: str | None = None, contact_list: str | None = None, meta: dict | None = None, sip: str | None = None, did: str | None = None, jCard: dict | None = None, timezone: str | None = None, **kwargs) → None[source]
-

Initialize a new Party object.

-
-
Parameters:
-
    -
  • tel (str | None) – Telephone number of the party

  • -
  • stir (str | None) – STIR identifier of the party

  • -
  • mailto (str | None) – Email address of the party

  • -
  • name (str | None) – Display name of the party

  • -
  • validation (str | None) – Validation information of the party

  • -
  • gmlpos (str | None) – GML position of the party

  • -
  • civicaddress (CivicAddress | None) – Civic address of the party

  • -
  • uuid (str | None) – UUID of the party

  • -
  • role (str | None) – Role of the party

  • -
  • contact_list (str | None) – Contact list of the party

  • -
  • sip (str | None) – SIP URI for the party

  • -
  • did (str | None) – Decentralized Identifier

  • -
  • jCard (dict | None) – vCard format contact information

  • -
  • timezone (str | None) – Party’s timezone

  • -
  • kwargs – Additional attributes to be set on the party

  • -
-
-
-
- -
-
-to_dict()[source]
-
- -
- -
-
-class vcon.party.PartyHistory(party: int, event: str, time: datetime)[source]
-

Bases: object

-

A class representing party history events in a vCon dialog.

-

Party history tracks when parties join, leave, or change state during -a conversation. This is useful for understanding the flow of multi-party -conversations where participants may not all join and leave at the same time.

-

Supported event types (vCon 0.4.0 specification): -- join: When the party joins the dialog -- drop: When the party drops out of the dialog -- hold: When the party is put on hold -- unhold: When the party is taken off hold -- mute: When the party is muted -- unmute: When the party is taken off mute

-
-
-party
-

Index of the party in the parties array

-
-
Type:
-

int

-
-
-
- -
-
-event
-

Type of event (must be one of VALID_EVENTS)

-
-
Type:
-

str

-
-
-
- -
-
-time
-

Time when the event occurred (serialized as ISO 8601)

-
-
Type:
-

datetime

-
-
-
- -

The time field is automatically serialized to ISO 8601 format when -converted to dictionary representation.

-
-
-VALID_EVENTS = ['join', 'drop', 'hold', 'unhold', 'mute', 'unmute']
-
- -
-
-__init__(party: int, event: str, time: datetime)[source]
-

Initialize a new PartyHistory object.

-
-
Parameters:
-
    -
  • party (int) – Index of the party

  • -
  • event (str) – Event type (e.g. “join”, “drop”, “hold”, “unhold”, -“mute”, “unmute”)

  • -
  • time (datetime) – Time of the event

  • -
-
-
-
- -
-
-to_dict()[source]
-
- -
- -
-
-

vcon.vcon module

-
-
-class vcon.vcon.Attachment(purpose: str, body: Any = None, encoding: str = 'none', mediatype: str | None = None, filename: str | None = None, url: str | None = None, content_hash: str | None = None, start: str | None = None, party: int | None = None, dialog: int | None = None)[source]
-

Bases: object

-

A class representing an attachment in a vCon.

-

An attachment consists of a purpose, body content, and an encoding format. -The encoding format must be one of the supported formats: base64url, json, or none.

-
-
-purpose
-

The purpose of the attachment

-
-
Type:
-

str

-
-
-
- -
-
-body
-

The content of the attachment

-
-
Type:
-

Any

-
-
-
- -
-
-encoding
-

The encoding format used for the body

-
-
Type:
-

str

-
-
-
- -
-
-VALID_ENCODINGS = ['base64url', 'json', 'none']
-
- -
-
-__init__(purpose: str, body: Any = None, encoding: str = 'none', mediatype: str | None = None, filename: str | None = None, url: str | None = None, content_hash: str | None = None, start: str | None = None, party: int | None = None, dialog: int | None = None) → None[source]
-

Initialize an Attachment object.

-
-
Parameters:
-
    -
  • purpose – The purpose of the attachment

  • -
  • body – The content of the attachment

  • -
  • encoding – The encoding format used for the body (default: “none”)

  • -
-
-
Raises:
-

ValueError – If the specified encoding is not supported

-
-
-
- -
-
-classmethod from_image(image_path: str, purpose: str = 'image') → Attachment[source]
-

Create an Attachment from an image file.

-
-
Parameters:
-
    -
  • image_path – Path to the image file

  • -
  • type – The type of the attachment (default: “image”)

  • -
-
-
Returns:
-

An Attachment object containing the image

-
-
Raises:
-
    -
  • ValueError – If the image format is not supported

  • -
  • FileNotFoundError – If the image file cannot be found

  • -
-
-
-
- -
-
-to_dict() → Dict[str, Any][source]
-

Convert the attachment to a dictionary representation.

-
-
Returns:
-

Dict containing the attachment’s purpose, body, and encoding

-
-
-
- -
- -
-
-class vcon.vcon.Vcon(vcon_dict: Dict[str, Any] = None, property_handling: str = 'default')[source]
-

Bases: object

-

A class representing a vCon (Virtual Conversation) object according to the vCon specification.

-

A vCon is a standardized format for representing conversations and related metadata. -It includes information about participants (parties), dialog content, attachments, -and analysis data.

-

The vCon format supports features such as: -- Unique identification via UUID -- Optional versioning (version field is optional) -- Timestamps for creation and updates -- Party information with contact details (tel, name, sip, did, jCard, timezone) -- Dialog content with media types and session information -- Attachments for ancillary documents -- Analysis data for conversation insights -- Digital signatures and encryption -- Extensions and critical for extensibility -- Civic address information for location data -- Party history for tracking join/drop/hold/mute events

-

New in vCon 0.4.0: -- Extensions field for listing used extensions -- Critical field for incompatible extensions -- Enhanced party fields (sip, did, jCard, timezone) -- Dialog session_id and content_hash fields -- Party history with event tracking -- Updated media type validation -- New disposition values for incomplete dialogs

-
-
-vcon_dict
-

The underlying dictionary containing all vCon data

-
-
Type:
-

Dict

-
-
-
- -
-
-property_handling
-

How non-standard properties are handled

-
-
Type:
-

str

-
-
-
- -
-
-__init__(vcon_dict: Dict[str, Any] = None, property_handling: str = 'default') → None[source]
-

Initialize a Vcon object from a dictionary.

-
-
Parameters:
-
    -
  • vcon_dict – A dictionary representing a vCon. Defaults to an empty dict.

  • -
  • property_handling – How to handle non-standard properties. -Options are: -- “default”: Keep non-standard properties (default) -- “strict”: Remove non-standard properties -- “meta”: Move non-standard properties to meta object

  • -
-
-
-

Example

-
>>> vcon = Vcon({"uuid": "123", "custom_field": "value"})
-
-
-
>>> strict_vcon = Vcon({"uuid": "123", "custom_field": "value"}, property_handling="strict")
->>> meta_vcon = Vcon({"uuid": "123", "custom_field": "value"}, property_handling="meta")
-
-
-
- -
-
-add_analysis(*, type: str, dialog: List[int] | int, vendor: str, body: Dict[str, Any] | List[Any] | str, encoding: str = 'none', mediatype: str | None = None, filename: str | None = None, product: str | None = None, url: str | None = None, content_hash: str | None = None, schema: Dict[str, Any] | None = None, meta: Dict[str, Any] | None = None, **extra) → None[source]
-

Add analysis data to the vCon.

-

This method adds analysis data with the specified parameters to the vCon’s -analysis list. Analysis data can be associated with one or more dialog entries -and includes metadata about the vendor who performed the analysis.

-
-
Parameters:
-
    -
  • type – The type of analysis

  • -
  • dialog – Index or list of indices of the associated dialog entries

  • -
  • vendor – The name of the vendor who performed the analysis

  • -
  • body – The analysis data

  • -
  • encoding – The encoding format of the body (default: “none”)

  • -
  • mediatype – Optional media type of the analysis content

  • -
  • filename – Optional filename for the analysis content

  • -
  • product – Optional product name of the vendor

  • -
  • url – Optional URL for external analysis content

  • -
  • content_hash – Optional content hash for external analysis content

  • -
  • schema – Optional schema information about the analysis (default: None)

  • -
  • meta – Optional metadata about the analysis (default: None)

  • -
  • **extra – Additional key-value pairs to include in the analysis

  • -
-
-
Raises:
-

Exception – If the encoding is invalid or if the body format is invalid for the specified encoding

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_analysis(
-...     type="sentiment",
-...     dialog=[0],
-...     vendor="acme",
-...     body={"score": 0.8},
-...     encoding="json",
-...     schema={"version": "1.0"},
-...     meta={"confidence": "high"}
-... )
-
-
-
- -
-
-add_attachment(purpose: str, body: Any = None, encoding: str = 'none', mediatype: str | None = None, filename: str | None = None, url: str | None = None, content_hash: str | None = None, start: str | None = None, party: int | None = None, dialog: int | None = None) → Attachment[source]
-

Add an attachment to the vCon.

-

This method creates a new attachment with the specified type, body, and encoding -and adds it to the vCon’s attachments list.

-
-
Parameters:
-
    -
  • purpose – The purpose of the attachment

  • -
  • body – The content of the attachment

  • -
  • encoding – The encoding format for the body (default: “none”)

  • -
  • mediatype – Optional media type of the attachment

  • -
  • filename – Optional file name of the attachment

  • -
  • url – Optional URL for external attachments

  • -
  • content_hash – Optional content hash for external attachments

  • -
  • start – Optional timestamp for the attachment

  • -
  • party – Optional party index

  • -
  • dialog – Optional dialog index

  • -
-
-
Returns:
-

The created Attachment object

-
-
Raises:
-

ValueError – If the specified encoding is not supported

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> attachment = vcon.add_attachment("metadata", {"version": "1.0"}, "json")
->>> print(attachment.purpose)  # Prints "metadata"
-
-
-
- -
-
-add_critical(extension: str) → None[source]
-

Add an extension to the critical list.

-
-
Parameters:
-

extension – The name of the extension that must be supported

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_critical("encryption")
->>> vcon.add_critical("video")
-
-
-
- -
-
-add_dialog(dialog: Dialog) → None[source]
-

Add a dialog entry to the vCon.

-

This method adds a Dialog object to the vCon’s dialog list. A dialog entry -represents a segment of the conversation with its associated metadata.

-
-
Parameters:
-

dialog – The Dialog object to add

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> dialog = Dialog(type="text", start="2023-01-01T00:00:00Z", parties=[0])
->>> vcon.add_dialog(dialog)
-
-
-
- -
-
-add_extension(extension: str) → None[source]
-

Add an extension to the vCon.

-
-
Parameters:
-

extension – The name of the extension to add

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_extension("video")
->>> vcon.add_extension("encryption")
-
-
-
- -
-
-add_image(image_path: str, purpose: str = 'image') → Attachment[source]
-

Add an image attachment to the vCon.

-

This method creates a new attachment with the specified image -and adds it to the vCon’s attachments list.

-
-
Parameters:
-
    -
  • image_path – Path to the image file

  • -
  • purpose – The purpose of the attachment (default: “image”)

  • -
-
-
Returns:
-

The created Attachment object

-
-
Raises:
-
    -
  • FileNotFoundError – If the image file cannot be found

  • -
  • ValueError – If the image format is not supported

  • -
-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> attachment = vcon.add_image("document.pdf", "identification")
->>> print(attachment.mediatype)  # Prints "application/pdf"
-
-
-
- -
-
-add_incomplete_dialog(start: str | datetime, disposition: str, details: Dict[str, Any] | None = None, parties: List[int] = None, metadata: Dict[str, Any] | None = None) → None[source]
-

Add an incomplete dialog entry to the vCon. -This method creates a dialog entry of type “incomplete” for conversations -that failed to be set up, with the provided disposition and details. -:param start: When the attempt occurred (ISO 8601 string or datetime) -:param disposition: Reason for the incomplete conversation -:param details: Additional details about the failure (optional) -:param parties: List of party indices involved (optional) -:param metadata: Additional metadata (optional)

-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_incomplete_dialog(
-...     start="2023-01-20T14:00:00Z",
-...     disposition="NO_ANSWER",
-...     details={"ringDuration": 45000},
-...     parties=[0, 1]
-... )
-
-
-
- -
-
-add_lawful_basis_attachment(lawful_basis: str, expiration: str, purpose_grants: list, party_index: int | None = None, dialog_index: int | None = None, **kwargs) → None[source]
-

Add a lawful basis attachment to the vCon.

-
-
Parameters:
-
    -
  • lawful_basis – The lawful basis type (consent, contract, etc.)

  • -
  • expiration – ISO 8601 timestamp when the lawful basis expires

  • -
  • purpose_grants – List of purpose grant dictionaries

  • -
  • party_index – Index of the party this applies to (optional)

  • -
  • dialog_index – Index of the dialog this applies to (optional)

  • -
  • **kwargs – Additional lawful basis parameters

  • -
-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_lawful_basis_attachment(
-...     lawful_basis="consent",
-...     expiration="2026-01-01T00:00:00Z",
-...     purpose_grants=[
-...         {"purpose": "recording", "granted": True, "granted_at": "2025-01-01T00:00:00Z"}
-...     ]
-... )
-
-
-
- -
-
-add_party(party: Party) → None[source]
-

Add a party to the vCon.

-

This method adds a party object to the vCon’s parties list. A party represents -a participant in the conversation.

-
-
Parameters:
-

party – The Party object to add

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> party = Party(type="person", name="John Doe")
->>> vcon.add_party(party)
-
-
-
- -
-
-add_tag(tag_name: str, tag_value: str) → None[source]
-

Add a tag to the vCon.

-

This method adds a tag with the specified name and value to the vCon’s tags -attachment. If no tags attachment exists, it creates one.

-
-
Parameters:
-
    -
  • tag_name – The name of the tag

  • -
  • tag_value – The value to associate with the tag

  • -
-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_tag("category", "meeting")
->>> vcon.add_tag("priority", "high")
-
-
-
- -
-
-add_transfer_dialog(start: str | datetime, transfer_data: Dict[str, Any], parties: List[int], metadata: Dict[str, Any] | None = None) → None[source]
-

Add a transfer dialog entry to the vCon. -This method creates a dialog entry of type “transfer” with the provided -transfer data and adds it to the vCon’s dialog list. -:param start: When the transfer occurred (ISO 8601 string or datetime) -:param transfer_data: Transfer-specific information -:param parties: List of party indices involved -:param metadata: Additional metadata (optional)

-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_transfer_dialog(
-...     start="2023-01-20T14:05:00Z",
-...     transfer_data={
-...         "reason": "Call forwarded",
-...         "from": "+1234567890",
-...         "to": "+1987654321",
-...         "protocol": "SIP",
-...         "details": {
-...             "sipMessage": "SIP/2.0 302 Moved Temporarily"
-...         }
-...     },
-...     parties=[0, 1]
-... )
-
-
-
- -
-
-add_wtf_transcription_attachment(transcript: Dict[str, Any], segments: List[Dict[str, Any]], metadata: Dict[str, Any], party_index: int | None = None, dialog_index: int | None = None, **kwargs) → None[source]
-

Add a WTF transcription attachment to the vCon.

-
-
Parameters:
-
    -
  • transcript – Transcript information dictionary

  • -
  • segments – List of segment dictionaries

  • -
  • metadata – Metadata dictionary

  • -
  • party_index – Index of the party this applies to (optional)

  • -
  • dialog_index – Index of the dialog this applies to (optional)

  • -
  • **kwargs – Additional WTF parameters

  • -
-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_wtf_transcription_attachment(
-...     transcript={"text": "Hello world", "language": "en", "duration": 2.0, "confidence": 0.95},
-...     segments=[{"id": 0, "start": 0.0, "end": 2.0, "text": "Hello world", "confidence": 0.95}],
-...     metadata={"created_at": "2025-01-01T00:00:00Z", "processed_at": "2025-01-01T00:00:01Z",
-...              "provider": "whisper", "model": "whisper-1"}
-... )
-
-
-
- -
-
-property amended
-
- -
-
-property analysis: List[Dict[str, Any]]
-

Get the list of analysis entries in the vCon.

-
-
Returns:
-

A list of analysis dictionaries

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_analysis(type="sentiment", dialog=[0], vendor="acme", body={"score": 0.8})
->>> analysis = vcon.analysis
->>> print(analysis[0]["type"])  # Prints "sentiment"
-
-
-
- -
-
-property attachments: List[Dict[str, Any]]
-

Get the list of attachments in the vCon.

-
-
Returns:
-

A list of attachment dictionaries

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_attachment("metadata", {"version": "1.0"})
->>> attachments = vcon.attachments
->>> print(attachments[0]["purpose"])  # Prints "metadata"
-
-
-
- -
-
-classmethod build_from_json(json_string: str, property_handling: str = 'default') → Vcon[source]
-

Initialize a Vcon object from a JSON string.

-

This method parses a JSON string representation of a vCon and creates -a new Vcon object from it.

-
-
Parameters:
-
    -
  • json_string – A JSON string representing a vCon

  • -
  • property_handling – How to handle non-standard properties.

  • -
-
-
Returns:
-

A new Vcon object initialized with the parsed JSON data

-
-
Raises:
-

json.JSONDecodeError – If the JSON string is invalid

-
-
-

Example

-
>>> json_str = '{"uuid": "123"}'
->>> vcon = Vcon.build_from_json(json_str)
-
-
-
- -
-
-classmethod build_new(created_at: str | datetime = None, property_handling: str = 'default') → Vcon[source]
-

Initialize a new Vcon object with default values.

-

This method creates a new vCon with a generated UUID and initialized -with empty arrays for groups, parties, dialog, attachments, and analysis.

-
-
Parameters:
-
    -
  • created_at (Union[str, datetime], optional) – The timestamp to set for creation, -either as a string in ISO format -or as a datetime object. -Defaults to current time.

  • -
  • property_handling – How to handle non-standard properties.

  • -
-
-
Returns:
-

A new Vcon object with default values

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> print(vcon.uuid)  # Prints a new UUID8
-
-
-
- -
-
-check_lawful_basis_permission(purpose: str, party_index: int | None = None) → bool[source]
-

Check if permission is granted for a specific purpose.

-
-
Parameters:
-
    -
  • purpose – The purpose to check permission for

  • -
  • party_index – Index of the party to check (optional)

  • -
-
-
Returns:
-

True if permission is granted, False otherwise

-
-
-
- -
-
-property created_at
-
- -
-
-property dialog: List[Dict[str, Any]]
-

Get the list of dialog entries in the vCon.

-
-
Returns:
-

A list of dialog dictionaries representing the conversation content. -These are mutable references to the internal data structure, allowing in-place modifications.

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_dialog(Dialog(type="text", start="2023-01-01T00:00:00Z", parties=[0]))
->>> dialog = vcon.dialog
->>> print(dialog[0]["type"])  # Prints "text"
->>> dialog[0]["body"] = "Modified content"  # In-place modification works
->>> print(vcon.dialog[0]["body"])  # Prints "Modified content"
-
-
-
- -
-
-dumps() → str[source]
-

Alias for to_json().

-

This method is an alias for to_json() and converts the vCon object to a -JSON string representation.

-
-
Returns:
-

A JSON string representation of the vCon

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> json_str = vcon.dumps()
->>> print(type(json_str))  # Prints "<class 'str'>"
-
-
-
- -
-
-find_analysis_by_type(type: str) → Dict[str, Any] | None[source]
-

Find an analysis entry in the vCon by its type.

-

This method searches through the vCon’s analysis entries and returns the first -one matching the specified type.

-
-
Parameters:
-

type – The type of analysis to find

-
-
Returns:
-

The matching analysis dictionary if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_analysis(type="sentiment", dialog=[0], vendor="acme", body={"score": 0.8})
->>> sentiment = vcon.find_analysis_by_type("sentiment")
-
-
-
- -
-
-find_attachment_by_purpose(purpose: str) → Dict[str, Any] | None[source]
-

Find an attachment in the vCon by its purpose.

-

This method searches through the vCon’s attachments and returns the first -attachment matching the specified type.

-
-
Parameters:
-

purpose – The purpose of attachment to find

-
-
Returns:
-

The matching attachment dictionary if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_attachment("metadata", {"version": "1.0"})
->>> metadata = vcon.find_attachment_by_purpose("metadata")
-
-
-
- -
-
-find_dialog(by: str, val: str) → Dialog | None[source]
-

Find a dialog entry in the vCon by a key-value pair.

-

This method searches through the dialog list and returns the first dialog -entry that matches the specified key-value pair, converted to a Dialog object.

-
-
Parameters:
-
    -
  • by – The key to search by (e.g., “type”, “start”)

  • -
  • val – The value to match

  • -
-
-
Returns:
-

A Dialog object if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> dialog = Dialog(type="text", start="2023-01-01T00:00:00Z", parties=[0])
->>> vcon.add_dialog(dialog)
->>> found = vcon.find_dialog("type", "text")
->>> print(found.type)  # Prints "text"
-
-
-
- -
-
-find_dialogs_by_type(type: str) → List[Dict[str, Any]][source]
-

Find all dialog entries in the vCon by type. -This method searches through the dialog list and returns all dialog -entries matching the specified type. -:param type: The type of dialogs to find

-
-
Returns:
-

A list of matching dialog dictionaries

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_transfer_dialog(start="2023-01-20T14:00:00Z", transfer_data={...})
->>> transfer_dialogs = vcon.find_dialogs_by_type("transfer")
-
-
-
- -
-
-find_lawful_basis_attachments(party_index: int | None = None) → List[Dict[str, Any]][source]
-

Find lawful basis attachments in the vCon.

-
-
Parameters:
-

party_index – Filter by party index (optional)

-
-
Returns:
-

List of lawful basis attachment dictionaries

-
-
-
- -
-
-find_party_index(by: str, val: str) → int | None[source]
-

Find the index of a party in the vCon’s parties list.

-

This method searches through the parties list and returns the index of the first -party that matches the specified key-value pair.

-
-
Parameters:
-
    -
  • by – The key to search by (e.g., “name”, “type”)

  • -
  • val – The value to match

  • -
-
-
Returns:
-

The index of the matching party if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_party(Party(type="person", name="John Doe"))
->>> index = vcon.find_party_index("name", "John Doe")
->>> print(index)  # Prints 0
-
-
-
- -
-
-find_wtf_attachments(party_index: int | None = None) → List[Dict[str, Any]][source]
-

Find WTF transcription attachments in the vCon.

-
-
Parameters:
-

party_index – Filter by party index (optional)

-
-
Returns:
-

List of WTF attachment dictionaries

-
-
-
- -
-
-classmethod generate_key_pair() → Tuple[RSAPrivateKey, RSAPublicKey][source]
-

Generate a new RSA key pair for signing vCons.

-

This method generates a new RSA key pair that can be used for signing -and verifying vCons.

-
-
Returns:
-

A tuple containing the private key and public key

-
-
-

Example

-
>>> private_key, public_key = Vcon.generate_key_pair()
->>> vcon = Vcon.build_new()
->>> vcon.sign(private_key)
->>> is_valid = vcon.verify(public_key)
-
-
-
- -
-
-get_critical() → List[str][source]
-

Get the list of critical extensions that must be supported.

-
-
Returns:
-

List of extension names that must be supported, empty list if none are defined

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_critical("encryption")
->>> critical = vcon.get_critical()
->>> print(critical)  # Prints ["encryption"]
-
-
-
- -
-
-get_extensions() → List[str][source]
-

Get the list of extensions used in this vCon.

-
-
Returns:
-

List of extension names, empty list if none are defined

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_extension("video")
->>> extensions = vcon.get_extensions()
->>> print(extensions)  # Prints ["video"]
-
-
-
- -
-
-get_party_objects() → List[Party][source]
-

Get the list of parties as Party objects.

-

This method creates Party objects from the underlying dictionary data. -Use this when you need Party objects instead of raw dictionaries.

-
-
Returns:
-

A list of Party objects representing all participants in the conversation

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_party(Party(type="person", name="John Doe"))
->>> party_objects = vcon.get_party_objects()
->>> print(party_objects[0].name)  # Prints "John Doe"
-
-
-
- -
-
-get_tag(tag_name: str) → str | None[source]
-

Get the value of a specific tag by name.

-
-
Parameters:
-

tag_name – The name of the tag to retrieve

-
-
Returns:
-

The value of the tag if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_tag("category", "meeting")
->>> value = vcon.get_tag("category")
->>> print(value)  # Prints "meeting"
-
-
-
- -
-
-property group
-
- -
-
-is_valid() → Tuple[bool, List[str]][source]
-

Validate the vCon syntax according to the standard. -Checks required fields, ensures data types are correct, and verifies -relationships between different parts of the vCon (for example, dialog party -references and attachment fields).

-
-
Returns:
-

A tuple where the first element is True if the vCon -is valid and False otherwise, and the second element is a list of error messages.

-
-
Return type:
-

Tuple[bool, List[str]]

-
-
-
- -
-
-classmethod load(source: str, property_handling: str = 'default') → Vcon[source]
-

Load a vCon from either a file path or URL.

-
-
Parameters:
-
    -
  • source – File path or URL to load the vCon from

  • -
  • property_handling – How to handle non-standard properties. -Options are “default”, “strict”, or “meta”

  • -
-
-
Returns:
-

A Vcon object

-
-
Raises:
-
    -
  • ValueError – If the source is invalid or cannot be loaded

  • -
  • requests.RequestException – If there is an error fetching from URL

  • -
  • json.JSONDecodeError – If the source contains invalid JSON

  • -
-
-
-
- -
-
-classmethod load_from_file(file_path: str, property_handling: str = 'default') → Vcon[source]
-

Load a vCon from a file.

-
-
Parameters:
-
    -
  • file_path – Path to the vCon JSON file

  • -
  • property_handling – How to handle non-standard properties. -Options are “default”, “strict”, or “meta”

  • -
-
-
Returns:
-

A Vcon object

-
-
Raises:
-
    -
  • FileNotFoundError – If the file does not exist

  • -
  • json.JSONDecodeError – If the file contains invalid JSON

  • -
-
-
-
- -
-
-classmethod load_from_url(url: str, property_handling: str = 'default') → Vcon[source]
-

Load a vCon from a URL.

-
-
Parameters:
-
    -
  • url – URL to fetch the vCon JSON from

  • -
  • property_handling – How to handle non-standard properties. -Options are “default”, “strict”, or “meta”

  • -
-
-
Returns:
-

A Vcon object

-
-
Raises:
-
    -
  • requests.RequestException – If there is an error fetching from URL

  • -
  • json.JSONDecodeError – If the response contains invalid JSON

  • -
-
-
-
- -
-
-property meta
-
- -
-
-property parties: List[Dict[str, Any]]
-

Get the list of parties in the vCon.

-
-
Returns:
-

A list of party dictionaries representing all participants in the conversation. -These are mutable references to the internal data structure, allowing in-place modifications.

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_party(Party(type="person", name="John Doe"))
->>> parties = vcon.parties
->>> print(parties[0]["name"])  # Prints "John Doe"
->>> parties[0]["name"] = "Jane Doe"  # In-place modification works
->>> print(vcon.parties[0]["name"])  # Prints "Jane Doe"
-
-
-
- -
-
-post_to_url(url: str, headers: Dict[str, str] | None = None) → Response[source]
-

Post the vCon as JSON to a URL with optional headers.

-
-
Parameters:
-
    -
  • url (str) – The URL to post the vCon to

  • -
  • headers (Optional[Dict[str, str]]) – Optional dictionary of HTTP headers (e.g., {‘x-conserver-api-token’: ‘token123’})

  • -
-
-
Returns:
-

The HTTP response from the server

-
-
Return type:
-

requests.Response

-
-
Raises:
-

requests.RequestException – If there is an error making the HTTP request

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> response = vcon.post_to_url(
-...     'https://api.example.com/vcons',
-...     headers={'x-conserver-api-token': 'your-token-here'}
-... )
->>> print(response.status_code)  # Prints HTTP status code (e.g., 200 for success)
-
-
-
- -
-
-process_extensions() → Dict[str, Any][source]
-

Process all extensions in the vCon.

-
-
Returns:
-

Dictionary with processing results for each extension

-
-
-
- -
-
-property redacted
-
- -
-
-remove_critical(extension: str) → None[source]
-

Remove an extension from the critical list.

-
-
Parameters:
-

extension – The name of the extension to remove from critical

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_critical("encryption")
->>> vcon.remove_critical("encryption")
-
-
-
- -
-
-remove_extension(extension: str) → None[source]
-

Remove an extension from the vCon.

-
-
Parameters:
-

extension – The name of the extension to remove

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_extension("video")
->>> vcon.remove_extension("video")
-
-
-
- -
-
-save_to_file(file_path: str) → None[source]
-

Save the vCon to a JSON file.

-
-
Parameters:
-

file_path (str) – Path where the vCon JSON should be saved

-
-
Raises:
-

IOError – If there is an error writing to the file

-
-
-
- -
-
-set_created_at(created_at: str | datetime) → None[source]
-

Set the created_at field in the vCon.

-
-
Parameters:
-

created_at (Union[str, datetime]) – The timestamp to set, either as a string in ISO format -or as a datetime object.

-
-
-
- -
-
-set_updated_at(timestamp: str | datetime) → None[source]
-

Set the updated_at timestamp.

-

Args: -timestamp: The timestamp to set, either as ISO 8601 string or datetime object

-

Example: ->>> vcon = Vcon.build_new() ->>> vcon.set_updated_at(datetime.now(timezone.utc)) ->>> vcon.set_updated_at(“2025-02-18T12:00:00Z”)

-
- -
-
-sign(private_key: RSAPrivateKey | bytes) → None[source]
-

Sign the vCon using JWS (JSON Web Signature).

-

This method signs the vCon using the provided private key, adding the signature -information to the vCon. The signature can later be verified using the -corresponding public key.

-
-
Parameters:
-

private_key – The RSA private key or its PEM representation

-
-
Raises:
-

Exception – If there is an error during the signing process

-
-
-

Example

-
>>> from cryptography.hazmat.primitives.asymmetric import rsa
->>> private_key = rsa.generate_private_key(public_exponent=65537, key_size=2048)
->>> vcon = Vcon.build_new()
->>> vcon.sign(private_key)
-
-
-
- -
-
-property subject: str | None
-
- -
-
-property tags: Dict[str, Any] | None
-

Get the tags attachment from the vCon.

-
-
Returns:
-

The tags attachment dictionary if it exists, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_tag("category", "meeting")
->>> tags = vcon.tags
->>> print(tags["body"])  # Prints ["category:meeting"]
-
-
-
- -
-
-to_dict() → Dict[str, Any][source]
-

Convert the vCon to a dictionary.

-

This method returns a dictionary representation of the vCon object, -which can be used for direct manipulation or inspection.

-
-
Returns:
-

A dictionary representation of the vCon

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon_dict = vcon.to_dict()
->>> print(vcon_dict["vcon"])  # Prints "0.4.0"
-
-
-
- -
-
-to_json() → str[source]
-

Serialize the vCon to a JSON string.

-

This method converts the entire vCon object to a JSON string representation, -which can be used for storage or transmission.

-
-
Returns:
-

A JSON string representation of the vCon

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> json_str = vcon.to_json()
->>> print(type(json_str))  # Prints "<class 'str'>"
-
-
-
- -
-
-property updated_at
-
- -
-
-property uuid: str
-
- -
-
-static uuid8_domain_name(domain_name: str) → str[source]
-
- -
-
-static uuid8_time(custom_c_62_bits: int) → str[source]
-
- -
-
-validate_extensions() → Dict[str, Any][source]
-

Validate all extensions in the vCon.

-
-
Returns:
-

Dictionary with validation results for each extension

-
-
-
- -
-
-static validate_file(file_path: str) → tuple[bool, list[str]][source]
-

Validate a vCon file at the given path.

-
-
Parameters:
-

file_path (str) – Path to the vCon JSON file

-
-
Returns:
-

A tuple containing (is_valid, list_of_errors)

-
-
Return type:
-

tuple[bool, list[str]]

-
-
-
- -
-
-static validate_json(json_str: str) → tuple[bool, list[str]][source]
-

Validate a vCon from a JSON string.

-
-
Parameters:
-

json_str (str) – JSON string representing a vCon

-
-
Returns:
-

A tuple containing (is_valid, list_of_errors)

-
-
Return type:
-

tuple[bool, list[str]]

-
-
-
- -
-
-property vcon: str | None
-
- -
-
-verify(public_key: RSAPublicKey | bytes) → bool[source]
-

Verify the JWS signature of the vCon.

-

This method verifies the vCon’s signature using the provided public key. -The vCon must have been previously signed using the corresponding private key.

-
-
Parameters:
-

public_key – The RSA public key or its PEM representation

-
-
Returns:
-

True if the signature is valid, False otherwise

-
-
Raises:
-

ValueError – If the vCon is not signed

-
-
-

Example

-
>>> private_key, public_key = Vcon.generate_key_pair()
->>> vcon = Vcon.build_new()
->>> vcon.sign(private_key)
->>> is_valid = vcon.verify(public_key)
->>> print(is_valid)  # Prints True
-
-
-
- -
- -
-
-

Module contents

-
-
-class vcon.Vcon(vcon_dict: Dict[str, Any] = None, property_handling: str = 'default')[source]
-

Bases: object

-

A class representing a vCon (Virtual Conversation) object according to the vCon specification.

-

A vCon is a standardized format for representing conversations and related metadata. -It includes information about participants (parties), dialog content, attachments, -and analysis data.

-

The vCon format supports features such as: -- Unique identification via UUID -- Optional versioning (version field is optional) -- Timestamps for creation and updates -- Party information with contact details (tel, name, sip, did, jCard, timezone) -- Dialog content with media types and session information -- Attachments for ancillary documents -- Analysis data for conversation insights -- Digital signatures and encryption -- Extensions and critical for extensibility -- Civic address information for location data -- Party history for tracking join/drop/hold/mute events

-

New in vCon 0.4.0: -- Extensions field for listing used extensions -- Critical field for incompatible extensions -- Enhanced party fields (sip, did, jCard, timezone) -- Dialog session_id and content_hash fields -- Party history with event tracking -- Updated media type validation -- New disposition values for incomplete dialogs

-
-
-vcon_dict
-

The underlying dictionary containing all vCon data

-
-
Type:
-

Dict

-
-
-
- -
-
-property_handling
-

How non-standard properties are handled

-
-
Type:
-

str

-
-
-
- -
-
-__init__(vcon_dict: Dict[str, Any] = None, property_handling: str = 'default') → None[source]
-

Initialize a Vcon object from a dictionary.

-
-
Parameters:
-
    -
  • vcon_dict – A dictionary representing a vCon. Defaults to an empty dict.

  • -
  • property_handling – How to handle non-standard properties. -Options are: -- “default”: Keep non-standard properties (default) -- “strict”: Remove non-standard properties -- “meta”: Move non-standard properties to meta object

  • -
-
-
-

Example

-
>>> vcon = Vcon({"uuid": "123", "custom_field": "value"})
-
-
-
>>> strict_vcon = Vcon({"uuid": "123", "custom_field": "value"}, property_handling="strict")
->>> meta_vcon = Vcon({"uuid": "123", "custom_field": "value"}, property_handling="meta")
-
-
-
- -
-
-add_analysis(*, type: str, dialog: List[int] | int, vendor: str, body: Dict[str, Any] | List[Any] | str, encoding: str = 'none', mediatype: str | None = None, filename: str | None = None, product: str | None = None, url: str | None = None, content_hash: str | None = None, schema: Dict[str, Any] | None = None, meta: Dict[str, Any] | None = None, **extra) → None[source]
-

Add analysis data to the vCon.

-

This method adds analysis data with the specified parameters to the vCon’s -analysis list. Analysis data can be associated with one or more dialog entries -and includes metadata about the vendor who performed the analysis.

-
-
Parameters:
-
    -
  • type – The type of analysis

  • -
  • dialog – Index or list of indices of the associated dialog entries

  • -
  • vendor – The name of the vendor who performed the analysis

  • -
  • body – The analysis data

  • -
  • encoding – The encoding format of the body (default: “none”)

  • -
  • mediatype – Optional media type of the analysis content

  • -
  • filename – Optional filename for the analysis content

  • -
  • product – Optional product name of the vendor

  • -
  • url – Optional URL for external analysis content

  • -
  • content_hash – Optional content hash for external analysis content

  • -
  • schema – Optional schema information about the analysis (default: None)

  • -
  • meta – Optional metadata about the analysis (default: None)

  • -
  • **extra – Additional key-value pairs to include in the analysis

  • -
-
-
Raises:
-

Exception – If the encoding is invalid or if the body format is invalid for the specified encoding

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_analysis(
-...     type="sentiment",
-...     dialog=[0],
-...     vendor="acme",
-...     body={"score": 0.8},
-...     encoding="json",
-...     schema={"version": "1.0"},
-...     meta={"confidence": "high"}
-... )
-
-
-
- -
-
-add_attachment(purpose: str, body: Any = None, encoding: str = 'none', mediatype: str | None = None, filename: str | None = None, url: str | None = None, content_hash: str | None = None, start: str | None = None, party: int | None = None, dialog: int | None = None) → Attachment[source]
-

Add an attachment to the vCon.

-

This method creates a new attachment with the specified type, body, and encoding -and adds it to the vCon’s attachments list.

-
-
Parameters:
-
    -
  • purpose – The purpose of the attachment

  • -
  • body – The content of the attachment

  • -
  • encoding – The encoding format for the body (default: “none”)

  • -
  • mediatype – Optional media type of the attachment

  • -
  • filename – Optional file name of the attachment

  • -
  • url – Optional URL for external attachments

  • -
  • content_hash – Optional content hash for external attachments

  • -
  • start – Optional timestamp for the attachment

  • -
  • party – Optional party index

  • -
  • dialog – Optional dialog index

  • -
-
-
Returns:
-

The created Attachment object

-
-
Raises:
-

ValueError – If the specified encoding is not supported

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> attachment = vcon.add_attachment("metadata", {"version": "1.0"}, "json")
->>> print(attachment.purpose)  # Prints "metadata"
-
-
-
- -
-
-add_critical(extension: str) → None[source]
-

Add an extension to the critical list.

-
-
Parameters:
-

extension – The name of the extension that must be supported

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_critical("encryption")
->>> vcon.add_critical("video")
-
-
-
- -
-
-add_dialog(dialog: Dialog) → None[source]
-

Add a dialog entry to the vCon.

-

This method adds a Dialog object to the vCon’s dialog list. A dialog entry -represents a segment of the conversation with its associated metadata.

-
-
Parameters:
-

dialog – The Dialog object to add

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> dialog = Dialog(type="text", start="2023-01-01T00:00:00Z", parties=[0])
->>> vcon.add_dialog(dialog)
-
-
-
- -
-
-add_extension(extension: str) → None[source]
-

Add an extension to the vCon.

-
-
Parameters:
-

extension – The name of the extension to add

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_extension("video")
->>> vcon.add_extension("encryption")
-
-
-
- -
-
-add_image(image_path: str, purpose: str = 'image') → Attachment[source]
-

Add an image attachment to the vCon.

-

This method creates a new attachment with the specified image -and adds it to the vCon’s attachments list.

-
-
Parameters:
-
    -
  • image_path – Path to the image file

  • -
  • purpose – The purpose of the attachment (default: “image”)

  • -
-
-
Returns:
-

The created Attachment object

-
-
Raises:
-
    -
  • FileNotFoundError – If the image file cannot be found

  • -
  • ValueError – If the image format is not supported

  • -
-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> attachment = vcon.add_image("document.pdf", "identification")
->>> print(attachment.mediatype)  # Prints "application/pdf"
-
-
-
- -
-
-add_incomplete_dialog(start: str | datetime, disposition: str, details: Dict[str, Any] | None = None, parties: List[int] = None, metadata: Dict[str, Any] | None = None) → None[source]
-

Add an incomplete dialog entry to the vCon. -This method creates a dialog entry of type “incomplete” for conversations -that failed to be set up, with the provided disposition and details. -:param start: When the attempt occurred (ISO 8601 string or datetime) -:param disposition: Reason for the incomplete conversation -:param details: Additional details about the failure (optional) -:param parties: List of party indices involved (optional) -:param metadata: Additional metadata (optional)

-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_incomplete_dialog(
-...     start="2023-01-20T14:00:00Z",
-...     disposition="NO_ANSWER",
-...     details={"ringDuration": 45000},
-...     parties=[0, 1]
-... )
-
-
-
- -
-
-add_lawful_basis_attachment(lawful_basis: str, expiration: str, purpose_grants: list, party_index: int | None = None, dialog_index: int | None = None, **kwargs) → None[source]
-

Add a lawful basis attachment to the vCon.

-
-
Parameters:
-
    -
  • lawful_basis – The lawful basis type (consent, contract, etc.)

  • -
  • expiration – ISO 8601 timestamp when the lawful basis expires

  • -
  • purpose_grants – List of purpose grant dictionaries

  • -
  • party_index – Index of the party this applies to (optional)

  • -
  • dialog_index – Index of the dialog this applies to (optional)

  • -
  • **kwargs – Additional lawful basis parameters

  • -
-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_lawful_basis_attachment(
-...     lawful_basis="consent",
-...     expiration="2026-01-01T00:00:00Z",
-...     purpose_grants=[
-...         {"purpose": "recording", "granted": True, "granted_at": "2025-01-01T00:00:00Z"}
-...     ]
-... )
-
-
-
- -
-
-add_party(party: Party) → None[source]
-

Add a party to the vCon.

-

This method adds a party object to the vCon’s parties list. A party represents -a participant in the conversation.

-
-
Parameters:
-

party – The Party object to add

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> party = Party(type="person", name="John Doe")
->>> vcon.add_party(party)
-
-
-
- -
-
-add_tag(tag_name: str, tag_value: str) → None[source]
-

Add a tag to the vCon.

-

This method adds a tag with the specified name and value to the vCon’s tags -attachment. If no tags attachment exists, it creates one.

-
-
Parameters:
-
    -
  • tag_name – The name of the tag

  • -
  • tag_value – The value to associate with the tag

  • -
-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_tag("category", "meeting")
->>> vcon.add_tag("priority", "high")
-
-
-
- -
-
-add_transfer_dialog(start: str | datetime, transfer_data: Dict[str, Any], parties: List[int], metadata: Dict[str, Any] | None = None) → None[source]
-

Add a transfer dialog entry to the vCon. -This method creates a dialog entry of type “transfer” with the provided -transfer data and adds it to the vCon’s dialog list. -:param start: When the transfer occurred (ISO 8601 string or datetime) -:param transfer_data: Transfer-specific information -:param parties: List of party indices involved -:param metadata: Additional metadata (optional)

-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_transfer_dialog(
-...     start="2023-01-20T14:05:00Z",
-...     transfer_data={
-...         "reason": "Call forwarded",
-...         "from": "+1234567890",
-...         "to": "+1987654321",
-...         "protocol": "SIP",
-...         "details": {
-...             "sipMessage": "SIP/2.0 302 Moved Temporarily"
-...         }
-...     },
-...     parties=[0, 1]
-... )
-
-
-
- -
-
-add_wtf_transcription_attachment(transcript: Dict[str, Any], segments: List[Dict[str, Any]], metadata: Dict[str, Any], party_index: int | None = None, dialog_index: int | None = None, **kwargs) → None[source]
-

Add a WTF transcription attachment to the vCon.

-
-
Parameters:
-
    -
  • transcript – Transcript information dictionary

  • -
  • segments – List of segment dictionaries

  • -
  • metadata – Metadata dictionary

  • -
  • party_index – Index of the party this applies to (optional)

  • -
  • dialog_index – Index of the dialog this applies to (optional)

  • -
  • **kwargs – Additional WTF parameters

  • -
-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_wtf_transcription_attachment(
-...     transcript={"text": "Hello world", "language": "en", "duration": 2.0, "confidence": 0.95},
-...     segments=[{"id": 0, "start": 0.0, "end": 2.0, "text": "Hello world", "confidence": 0.95}],
-...     metadata={"created_at": "2025-01-01T00:00:00Z", "processed_at": "2025-01-01T00:00:01Z",
-...              "provider": "whisper", "model": "whisper-1"}
-... )
-
-
-
- -
-
-property amended
-
- -
-
-property analysis: List[Dict[str, Any]]
-

Get the list of analysis entries in the vCon.

-
-
Returns:
-

A list of analysis dictionaries

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_analysis(type="sentiment", dialog=[0], vendor="acme", body={"score": 0.8})
->>> analysis = vcon.analysis
->>> print(analysis[0]["type"])  # Prints "sentiment"
-
-
-
- -
-
-property attachments: List[Dict[str, Any]]
-

Get the list of attachments in the vCon.

-
-
Returns:
-

A list of attachment dictionaries

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_attachment("metadata", {"version": "1.0"})
->>> attachments = vcon.attachments
->>> print(attachments[0]["purpose"])  # Prints "metadata"
-
-
-
- -
-
-classmethod build_from_json(json_string: str, property_handling: str = 'default') → Vcon[source]
-

Initialize a Vcon object from a JSON string.

-

This method parses a JSON string representation of a vCon and creates -a new Vcon object from it.

-
-
Parameters:
-
    -
  • json_string – A JSON string representing a vCon

  • -
  • property_handling – How to handle non-standard properties.

  • -
-
-
Returns:
-

A new Vcon object initialized with the parsed JSON data

-
-
Raises:
-

json.JSONDecodeError – If the JSON string is invalid

-
-
-

Example

-
>>> json_str = '{"uuid": "123"}'
->>> vcon = Vcon.build_from_json(json_str)
-
-
-
- -
-
-classmethod build_new(created_at: str | datetime = None, property_handling: str = 'default') → Vcon[source]
-

Initialize a new Vcon object with default values.

-

This method creates a new vCon with a generated UUID and initialized -with empty arrays for groups, parties, dialog, attachments, and analysis.

-
-
Parameters:
-
    -
  • created_at (Union[str, datetime], optional) – The timestamp to set for creation, -either as a string in ISO format -or as a datetime object. -Defaults to current time.

  • -
  • property_handling – How to handle non-standard properties.

  • -
-
-
Returns:
-

A new Vcon object with default values

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> print(vcon.uuid)  # Prints a new UUID8
-
-
-
- -
-
-check_lawful_basis_permission(purpose: str, party_index: int | None = None) → bool[source]
-

Check if permission is granted for a specific purpose.

-
-
Parameters:
-
    -
  • purpose – The purpose to check permission for

  • -
  • party_index – Index of the party to check (optional)

  • -
-
-
Returns:
-

True if permission is granted, False otherwise

-
-
-
- -
-
-property created_at
-
- -
-
-property dialog: List[Dict[str, Any]]
-

Get the list of dialog entries in the vCon.

-
-
Returns:
-

A list of dialog dictionaries representing the conversation content. -These are mutable references to the internal data structure, allowing in-place modifications.

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_dialog(Dialog(type="text", start="2023-01-01T00:00:00Z", parties=[0]))
->>> dialog = vcon.dialog
->>> print(dialog[0]["type"])  # Prints "text"
->>> dialog[0]["body"] = "Modified content"  # In-place modification works
->>> print(vcon.dialog[0]["body"])  # Prints "Modified content"
-
-
-
- -
-
-dumps() → str[source]
-

Alias for to_json().

-

This method is an alias for to_json() and converts the vCon object to a -JSON string representation.

-
-
Returns:
-

A JSON string representation of the vCon

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> json_str = vcon.dumps()
->>> print(type(json_str))  # Prints "<class 'str'>"
-
-
-
- -
-
-find_analysis_by_type(type: str) → Dict[str, Any] | None[source]
-

Find an analysis entry in the vCon by its type.

-

This method searches through the vCon’s analysis entries and returns the first -one matching the specified type.

-
-
Parameters:
-

type – The type of analysis to find

-
-
Returns:
-

The matching analysis dictionary if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_analysis(type="sentiment", dialog=[0], vendor="acme", body={"score": 0.8})
->>> sentiment = vcon.find_analysis_by_type("sentiment")
-
-
-
- -
-
-find_attachment_by_purpose(purpose: str) → Dict[str, Any] | None[source]
-

Find an attachment in the vCon by its purpose.

-

This method searches through the vCon’s attachments and returns the first -attachment matching the specified type.

-
-
Parameters:
-

purpose – The purpose of attachment to find

-
-
Returns:
-

The matching attachment dictionary if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_attachment("metadata", {"version": "1.0"})
->>> metadata = vcon.find_attachment_by_purpose("metadata")
-
-
-
- -
-
-find_dialog(by: str, val: str) → Dialog | None[source]
-

Find a dialog entry in the vCon by a key-value pair.

-

This method searches through the dialog list and returns the first dialog -entry that matches the specified key-value pair, converted to a Dialog object.

-
-
Parameters:
-
    -
  • by – The key to search by (e.g., “type”, “start”)

  • -
  • val – The value to match

  • -
-
-
Returns:
-

A Dialog object if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> dialog = Dialog(type="text", start="2023-01-01T00:00:00Z", parties=[0])
->>> vcon.add_dialog(dialog)
->>> found = vcon.find_dialog("type", "text")
->>> print(found.type)  # Prints "text"
-
-
-
- -
-
-find_dialogs_by_type(type: str) → List[Dict[str, Any]][source]
-

Find all dialog entries in the vCon by type. -This method searches through the dialog list and returns all dialog -entries matching the specified type. -:param type: The type of dialogs to find

-
-
Returns:
-

A list of matching dialog dictionaries

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_transfer_dialog(start="2023-01-20T14:00:00Z", transfer_data={...})
->>> transfer_dialogs = vcon.find_dialogs_by_type("transfer")
-
-
-
- -
-
-find_lawful_basis_attachments(party_index: int | None = None) → List[Dict[str, Any]][source]
-

Find lawful basis attachments in the vCon.

-
-
Parameters:
-

party_index – Filter by party index (optional)

-
-
Returns:
-

List of lawful basis attachment dictionaries

-
-
-
- -
-
-find_party_index(by: str, val: str) → int | None[source]
-

Find the index of a party in the vCon’s parties list.

-

This method searches through the parties list and returns the index of the first -party that matches the specified key-value pair.

-
-
Parameters:
-
    -
  • by – The key to search by (e.g., “name”, “type”)

  • -
  • val – The value to match

  • -
-
-
Returns:
-

The index of the matching party if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_party(Party(type="person", name="John Doe"))
->>> index = vcon.find_party_index("name", "John Doe")
->>> print(index)  # Prints 0
-
-
-
- -
-
-find_wtf_attachments(party_index: int | None = None) → List[Dict[str, Any]][source]
-

Find WTF transcription attachments in the vCon.

-
-
Parameters:
-

party_index – Filter by party index (optional)

-
-
Returns:
-

List of WTF attachment dictionaries

-
-
-
- -
-
-classmethod generate_key_pair() → Tuple[RSAPrivateKey, RSAPublicKey][source]
-

Generate a new RSA key pair for signing vCons.

-

This method generates a new RSA key pair that can be used for signing -and verifying vCons.

-
-
Returns:
-

A tuple containing the private key and public key

-
-
-

Example

-
>>> private_key, public_key = Vcon.generate_key_pair()
->>> vcon = Vcon.build_new()
->>> vcon.sign(private_key)
->>> is_valid = vcon.verify(public_key)
-
-
-
- -
-
-get_critical() → List[str][source]
-

Get the list of critical extensions that must be supported.

-
-
Returns:
-

List of extension names that must be supported, empty list if none are defined

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_critical("encryption")
->>> critical = vcon.get_critical()
->>> print(critical)  # Prints ["encryption"]
-
-
-
- -
-
-get_extensions() → List[str][source]
-

Get the list of extensions used in this vCon.

-
-
Returns:
-

List of extension names, empty list if none are defined

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_extension("video")
->>> extensions = vcon.get_extensions()
->>> print(extensions)  # Prints ["video"]
-
-
-
- -
-
-get_party_objects() → List[Party][source]
-

Get the list of parties as Party objects.

-

This method creates Party objects from the underlying dictionary data. -Use this when you need Party objects instead of raw dictionaries.

-
-
Returns:
-

A list of Party objects representing all participants in the conversation

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_party(Party(type="person", name="John Doe"))
->>> party_objects = vcon.get_party_objects()
->>> print(party_objects[0].name)  # Prints "John Doe"
-
-
-
- -
-
-get_tag(tag_name: str) → str | None[source]
-

Get the value of a specific tag by name.

-
-
Parameters:
-

tag_name – The name of the tag to retrieve

-
-
Returns:
-

The value of the tag if found, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_tag("category", "meeting")
->>> value = vcon.get_tag("category")
->>> print(value)  # Prints "meeting"
-
-
-
- -
-
-property group
-
- -
-
-is_valid() → Tuple[bool, List[str]][source]
-

Validate the vCon syntax according to the standard. -Checks required fields, ensures data types are correct, and verifies -relationships between different parts of the vCon (for example, dialog party -references and attachment fields).

-
-
Returns:
-

A tuple where the first element is True if the vCon -is valid and False otherwise, and the second element is a list of error messages.

-
-
Return type:
-

Tuple[bool, List[str]]

-
-
-
- -
-
-classmethod load(source: str, property_handling: str = 'default') → Vcon[source]
-

Load a vCon from either a file path or URL.

-
-
Parameters:
-
    -
  • source – File path or URL to load the vCon from

  • -
  • property_handling – How to handle non-standard properties. -Options are “default”, “strict”, or “meta”

  • -
-
-
Returns:
-

A Vcon object

-
-
Raises:
-
    -
  • ValueError – If the source is invalid or cannot be loaded

  • -
  • requests.RequestException – If there is an error fetching from URL

  • -
  • json.JSONDecodeError – If the source contains invalid JSON

  • -
-
-
-
- -
-
-classmethod load_from_file(file_path: str, property_handling: str = 'default') → Vcon[source]
-

Load a vCon from a file.

-
-
Parameters:
-
    -
  • file_path – Path to the vCon JSON file

  • -
  • property_handling – How to handle non-standard properties. -Options are “default”, “strict”, or “meta”

  • -
-
-
Returns:
-

A Vcon object

-
-
Raises:
-
    -
  • FileNotFoundError – If the file does not exist

  • -
  • json.JSONDecodeError – If the file contains invalid JSON

  • -
-
-
-
- -
-
-classmethod load_from_url(url: str, property_handling: str = 'default') → Vcon[source]
-

Load a vCon from a URL.

-
-
Parameters:
-
    -
  • url – URL to fetch the vCon JSON from

  • -
  • property_handling – How to handle non-standard properties. -Options are “default”, “strict”, or “meta”

  • -
-
-
Returns:
-

A Vcon object

-
-
Raises:
-
    -
  • requests.RequestException – If there is an error fetching from URL

  • -
  • json.JSONDecodeError – If the response contains invalid JSON

  • -
-
-
-
- -
-
-property meta
-
- -
-
-property parties: List[Dict[str, Any]]
-

Get the list of parties in the vCon.

-
-
Returns:
-

A list of party dictionaries representing all participants in the conversation. -These are mutable references to the internal data structure, allowing in-place modifications.

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_party(Party(type="person", name="John Doe"))
->>> parties = vcon.parties
->>> print(parties[0]["name"])  # Prints "John Doe"
->>> parties[0]["name"] = "Jane Doe"  # In-place modification works
->>> print(vcon.parties[0]["name"])  # Prints "Jane Doe"
-
-
-
- -
-
-post_to_url(url: str, headers: Dict[str, str] | None = None) → Response[source]
-

Post the vCon as JSON to a URL with optional headers.

-
-
Parameters:
-
    -
  • url (str) – The URL to post the vCon to

  • -
  • headers (Optional[Dict[str, str]]) – Optional dictionary of HTTP headers (e.g., {‘x-conserver-api-token’: ‘token123’})

  • -
-
-
Returns:
-

The HTTP response from the server

-
-
Return type:
-

requests.Response

-
-
Raises:
-

requests.RequestException – If there is an error making the HTTP request

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> response = vcon.post_to_url(
-...     'https://api.example.com/vcons',
-...     headers={'x-conserver-api-token': 'your-token-here'}
-... )
->>> print(response.status_code)  # Prints HTTP status code (e.g., 200 for success)
-
-
-
- -
-
-process_extensions() → Dict[str, Any][source]
-

Process all extensions in the vCon.

-
-
Returns:
-

Dictionary with processing results for each extension

-
-
-
- -
-
-property redacted
-
- -
-
-remove_critical(extension: str) → None[source]
-

Remove an extension from the critical list.

-
-
Parameters:
-

extension – The name of the extension to remove from critical

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_critical("encryption")
->>> vcon.remove_critical("encryption")
-
-
-
- -
-
-remove_extension(extension: str) → None[source]
-

Remove an extension from the vCon.

-
-
Parameters:
-

extension – The name of the extension to remove

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_extension("video")
->>> vcon.remove_extension("video")
-
-
-
- -
-
-save_to_file(file_path: str) → None[source]
-

Save the vCon to a JSON file.

-
-
Parameters:
-

file_path (str) – Path where the vCon JSON should be saved

-
-
Raises:
-

IOError – If there is an error writing to the file

-
-
-
- -
-
-set_created_at(created_at: str | datetime) → None[source]
-

Set the created_at field in the vCon.

-
-
Parameters:
-

created_at (Union[str, datetime]) – The timestamp to set, either as a string in ISO format -or as a datetime object.

-
-
-
- -
-
-set_updated_at(timestamp: str | datetime) → None[source]
-

Set the updated_at timestamp.

-

Args: -timestamp: The timestamp to set, either as ISO 8601 string or datetime object

-

Example: ->>> vcon = Vcon.build_new() ->>> vcon.set_updated_at(datetime.now(timezone.utc)) ->>> vcon.set_updated_at(“2025-02-18T12:00:00Z”)

-
- -
-
-sign(private_key: RSAPrivateKey | bytes) → None[source]
-

Sign the vCon using JWS (JSON Web Signature).

-

This method signs the vCon using the provided private key, adding the signature -information to the vCon. The signature can later be verified using the -corresponding public key.

-
-
Parameters:
-

private_key – The RSA private key or its PEM representation

-
-
Raises:
-

Exception – If there is an error during the signing process

-
-
-

Example

-
>>> from cryptography.hazmat.primitives.asymmetric import rsa
->>> private_key = rsa.generate_private_key(public_exponent=65537, key_size=2048)
->>> vcon = Vcon.build_new()
->>> vcon.sign(private_key)
-
-
-
- -
-
-property subject: str | None
-
- -
-
-property tags: Dict[str, Any] | None
-

Get the tags attachment from the vCon.

-
-
Returns:
-

The tags attachment dictionary if it exists, None otherwise

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon.add_tag("category", "meeting")
->>> tags = vcon.tags
->>> print(tags["body"])  # Prints ["category:meeting"]
-
-
-
- -
-
-to_dict() → Dict[str, Any][source]
-

Convert the vCon to a dictionary.

-

This method returns a dictionary representation of the vCon object, -which can be used for direct manipulation or inspection.

-
-
Returns:
-

A dictionary representation of the vCon

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> vcon_dict = vcon.to_dict()
->>> print(vcon_dict["vcon"])  # Prints "0.4.0"
-
-
-
- -
-
-to_json() → str[source]
-

Serialize the vCon to a JSON string.

-

This method converts the entire vCon object to a JSON string representation, -which can be used for storage or transmission.

-
-
Returns:
-

A JSON string representation of the vCon

-
-
-

Example

-
>>> vcon = Vcon.build_new()
->>> json_str = vcon.to_json()
->>> print(type(json_str))  # Prints "<class 'str'>"
-
-
-
- -
-
-property updated_at
-
- -
-
-property uuid: str
-
- -
-
-static uuid8_domain_name(domain_name: str) → str[source]
-
- -
-
-static uuid8_time(custom_c_62_bits: int) → str[source]
-
- -
-
-validate_extensions() → Dict[str, Any][source]
-

Validate all extensions in the vCon.

-
-
Returns:
-

Dictionary with validation results for each extension

-
-
-
- -
-
-static validate_file(file_path: str) → tuple[bool, list[str]][source]
-

Validate a vCon file at the given path.

-
-
Parameters:
-

file_path (str) – Path to the vCon JSON file

-
-
Returns:
-

A tuple containing (is_valid, list_of_errors)

-
-
Return type:
-

tuple[bool, list[str]]

-
-
-
- -
-
-static validate_json(json_str: str) → tuple[bool, list[str]][source]
-

Validate a vCon from a JSON string.

-
-
Parameters:
-

json_str (str) – JSON string representing a vCon

-
-
Returns:
-

A tuple containing (is_valid, list_of_errors)

-
-
Return type:
-

tuple[bool, list[str]]

-
-
-
- -
-
-property vcon: str | None
-
- -
-
-verify(public_key: RSAPublicKey | bytes) → bool[source]
-

Verify the JWS signature of the vCon.

-

This method verifies the vCon’s signature using the provided public key. -The vCon must have been previously signed using the corresponding private key.

-
-
Parameters:
-

public_key – The RSA public key or its PEM representation

-
-
Returns:
-

True if the signature is valid, False otherwise

-
-
Raises:
-

ValueError – If the vCon is not signed

-
-
-

Example

-
>>> private_key, public_key = Vcon.generate_key_pair()
->>> vcon = Vcon.build_new()
->>> vcon.sign(private_key)
->>> is_valid = vcon.verify(public_key)
->>> print(is_valid)  # Prints True
-
-
-
- -
- -
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/genindex.html b/docs/genindex.html deleted file mode 100644 index eb3109c..0000000 --- a/docs/genindex.html +++ /dev/null @@ -1,827 +0,0 @@ - - - - - - - - Index — vcon 0.7.0 documentation - - - - - - - - - - - - - - - -
- - -
- -
-
-
-
    -
  • - -
  • -
  • -
-
-
-
-
- - -

Index

- -
- _ - | A - | B - | C - | D - | E - | F - | G - | H - | I - | L - | M - | P - | R - | S - | T - | U - | V - -
-

_

- - -
- -

A

- - - -
- -

B

- - - -
- -

C

- - - -
- -

D

- - - -
- -

E

- - - -
- -

F

- - - -
- -

G

- - - -
- -

H

- - -
- -

I

- - - -
- -

L

- - - -
- -

M

- - -
- -

P

- - - -
- -

R

- - - -
- -

S

- - - -
- -

T

- - - -
- -

U

- - - -
- -

V

- - - -
- - - -
-
-
- -
- -
-

© Copyright 2024, Thomas McCarthy-Howe.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 6f050c1..0000000 --- a/docs/index.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - Welcome to vcon’s documentation! — vcon 0.7.0 documentation - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Welcome to vcon’s documentation!

-

vcon is a Python library for working with vCon (Virtual Conversation) containers, which are standardized formats for storing conversation data and metadata.

- -
-

Installation

-

You can install vcon using pip:

-
pip install vcon
-
-
-

For development installation:

-
git clone https://github.com/vcon-dev/vcon-lib.git
-cd vcon-lib
-poetry install
-
-
-
-
-
-

Indices and tables

- -
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/installation.html b/docs/installation.html deleted file mode 100644 index 35e4b78..0000000 --- a/docs/installation.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - Installation — vcon 0.7.0 documentation - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Installation

-

There are several ways to install the vcon library.

-
-

Using pip

-

The simplest way to install vcon is using pip:

-
pip install vcon
-
-
-
- -
-

Requirements

-

vcon requires Python 3.12 or later and has the following main dependencies:

-
    -
  • authlib>=1.6.4

  • -
  • uuid6>=2024.7.10

  • -
  • requests>=2.32.3

  • -
  • pydash>=8.0.3

  • -
  • python-dateutil>=2.9.0

  • -
  • mutagen>=1.47.0

  • -
  • ffmpeg>=1.4

  • -
  • logger>=1.4

  • -
  • pypdf>=6.0.0

  • -
  • pillow>=11.3.0

  • -
-

Some video processing features require the ffmpeg system binary to be installed and available on your PATH.

-

These dependencies will be automatically installed when you install vcon using any of the methods above.

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/new_required_fields.html b/docs/new_required_fields.html deleted file mode 100644 index a56e032..0000000 --- a/docs/new_required_fields.html +++ /dev/null @@ -1,423 +0,0 @@ - - - - - - - - - New Required Fields — vcon 0.7.0 documentation - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

New Required Fields

-

This document describes the new required fields added to the vCon library to support the latest IETF vCon specification requirements.

-
-

Overview

-

The vCon library has been updated to include new fields that enhance functionality and interoperability:

-
    -
  • vCon Object Level: Extensions and must-support requirements

  • -
  • Party Object: SIP URI, Decentralized Identifier (DID), vCard format, and timezone

  • -
  • Dialog Object: Session identifier and content hash for integrity verification

  • -
-
-
-

vCon Object Level Extensions

-

Extensions allow vCon implementations to declare additional capabilities and requirements.

-
-

Adding Extensions

-
from vcon import Vcon
-
-vcon = Vcon.build_new()
-
-# Add extensions used in this vCon
-vcon.add_extension("video")
-vcon.add_extension("encryption")
-vcon.add_extension("analytics")
-
-# Specify extensions that must be supported
-vcon.add_critical("encryption")
-vcon.add_critical("video")
-
-
-
-
-

Managing Extensions

-
# Get current extensions
-extensions = vcon.get_extensions()  # ["video", "encryption", "analytics"]
-critical = vcon.get_critical()  # ["encryption", "video"]
-
-# Remove extensions if needed
-vcon.remove_extension("analytics")
-vcon.remove_critical("video")
-
-# Check extension compatibility
-required = vcon.get_critical()
-available = vcon.get_extensions()
-
-for ext in required:
-    if ext not in available:
-        print(f"Warning: Required extension '{ext}' not available")
-
-
-
-
-
-

Enhanced Party Information

-

Parties now support additional contact and identification methods for better interoperability.

-
-

SIP URI Support

-

SIP (Session Initiation Protocol) URIs allow parties to be contacted via VoIP:

-
from vcon.party import Party
-
-party = Party(
-    name="John Doe",
-    tel="+1234567890",
-    sip="sip:john@example.com"
-)
-
-
-
-
-

Decentralized Identifier (DID) Support

-

DIDs provide blockchain-based identity management:

-
party = Party(
-    name="Alice Smith",
-    did="did:example:123456789abcdef"
-)
-
-
-
-
-

vCard Format Support

-

vCard format provides standardized contact information:

-
party = Party(
-    name="Bob Johnson",
-    jCard={
-        "fn": "Bob Johnson",
-        "tel": "+1234567890",
-        "email": "bob@example.com",
-        "org": "Example Corp",
-        "title": "Software Engineer"
-    }
-)
-
-
-
-
-

Timezone Support

-

Timezone information helps with proper time handling:

-
party = Party(
-    name="Carol Wilson",
-    timezone="America/New_York"
-)
-
-
-
-
-

Complete Party Example

-
party = Party(
-    name="John Doe",
-    tel="+1234567890",
-    sip="sip:john@example.com",
-    did="did:example:123456789abcdef",
-    jCard={
-        "fn": "John Doe",
-        "tel": "+1234567890",
-        "email": "john@example.com",
-        "org": "Example Corp"
-    },
-    timezone="America/New_York"
-)
-
-
-
-
-
-

Dialog Session Management and Content Integrity

-

Dialogs now support session tracking and content integrity verification.

-
-

Session Identifier

-

Session IDs help track conversation sessions across multiple dialogs:

-
from vcon.dialog import Dialog
-from datetime import datetime, timezone
-
-dialog = Dialog(
-    type="text",
-    start=datetime.now(timezone.utc),
-    parties=[0, 1],
-    body="Hello, this is a test message!",
-    session_id={"local": "local-uuid", "remote": "remote-uuid"}
-)
-
-# Get session ID
-session_id = dialog.get_session_id()
-
-# Set session ID
-dialog.set_session_id("session-67890")
-
-
-
-
-

Content Hash for Integrity Verification

-

Content hashes ensure data integrity and can replace the older alg/signature fields:

-
# Calculate content hash
-content_hash = dialog.calculate_content_hash()
-dialog.set_content_hash(content_hash)
-
-# Verify content integrity
-is_valid = dialog.verify_content_hash(content_hash)
-print(f"Content integrity: {is_valid}")
-
-# Get current hash
-current_hash = dialog.get_content_hash()
-
-# Set hash manually
-dialog.set_content_hash("abc123def456")
-
-
-
-
-

Complete Dialog Example

-
dialog = Dialog(
-    type="text",
-    start=datetime.now(timezone.utc),
-    parties=[0, 1],
-    body="Hello, this is a test message!",
-    session_id={"local": "local-uuid", "remote": "remote-uuid"}
-)
-
-# Calculate and set content hash for integrity verification
-content_hash = dialog.calculate_content_hash()
-dialog.set_content_hash(content_hash)
-
-# Verify content integrity
-is_valid = dialog.verify_content_hash(content_hash)
-print(f"Content integrity: {is_valid}")
-
-
-
-
-
-

JSON Serialization

-

The new fields are properly serialized to JSON:

-
# Create a vCon with new fields
-vcon = Vcon.build_new()
-vcon.add_extension("video")
-vcon.add_critical("encryption")
-
-party = Party(
-    name="John Doe",
-    sip="sip:john@example.com",
-    did="did:example:123456789abcdef",
-    jCard={"fn": "John Doe"},
-    timezone="America/New_York"
-)
-vcon.add_party(party)
-
-dialog = Dialog(
-    type="text",
-    start=datetime.now(timezone.utc),
-    parties=[0],
-    body="Hello!",
-    session_id={"local": "local-uuid", "remote": "remote-uuid"}
-)
-dialog.set_content_hash(dialog.calculate_content_hash())
-vcon.add_dialog(dialog)
-
-# Serialize to JSON
-json_data = vcon.to_json()
-print(json_data)
-
-
-

The resulting JSON will include:

-
{
-    "uuid": "...",
-    "extensions": ["video"],
-    "critical": ["encryption"],
-    "parties": [{
-        "name": "John Doe",
-        "sip": "sip:john@example.com",
-        "did": "did:example:123456789abcdef",
-        "jCard": {"fn": "John Doe"},
-        "timezone": "America/New_York"
-    }],
-    "dialog": [{
-        "type": "text",
-        "start": "...",
-        "parties": [0],
-        "body": "Hello!",
-        "session_id": {"local": "local-uuid", "remote": "remote-uuid"},
-        "content_hash": "..."
-    }]
-}
-
-
-
-
-

Backward Compatibility

-

All new fields are optional and backward compatible:

-
    -
  • Existing vCon objects without the new fields will continue to work

  • -
  • New fields only appear in JSON output when they have values

  • -
  • The library maintains compatibility with older vCon versions

  • -
-
-
-

Migration Guide

-

To migrate existing code to use the new fields:

-
    -
  1. Add Extensions: Use add_extension() and add_critical() to declare capabilities

  2. -
  3. Enhance Parties: Add SIP, DID, jCard, and timezone information to Party objects

  4. -
  5. Track Sessions: Add session_id to Dialog objects for better session management

  6. -
  7. Verify Integrity: Use content_hash for data integrity verification instead of alg/signature

  8. -
-

Example migration:

-
# Old code
-party = Party(name="John", tel="+1234567890")
-dialog = Dialog(type="text", start=datetime.now(), parties=[0], body="Hello")
-
-# New code
-party = Party(
-    name="John",
-    tel="+1234567890",
-    sip="sip:john@example.com",
-    timezone="America/New_York"
-)
-
-dialog = Dialog(
-    type="text",
-    start=datetime.now(),
-    parties=[0],
-    body="Hello",
-    session_id={"local": "local-uuid", "remote": "remote-uuid"}
-)
-dialog.set_content_hash(dialog.calculate_content_hash())
-
-
-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/objects.inv b/docs/objects.inv deleted file mode 100644 index c449320..0000000 Binary files a/docs/objects.inv and /dev/null differ diff --git a/docs/py-modindex.html b/docs/py-modindex.html deleted file mode 100644 index 39f9969..0000000 --- a/docs/py-modindex.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - Python Module Index — vcon 0.7.0 documentation - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
-
    -
  • - -
  • -
  • -
-
-
-
-
- - -

Python Module Index

- -
- v -
- - - - - - - - - - - - - - - - - - - -
 
- v
- vcon -
    - vcon.civic_address -
    - vcon.dialog -
    - vcon.party -
    - vcon.vcon -
- - -
-
-
- -
- -
-

© Copyright 2024, Thomas McCarthy-Howe.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - \ No newline at end of file diff --git a/docs/search.html b/docs/search.html deleted file mode 100644 index e9ea307..0000000 --- a/docs/search.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - Search — vcon 0.7.0 documentation - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
-
    -
  • - -
  • -
  • -
-
-
-
-
- - - - -
- -
- -
-
-
- -
- -
-

© Copyright 2024, Thomas McCarthy-Howe.

-
- - Built with Sphinx using a - theme - provided by Read the Docs. - - -
-
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/docs/search.js b/docs/search.js deleted file mode 100644 index 278e32d..0000000 --- a/docs/search.js +++ /dev/null @@ -1,46 +0,0 @@ -window.pdocSearch = (function(){ -/** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o

\n"}, {"fullname": "vcon.Vcon", "modulename": "vcon", "qualname": "Vcon", "kind": "class", "doc": "

\n"}, {"fullname": "vcon.Vcon.__init__", "modulename": "vcon", "qualname": "Vcon.__init__", "kind": "function", "doc": "

Initialize a Vcon object from a dictionary.

\n\n
Parameters
\n\n
    \n
  • vcon_dict: a dictionary representing a vCon
  • \n
\n", "signature": "(vcon_dict={})"}, {"fullname": "vcon.Vcon.vcon_dict", "modulename": "vcon", "qualname": "Vcon.vcon_dict", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.Vcon.build_from_json", "modulename": "vcon", "qualname": "Vcon.build_from_json", "kind": "function", "doc": "

Initialize a Vcon object from a JSON string.

\n\n
Parameters
\n\n
    \n
  • json_string: a JSON string representing a vCon
  • \n
\n\n
Returns
\n\n
\n

a Vcon object

\n
\n", "signature": "(cls, json_string: str) -> vcon.vcon.Vcon:", "funcdef": "def"}, {"fullname": "vcon.Vcon.build_new", "modulename": "vcon", "qualname": "Vcon.build_new", "kind": "function", "doc": "

Initialize a Vcon object with default values.

\n\n
Returns
\n\n
\n

a Vcon object

\n
\n", "signature": "(cls) -> vcon.vcon.Vcon:", "funcdef": "def"}, {"fullname": "vcon.Vcon.tags", "modulename": "vcon", "qualname": "Vcon.tags", "kind": "variable", "doc": "

Returns the tags attachment.

\n\n
Returns
\n\n
\n

the tags attachment

\n
\n", "annotation": ": Optional[dict]"}, {"fullname": "vcon.Vcon.get_tag", "modulename": "vcon", "qualname": "Vcon.get_tag", "kind": "function", "doc": "

Returns the value of a tag by name.

\n\n
Parameters
\n\n
    \n
  • tag_name: the name of the tag
  • \n
\n\n
Returns
\n\n
\n

the value of the tag or None if not found

\n
\n", "signature": "(self, tag_name) -> Optional[dict]:", "funcdef": "def"}, {"fullname": "vcon.Vcon.add_tag", "modulename": "vcon", "qualname": "Vcon.add_tag", "kind": "function", "doc": "

Adds a tag to the vCon.

\n\n
Parameters
\n\n
    \n
  • tag_name: the name of the tag
  • \n
  • tag_value: the value of the tag
  • \n
\n\n
Returns
\n\n
\n

None

\n
\n", "signature": "(self, tag_name, tag_value) -> None:", "funcdef": "def"}, {"fullname": "vcon.Vcon.find_attachment_by_type", "modulename": "vcon", "qualname": "Vcon.find_attachment_by_type", "kind": "function", "doc": "

Finds an attachment by type.

\n\n
Parameters
\n\n
    \n
  • type: the type of the attachment
  • \n
\n\n
Returns
\n\n
\n

the attachment or None if not found

\n
\n", "signature": "(self, type: str) -> Optional[dict]:", "funcdef": "def"}, {"fullname": "vcon.Vcon.add_attachment", "modulename": "vcon", "qualname": "Vcon.add_attachment", "kind": "function", "doc": "

Adds an attachment to the vCon.

\n\n
Parameters
\n\n
    \n
  • body: the body of the attachment
  • \n
  • type: the type of the attachment
  • \n
  • encoding: the encoding of the attachment body
  • \n
\n\n
Returns
\n\n
\n

None

\n
\n", "signature": "(\tself,\t*,\tbody: Union[dict, list, str],\ttype: str,\tencoding='none') -> None:", "funcdef": "def"}, {"fullname": "vcon.Vcon.find_analysis_by_type", "modulename": "vcon", "qualname": "Vcon.find_analysis_by_type", "kind": "function", "doc": "

Finds an analysis by type.

\n\n
Parameters
\n\n
    \n
  • type: the type of the analysis
  • \n
\n\n
Returns
\n\n
\n

the analysis or None if not found

\n
\n", "signature": "(self, type) -> typing.Any | None:", "funcdef": "def"}, {"fullname": "vcon.Vcon.add_analysis", "modulename": "vcon", "qualname": "Vcon.add_analysis", "kind": "function", "doc": "

Adds analysis data to the vCon.

\n\n
Parameters
\n\n
    \n
  • type: the type of the analysis
  • \n
  • dialog: the dialog(s) associated with the analysis
  • \n
  • vendor: the vendor of the analysis
  • \n
  • body: the body of the analysis
  • \n
  • encoding: the encoding of the body
  • \n
  • extra: extra key-value pairs to include in the analysis
  • \n
\n\n
Returns
\n\n
\n

None

\n
\n", "signature": "(\tself,\t*,\ttype: str,\tdialog: Union[list, int],\tvendor: str,\tbody: Union[dict, list, str],\tencoding='none',\textra={}) -> None:", "funcdef": "def"}, {"fullname": "vcon.Vcon.add_party", "modulename": "vcon", "qualname": "Vcon.add_party", "kind": "function", "doc": "

Adds a party to the vCon.

\n\n
Parameters
\n\n
    \n
  • party: the party to add
  • \n
\n\n
Returns
\n\n
\n

None

\n
\n", "signature": "(self, party: vcon.party.Party) -> None:", "funcdef": "def"}, {"fullname": "vcon.Vcon.find_party_index", "modulename": "vcon", "qualname": "Vcon.find_party_index", "kind": "function", "doc": "

Find the index of a party in the vCon given a key-value pair.

\n\n
Parameters
\n\n
    \n
  • by: the key to look for
  • \n
  • val: the value to look for
  • \n
\n\n
Returns
\n\n
\n

The index of the party if found, None otherwise

\n
\n", "signature": "(self, by: str, val: str) -> Optional[int]:", "funcdef": "def"}, {"fullname": "vcon.Vcon.find_dialog", "modulename": "vcon", "qualname": "Vcon.find_dialog", "kind": "function", "doc": "

Find a dialog in the vCon given a key-value pair. Convert the dialog to a Dialog object.

\n\n
Parameters
\n\n
    \n
  • by: the key to look for
  • \n
  • val: the value to look for
  • \n
\n\n
Returns
\n\n
\n

The dialog if found, None otherwise

\n
\n", "signature": "(self, by: str, val: str) -> Optional[vcon.dialog.Dialog]:", "funcdef": "def"}, {"fullname": "vcon.Vcon.add_dialog", "modulename": "vcon", "qualname": "Vcon.add_dialog", "kind": "function", "doc": "

Add a dialog to the vCon.

\n\n
Parameters
\n\n
    \n
  • dialog: the dialog to add
  • \n
\n\n
Returns
\n\n
\n

None

\n
\n", "signature": "(self, dialog: vcon.dialog.Dialog) -> None:", "funcdef": "def"}, {"fullname": "vcon.Vcon.to_json", "modulename": "vcon", "qualname": "Vcon.to_json", "kind": "function", "doc": "

Serialize the vCon to a JSON string.

\n\n
Returns
\n\n
\n

a JSON string representation of the vCon

\n
\n", "signature": "(self) -> str:", "funcdef": "def"}, {"fullname": "vcon.Vcon.to_dict", "modulename": "vcon", "qualname": "Vcon.to_dict", "kind": "function", "doc": "

Serialize the vCon to a dictionary.

\n\n
Returns
\n\n
\n

a dictionary representation of the vCon

\n
\n", "signature": "(self) -> dict:", "funcdef": "def"}, {"fullname": "vcon.Vcon.dumps", "modulename": "vcon", "qualname": "Vcon.dumps", "kind": "function", "doc": "

Alias for to_json().

\n\n
Returns
\n\n
\n

a JSON string representation of the vCon

\n
\n", "signature": "(self) -> str:", "funcdef": "def"}, {"fullname": "vcon.Vcon.parties", "modulename": "vcon", "qualname": "Vcon.parties", "kind": "variable", "doc": "

Returns the list of parties.

\n\n
Returns
\n\n
\n

a list of parties

\n
\n", "annotation": ": list[vcon.party.Party]"}, {"fullname": "vcon.Vcon.dialog", "modulename": "vcon", "qualname": "Vcon.dialog", "kind": "variable", "doc": "

\n", "annotation": ": list"}, {"fullname": "vcon.Vcon.attachments", "modulename": "vcon", "qualname": "Vcon.attachments", "kind": "variable", "doc": "

\n", "annotation": ": list"}, {"fullname": "vcon.Vcon.analysis", "modulename": "vcon", "qualname": "Vcon.analysis", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.Vcon.uuid", "modulename": "vcon", "qualname": "Vcon.uuid", "kind": "variable", "doc": "

\n", "annotation": ": str"}, {"fullname": "vcon.Vcon.vcon", "modulename": "vcon", "qualname": "Vcon.vcon", "kind": "variable", "doc": "

\n", "annotation": ": str"}, {"fullname": "vcon.Vcon.subject", "modulename": "vcon", "qualname": "Vcon.subject", "kind": "variable", "doc": "

\n", "annotation": ": Optional[str]"}, {"fullname": "vcon.Vcon.created_at", "modulename": "vcon", "qualname": "Vcon.created_at", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.Vcon.updated_at", "modulename": "vcon", "qualname": "Vcon.updated_at", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.Vcon.redacted", "modulename": "vcon", "qualname": "Vcon.redacted", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.Vcon.appended", "modulename": "vcon", "qualname": "Vcon.appended", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.Vcon.group", "modulename": "vcon", "qualname": "Vcon.group", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.Vcon.meta", "modulename": "vcon", "qualname": "Vcon.meta", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.Vcon.uuid8_domain_name", "modulename": "vcon", "qualname": "Vcon.uuid8_domain_name", "kind": "function", "doc": "

\n", "signature": "(domain_name: str) -> str:", "funcdef": "def"}, {"fullname": "vcon.Vcon.uuid8_time", "modulename": "vcon", "qualname": "Vcon.uuid8_time", "kind": "function", "doc": "

\n", "signature": "(custom_c_62_bits: int) -> str:", "funcdef": "def"}, {"fullname": "vcon.Vcon.sign", "modulename": "vcon", "qualname": "Vcon.sign", "kind": "function", "doc": "

Sign the vCon using JWS.

\n\n
Parameters
\n\n
    \n
  • private_key: the private key used for signing
  • \n
\n\n
Returns
\n\n
\n

None

\n
\n", "signature": "(self, private_key) -> None:", "funcdef": "def"}, {"fullname": "vcon.Vcon.verify", "modulename": "vcon", "qualname": "Vcon.verify", "kind": "function", "doc": "

Verify the JWS signature of the vCon.

\n\n
Parameters
\n\n
    \n
  • public_key: the public key used for verification
  • \n
\n\n
Returns
\n\n
\n

True if the signature is valid, False otherwise

\n
\n", "signature": "(self, public_key) -> bool:", "funcdef": "def"}, {"fullname": "vcon.Vcon.generate_key_pair", "modulename": "vcon", "qualname": "Vcon.generate_key_pair", "kind": "function", "doc": "

Generate a new RSA key pair for signing vCons.

\n\n
Returns
\n\n
\n

a tuple containing the private key and public key

\n
\n", "signature": "(cls) -> tuple:", "funcdef": "def"}, {"fullname": "vcon.party", "modulename": "vcon.party", "kind": "module", "doc": "

\n"}, {"fullname": "vcon.party.Party", "modulename": "vcon.party", "qualname": "Party", "kind": "class", "doc": "

\n"}, {"fullname": "vcon.party.Party.__init__", "modulename": "vcon.party", "qualname": "Party.__init__", "kind": "function", "doc": "

Initialize a new Party object.

\n\n
Parameters
\n\n
    \n
  • tel: Telephone number of the party
  • \n
  • stir: STIR identifier of the party
  • \n
  • mailto: Email address of the party
  • \n
  • name: Display name of the party
  • \n
  • validation: Validation information of the party
  • \n
  • gmlpos: GML position of the party
  • \n
  • civicaddress: Civic address of the party
  • \n
  • uuid: UUID of the party
  • \n
  • role: Role of the party
  • \n
  • contact_list: Contact list of the party
  • \n
\n", "signature": "(\ttel: Optional[str] = None,\tstir: Optional[str] = None,\tmailto: Optional[str] = None,\tname: Optional[str] = None,\tvalidation: Optional[str] = None,\tgmlpos: Optional[str] = None,\tcivicaddress: Optional[vcon.civic_address.CivicAddress] = None,\tuuid: Optional[str] = None,\trole: Optional[str] = None,\tcontact_list: Optional[str] = None,\tmeta: Optional[dict] = None)"}, {"fullname": "vcon.party.Party.to_dict", "modulename": "vcon.party", "qualname": "Party.to_dict", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "vcon.party.PartyHistory", "modulename": "vcon.party", "qualname": "PartyHistory", "kind": "class", "doc": "

\n"}, {"fullname": "vcon.party.PartyHistory.__init__", "modulename": "vcon.party", "qualname": "PartyHistory.__init__", "kind": "function", "doc": "

Initialize a new PartyHistory object.

\n\n
Parameters
\n\n
    \n
  • party: Index of the party
  • \n
  • event: Event type (e.g. \"join\", \"leave\")
  • \n
  • time: Time of the event
  • \n
\n", "signature": "(party: int, event: str, time: datetime.datetime)"}, {"fullname": "vcon.party.PartyHistory.party", "modulename": "vcon.party", "qualname": "PartyHistory.party", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.party.PartyHistory.event", "modulename": "vcon.party", "qualname": "PartyHistory.event", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.party.PartyHistory.time", "modulename": "vcon.party", "qualname": "PartyHistory.time", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.party.PartyHistory.to_dict", "modulename": "vcon.party", "qualname": "PartyHistory.to_dict", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "vcon.dialog", "modulename": "vcon.dialog", "kind": "module", "doc": "

\n"}, {"fullname": "vcon.dialog.MIME_TYPES", "modulename": "vcon.dialog", "qualname": "MIME_TYPES", "kind": "variable", "doc": "

\n", "default_value": "['text/plain', 'audio/x-wav', 'audio/x-mp3', 'audio/x-mp4', 'audio/ogg', 'video/x-mp4', 'video/ogg', 'multipart/mixed', 'message/external-body']"}, {"fullname": "vcon.dialog.Dialog", "modulename": "vcon.dialog", "qualname": "Dialog", "kind": "class", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.__init__", "modulename": "vcon.dialog", "qualname": "Dialog.__init__", "kind": "function", "doc": "

Initialize a Dialog object.

\n\n
Parameters
\n\n
    \n
  • type: the type of the dialog (e.g. \"text\", \"audio\", etc.)
  • \n
  • start: the start time of the dialog
  • \n
  • parties: the parties involved in the dialog
  • \n
  • originator: the party that originated the dialog
  • \n
  • mimetype: the MIME type of the dialog body
  • \n
  • filename: the filename of the dialog body
  • \n
  • body: the body of the dialog
  • \n
  • encoding: the encoding of the dialog body
  • \n
  • url: the URL of the dialog
  • \n
  • alg: the algorithm used to sign the dialog
  • \n
  • signature: the signature of the dialog
  • \n
  • disposition: the disposition of the dialog
  • \n
  • party_history: the history of parties involved in the dialog
  • \n
  • transferee: the party that the dialog was transferred to
  • \n
  • transferor: the party that transferred the dialog
  • \n
  • transfer_target: the target of the transfer
  • \n
  • original: the original dialog
  • \n
  • consultation: the consultation dialog
  • \n
  • target_dialog: the target dialog
  • \n
  • campaign: the campaign that the dialog is associated with
  • \n
  • interaction: the interaction that the dialog is associated with
  • \n
  • skill: the skill that the dialog is associated with
  • \n
  • duration: the duration of the dialog
  • \n
\n", "signature": "(\ttype: str,\tstart: datetime.datetime,\tparties: List[int],\toriginator: Optional[int] = None,\tmimetype: Optional[str] = None,\tfilename: Optional[str] = None,\tbody: Optional[str] = None,\tencoding: Optional[str] = None,\turl: Optional[str] = None,\talg: Optional[str] = None,\tsignature: Optional[str] = None,\tdisposition: Optional[str] = None,\tparty_history: Optional[List[vcon.party.PartyHistory]] = None,\ttransferee: Optional[int] = None,\ttransferor: Optional[int] = None,\ttransfer_target: Optional[int] = None,\toriginal: Optional[int] = None,\tconsultation: Optional[int] = None,\ttarget_dialog: Optional[int] = None,\tcampaign: Optional[str] = None,\tinteraction: Optional[str] = None,\tskill: Optional[str] = None,\tduration: Optional[float] = None,\tmeta: Optional[dict] = None)"}, {"fullname": "vcon.dialog.Dialog.type", "modulename": "vcon.dialog", "qualname": "Dialog.type", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.start", "modulename": "vcon.dialog", "qualname": "Dialog.start", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.parties", "modulename": "vcon.dialog", "qualname": "Dialog.parties", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.originator", "modulename": "vcon.dialog", "qualname": "Dialog.originator", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.mimetype", "modulename": "vcon.dialog", "qualname": "Dialog.mimetype", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.filename", "modulename": "vcon.dialog", "qualname": "Dialog.filename", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.body", "modulename": "vcon.dialog", "qualname": "Dialog.body", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.encoding", "modulename": "vcon.dialog", "qualname": "Dialog.encoding", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.url", "modulename": "vcon.dialog", "qualname": "Dialog.url", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.alg", "modulename": "vcon.dialog", "qualname": "Dialog.alg", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.signature", "modulename": "vcon.dialog", "qualname": "Dialog.signature", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.disposition", "modulename": "vcon.dialog", "qualname": "Dialog.disposition", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.party_history", "modulename": "vcon.dialog", "qualname": "Dialog.party_history", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.transferee", "modulename": "vcon.dialog", "qualname": "Dialog.transferee", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.transferor", "modulename": "vcon.dialog", "qualname": "Dialog.transferor", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.transfer_target", "modulename": "vcon.dialog", "qualname": "Dialog.transfer_target", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.original", "modulename": "vcon.dialog", "qualname": "Dialog.original", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.consultation", "modulename": "vcon.dialog", "qualname": "Dialog.consultation", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.target_dialog", "modulename": "vcon.dialog", "qualname": "Dialog.target_dialog", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.campaign", "modulename": "vcon.dialog", "qualname": "Dialog.campaign", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.interaction", "modulename": "vcon.dialog", "qualname": "Dialog.interaction", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.skill", "modulename": "vcon.dialog", "qualname": "Dialog.skill", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.duration", "modulename": "vcon.dialog", "qualname": "Dialog.duration", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.meta", "modulename": "vcon.dialog", "qualname": "Dialog.meta", "kind": "variable", "doc": "

\n"}, {"fullname": "vcon.dialog.Dialog.to_dict", "modulename": "vcon.dialog", "qualname": "Dialog.to_dict", "kind": "function", "doc": "

Returns a dictionary representation of the Dialog object.

\n\n
Returns
\n\n
\n

a dictionary containing the Dialog object's attributes

\n
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.add_external_data", "modulename": "vcon.dialog", "qualname": "Dialog.add_external_data", "kind": "function", "doc": "

Add external data to the dialog.

\n\n
Parameters
\n\n
    \n
  • url: the URL of the external data
  • \n
\n\n
Returns
\n\n
\n

None

\n
\n", "signature": "(self, url: str, filename: str, mimetype: str) -> None:", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.add_inline_data", "modulename": "vcon.dialog", "qualname": "Dialog.add_inline_data", "kind": "function", "doc": "

Add inline data to the dialog.

\n\n
Parameters
\n\n
    \n
  • body: the body of the inline data
  • \n
  • filename: the filename of the inline data
  • \n
  • mimetype: the mimetype of the inline data
  • \n
\n\n
Returns
\n\n
\n

None

\n
\n", "signature": "(self, body: str, filename: str, mimetype: str) -> None:", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.is_external_data", "modulename": "vcon.dialog", "qualname": "Dialog.is_external_data", "kind": "function", "doc": "

\n", "signature": "(self) -> bool:", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.is_inline_data", "modulename": "vcon.dialog", "qualname": "Dialog.is_inline_data", "kind": "function", "doc": "

\n", "signature": "(self) -> bool:", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.is_text", "modulename": "vcon.dialog", "qualname": "Dialog.is_text", "kind": "function", "doc": "

\n", "signature": "(self) -> bool:", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.is_audio", "modulename": "vcon.dialog", "qualname": "Dialog.is_audio", "kind": "function", "doc": "

\n", "signature": "(self) -> bool:", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.is_video", "modulename": "vcon.dialog", "qualname": "Dialog.is_video", "kind": "function", "doc": "

\n", "signature": "(self) -> bool:", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.is_email", "modulename": "vcon.dialog", "qualname": "Dialog.is_email", "kind": "function", "doc": "

\n", "signature": "(self) -> bool:", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.is_external_data_changed", "modulename": "vcon.dialog", "qualname": "Dialog.is_external_data_changed", "kind": "function", "doc": "

\n", "signature": "(self) -> bool:", "funcdef": "def"}, {"fullname": "vcon.dialog.Dialog.to_inline_data", "modulename": "vcon.dialog", "qualname": "Dialog.to_inline_data", "kind": "function", "doc": "

\n", "signature": "(self) -> None:", "funcdef": "def"}]; - - // mirrored in build-search-index.js (part 1) - // Also split on html tags. this is a cheap heuristic, but good enough. - elasticlunr.tokenizer.setSeperator(/[\s\-.;&_'"=,()]+|<[^>]*>/); - - let searchIndex; - if (docs._isPrebuiltIndex) { - console.info("using precompiled search index"); - searchIndex = elasticlunr.Index.load(docs); - } else { - console.time("building search index"); - // mirrored in build-search-index.js (part 2) - searchIndex = elasticlunr(function () { - this.pipeline.remove(elasticlunr.stemmer); - this.pipeline.remove(elasticlunr.stopWordFilter); - this.addField("qualname"); - this.addField("fullname"); - this.addField("annotation"); - this.addField("default_value"); - this.addField("signature"); - this.addField("bases"); - this.addField("doc"); - this.setRef("fullname"); - }); - for (let doc of docs) { - searchIndex.addDoc(doc); - } - console.timeEnd("building search index"); - } - - return (term) => searchIndex.search(term, { - fields: { - qualname: {boost: 4}, - fullname: {boost: 2}, - annotation: {boost: 2}, - default_value: {boost: 2}, - signature: {boost: 2}, - bases: {boost: 2}, - doc: {boost: 1}, - }, - expand: true - }); -})(); \ No newline at end of file diff --git a/docs/searchindex.js b/docs/searchindex.js deleted file mode 100644 index 7b66254..0000000 --- a/docs/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({"docnames": ["api/modules", "api/vcon", "index", "installation", "new_required_fields", "usage", "version_management"], "filenames": ["api/modules.rst", "api/vcon.rst", "index.rst", "installation.rst", "new_required_fields.rst", "usage.rst", "version_management.rst"], "titles": ["vcon", "vcon package", "Welcome to vcon\u2019s documentation!", "Installation", "New Required Fields", "Usage Guide", "Version Management Changes"], "terms": {"packag": [0, 2], "submodul": 0, "civic_address": 0, "modul": [0, 2], "civicaddress": [0, 1], "__init__": [0, 1, 6], "to_dict": [0, 1], "dialog": [0, 2], "mime_typ": [0, 1], "valid_disposit": [0, 1], "valid_typ": [0, 1], "add_external_data": [0, 1], "add_image_data": [0, 1], "add_inline_data": [0, 1], "add_streaming_video_refer": [0, 1], "add_video_data": [0, 1], "add_video_with_optimal_storag": [0, 1], "calculate_content_hash": [0, 1, 4, 5], "extract_image_metadata": [0, 1], "extract_video_metadata": [0, 1], "generate_thumbnail": [0, 1], "get_content_hash": [0, 1, 4], "get_session_id": [0, 1, 4], "get_video_format_from_mediatyp": [0, 1], "has_thumbnail": [0, 1], "is_audio": [0, 1], "is_email": [0, 1], "is_external_data": [0, 1], "is_external_data_chang": [0, 1], "is_imag": [0, 1], "is_incomplet": [0, 1], "is_inline_data": [0, 1], "is_pdf": [0, 1], "is_record": [0, 1], "is_text": [0, 1], "is_transf": [0, 1], "is_video": [0, 1], "set_content_hash": [0, 1, 4, 5], "set_session_id": [0, 1, 4], "to_inline_data": [0, 1], "transcode_video": [0, 1], "verify_content_hash": [0, 1, 4, 5], "parti": [0, 2], "partyhistori": [0, 1], "event": [0, 1], "time": [0, 1, 4], "valid_ev": [0, 1], "attach": [0, 1, 5], "purpos": [0, 1, 5], "bodi": [0, 1, 4, 5], "encod": [0, 1], "valid_encod": [0, 1], "from_imag": [0, 1], "vcon_dict": [0, 1, 6], "property_handl": [0, 1, 6], "add_analysi": [0, 1], "add_attach": [0, 1], "add_crit": [0, 1, 4, 5], "add_dialog": [0, 1, 4, 5], "add_extens": [0, 1, 4, 5], "add_imag": [0, 1, 5], "add_incomplete_dialog": [0, 1], "add_lawful_basis_attach": [0, 1], "add_parti": [0, 1, 4, 5], "add_tag": [0, 1], "add_transfer_dialog": [0, 1], "add_wtf_transcription_attach": [0, 1], "amend": [0, 1], "analysi": [0, 1], "build_from_json": [0, 1, 6], "build_new": [0, 1, 4, 5, 6], "check_lawful_basis_permiss": [0, 1], "created_at": [0, 1, 6], "dump": [0, 1], "find_analysis_by_typ": [0, 1], "find_attachment_by_purpos": [0, 1], "find_dialog": [0, 1], "find_dialogs_by_typ": [0, 1], "find_lawful_basis_attach": [0, 1], "find_party_index": [0, 1], "find_wtf_attach": [0, 1], "generate_key_pair": [0, 1], "get_crit": [0, 1, 4, 5], "get_extens": [0, 1, 4, 5], "get_party_object": [0, 1, 5], "get_tag": [0, 1], "group": [0, 1], "is_valid": [0, 1, 4, 5, 6], "load": [0, 1, 5, 6], "load_from_fil": [0, 1, 5, 6], "load_from_url": [0, 1, 6], "meta": [0, 1], "post_to_url": [0, 1], "process_extens": [0, 1], "redact": [0, 1], "remove_crit": [0, 1, 4], "remove_extens": [0, 1, 4], "save_to_fil": [0, 1, 5], "set_created_at": [0, 1], "set_updated_at": [0, 1], "sign": [0, 1], "subject": [0, 1], "tag": [0, 1], "to_json": [0, 1, 4], "updated_at": [0, 1], "uuid": [0, 1, 4, 5, 6], "uuid8_domain_nam": [0, 1], "uuid8_tim": [0, 1], "validate_extens": [0, 1], "validate_fil": [0, 1], "validate_json": [0, 1], "verifi": [0, 1, 4, 5], "content": [0, 5], "class": 1, "countri": 1, "str": 1, "none": [1, 6], "a1": 1, "a2": 1, "a3": 1, "a4": 1, "a5": 1, "a6": 1, "prd": 1, "pod": 1, "st": 1, "hno": 1, "hn": 1, "lmk": 1, "loc": 1, "flr": 1, "nam": 1, "pc": 1, "sourc": [1, 6], "base": [1, 4], "object": [1, 2, 5, 6], "A": 1, "repres": 1, "civic": 1, "address": 1, "inform": [1, 2], "accord": 1, "geopriv": 1, "specif": [1, 4, 6], "thi": [1, 3, 4, 5, 6], "support": [1, 5, 6], "all": [1, 3, 4, 6], "field": [1, 2], "defin": 1, "rfc": 1, "4776": 1, "i": [1, 2, 3, 4, 5], "us": [1, 2, 4, 5, 6], "within": 1, "provid": [1, 4, 6], "locat": 1, "administr": 1, "area": 1, "1": [1, 3, 4, 5, 6], "e": 1, "g": 1, "state": 1, "provinc": 1, "2": [1, 3, 6], "counti": 1, "municip": 1, "3": [1, 3], "citi": 1, "town": 1, "4": [1, 3, 6], "neighborhood": 1, "district": 1, "5": 1, "postal": 1, "code": [1, 4], "6": [1, 3], "build": 1, "floor": 1, "street": 1, "name": [1, 4, 5], "hous": 1, "number": 1, "premier": 1, "depart": 1, "suit": 1, "identif": [1, 4, 5], "iso": 1, "3166": 1, "alpha": 1, "landmark": 1, "post": 1, "offic": 1, "box": 1, "identifi": 1, "ar": [1, 2, 3, 4, 6], "option": [1, 4], "follow": [1, 3, 6], "format": [1, 2], "lowercas": 1, "requir": [1, 2, 5, 6], "initi": [1, 4], "new": [1, 2, 5, 6], "paramet": 1, "dict": 1, "convert": 1, "dictionari": 1, "The": [1, 3, 4, 6], "kei": [1, 2], "attribut": 1, "valu": [1, 4], "return": [1, 6], "": [1, 5], "type": [1, 4, 5], "start": [1, 4, 5, 6], "datetim": [1, 4, 5], "list": 1, "int": 1, "origin": 1, "mediatyp": [1, 5], "filenam": 1, "url": [1, 5], "disposit": 1, "party_histori": 1, "transfere": 1, "transferor": 1, "transfer_target": 1, "consult": 1, "target_dialog": 1, "campaign": 1, "interact": 1, "skill": 1, "durat": 1, "float": 1, "metadata": [1, 2], "ani": [1, 3], "transfer": 1, "signal": 1, "resolut": 1, "frame_r": 1, "codec": 1, "bitrat": 1, "thumbnail": 1, "session_id": [1, 4, 5], "content_hash": [1, 4, 5], "applic": [1, 6], "message_id": 1, "kwarg": 1, "segment": 1, "convers": [1, 2, 4], "piec": 1, "which": [1, 2], "can": [1, 2, 4, 5, 6], "text": [1, 4, 5], "commun": [1, 5], "email": [1, 4, 5], "chat": 1, "sm": 1, "record": [1, 5], "audio": 1, "video": [1, 3, 4, 5], "call": [1, 6], "oper": 1, "between": 1, "incomplet": 1, "fail": 1, "setup": 1, "store": [1, 2], "inlin": 1, "referenc": 1, "extern": [1, 5], "directli": 1, "via": [1, 4], "integr": [1, 2, 5], "media": 1, "wav": 1, "mp3": 1, "mp4": [1, 5], "ogg": 1, "webm": 1, "aac": 1, "avi": 1, "mkv": 1, "mov": 1, "flv": 1, "3gp": 1, "plain": 1, "multipart": 1, "messag": [1, 4, 5], "imag": [1, 5], "jpeg": 1, "tiff": 1, "pdf": [1, 5], "0": [1, 3, 4, 5, 6], "session": [1, 2], "track": [1, 4, 5], "hash": [1, 5], "file": [1, 6], "replac": [1, 4], "alg": [1, 4], "signatur": [1, 4], "updat": [1, 4], "valid": 1, "compliant": 1, "histori": 1, "join": 1, "drop": 1, "hold": 1, "unhold": 1, "mute": 1, "unmut": 1, "featur": [1, 3], "target": 1, "refer": [1, 2], "x": 1, "wave": 1, "mpeg": 1, "m4a": 1, "quicktim": 1, "msvideo": 1, "matroska": 1, "3gpp": 1, "m4v": 1, "mix": 1, "rfc822": 1, "json": [1, 2, 6], "answer": 1, "congest": 1, "busi": 1, "hung": 1, "up": 1, "voicemail": 1, "param": 1, "involv": 1, "mime": 1, "wa": 1, "associ": 1, "addit": [1, 4, 5], "structur": 1, "newer": 1, "1920x1080": 1, "frame": 1, "rate": 1, "fp": 1, "h": 1, "264": 1, "265": 1, "kbp": 1, "base64": 1, "set": [1, 4, 5, 6], "add": [1, 4, 5, 6], "data": [1, 2, 4, 6], "image_path": 1, "from": [1, 4, 5, 6], "local": [1, 4, 5], "path": [1, 3], "auto": 1, "detect": 1, "reference_id": 1, "streamabl": 1, "uniqu": 1, "video_data": 1, "true": [1, 6], "binari": [1, 3], "whether": 1, "includ": [1, 3, 4, 6], "fals": 1, "size_threshold_mb": 1, "10": [1, 3], "optim": 1, "storag": 1, "method": [1, 3, 4, 5], "size": 1, "threshold": 1, "mb": 1, "v": 1, "algorithm": 1, "sha256": 1, "calcul": [1, 4, 5], "default": [1, 6], "image_data": 1, "byte": 1, "extract": 1, "raw": 1, "video_path": 1, "comprehens": 1, "ffmpeg": [1, 3], "If": [1, 6], "contain": [1, 2], "detail": [1, 5, 6], "max_siz": 1, "tupl": 1, "200": 1, "gener": 1, "string": 1, "maximum": 1, "dimens": 1, "width": 1, "height": 1, "get": [1, 4, 5], "otherwis": 1, "etc": 1, "bool": 1, "check": [1, 4, 5, 6], "ha": [1, 3, 4, 6], "rtype": 1, "an": [1, 5], "see": 1, "content_typ": 1, "sessionid": 1, "represent": 1, "non": 1, "read": 1, "ad": [1, 6], "target_format": 1, "bit_rat": 1, "transcod": 1, "differ": [1, 6], "h264": 1, "vp9": 1, "bit": 1, "per": 1, "second": 1, "resiz": 1, "place": 1, "expected_hash": 1, "against": 1, "expect": 1, "match": 1, "tel": [1, 4, 5], "stir": 1, "mailto": 1, "gmlpo": 1, "role": 1, "contact_list": 1, "sip": [1, 5], "did": [1, 5], "jcard": [1, 4, 5], "timezon": [1, 5], "particip": [1, 5], "variou": 1, "contact": [1, 4, 5], "caller": 1, "agent": 1, "other": 1, "telephon": 1, "uri": [1, 5], "voip": [1, 4, 5], "decentr": 1, "blockchain": [1, 4], "ident": [1, 4], "displai": 1, "vcard": 1, "7095": 1, "tempor": 1, "context": 1, "gml": 1, "posit": 1, "coordin": 1, "secur": 1, "telephoni": 1, "when": [1, 3, 4, 6], "leav": 1, "chang": [1, 2], "dure": 1, "understand": 1, "flow": 1, "multi": 1, "where": 1, "mai": 1, "same": 1, "out": 1, "put": 1, "taken": 1, "off": 1, "index": [1, 2], "arrai": 1, "must": [1, 4, 5], "one": 1, "occur": 1, "serial": [1, 2], "8601": 1, "automat": [1, 3, 6], "consist": 1, "base64url": 1, "rais": 1, "valueerror": 1, "specifi": [1, 4, 5], "classmethod": 1, "creat": [1, 3, 4], "filenotfounderror": 1, "cannot": 1, "found": [1, 6], "virtual": [1, 2, 3], "standard": [1, 2, 4], "relat": 1, "It": 1, "about": [1, 5], "version": [1, 2, 4], "timestamp": 1, "creation": 1, "ancillari": 1, "document": [1, 4, 5, 6], "insight": 1, "digit": 1, "encrypt": [1, 4, 5], "extens": [1, 2], "critic": [1, 4, 5], "incompat": 1, "enhanc": [1, 2], "underli": 1, "how": 1, "properti": [1, 6], "handl": [1, 4], "empti": 1, "keep": 1, "strict": 1, "remov": [1, 4], "move": 1, "exampl": [1, 2, 5], "123": 1, "custom_field": 1, "strict_vcon": 1, "meta_vcon": 1, "vendor": 1, "product": 1, "schema": 1, "extra": 1, "more": [1, 5, 6], "entri": 1, "who": 1, "perform": 1, "indic": 1, "pair": 1, "except": 1, "invalid": 1, "sentiment": 1, "acm": 1, "score": 1, "8": [1, 3], "confid": 1, "high": 1, "print": [1, 4, 5, 6], "its": 1, "2023": 1, "01": 1, "01t00": 1, "00": 1, "00z": 1, "attempt": 1, "reason": 1, "failur": 1, "20t14": 1, "no_answ": 1, "ringdur": 1, "45000": 1, "lawful_basi": 1, "expir": 1, "purpose_gr": 1, "party_index": 1, "dialog_index": 1, "law": 1, "basi": 1, "consent": 1, "contract": 1, "grant": 1, "appli": 1, "2026": 1, "granted_at": 1, "2025": 1, "person": 1, "john": [1, 4, 5], "doe": [1, 4, 5], "tag_nam": 1, "tag_valu": 1, "exist": [1, 4, 5], "categori": 1, "meet": 1, "prioriti": 1, "transfer_data": 1, "05": 1, "forward": 1, "1234567890": [1, 4, 5], "1987654321": 1, "protocol": [1, 4], "sipmessag": 1, "302": 1, "temporarili": 1, "transcript": 1, "wtf": 1, "hello": [1, 4, 5], "world": 1, "languag": 1, "en": 1, "95": 1, "id": [1, 4, 5], "end": 1, "processed_at": 1, "01z": 1, "whisper": 1, "model": 1, "json_str": [1, 6], "pars": 1, "jsondecodeerror": 1, "union": 1, "either": 1, "current": [1, 4], "uuid8": 1, "permiss": 1, "These": [1, 3], "mutabl": 1, "intern": 1, "allow": [1, 4, 5], "modif": 1, "modifi": 1, "In": 1, "work": [1, 2, 4], "alia": 1, "find": 1, "search": [1, 2], "through": 1, "first": [1, 3], "val": 1, "transfer_dialog": 1, "filter": 1, "rsaprivatekei": 1, "rsapublickei": 1, "rsa": 1, "privat": 1, "public": 1, "private_kei": 1, "public_kei": 1, "you": [1, 2, 3, 5, 6], "need": [1, 4, 6], "instead": [1, 4, 6], "party_object": [1, 5], "retriev": 1, "syntax": 1, "ensur": [1, 4, 6], "correct": 1, "relationship": 1, "part": 1, "element": 1, "error": [1, 6], "request": [1, 3], "requestexcept": 1, "fetch": 1, "file_path": 1, "respons": 1, "jane": 1, "header": 1, "http": [1, 2, 3, 5], "conserv": 1, "api": [1, 2, 6], "token": 1, "token123": 1, "server": 1, "make": [1, 6], "com": [1, 2, 3, 4, 5], "your": [1, 3, 6], "here": [1, 5], "status_cod": 1, "statu": 1, "success": 1, "process": [1, 3], "result": [1, 4], "each": 1, "save": [1, 5], "should": 1, "ioerror": 1, "write": 1, "arg": 1, "now": [1, 4, 5], "utc": [1, 4, 5], "02": 1, "18t12": 1, "jw": 1, "web": 1, "later": [1, 3], "correspond": 1, "pem": 1, "cryptographi": 1, "hazmat": 1, "primit": 1, "asymmetr": 1, "import": [1, 4, 5, 6], "generate_private_kei": 1, "public_expon": 1, "65537": 1, "key_siz": 1, "2048": 1, "direct": 1, "manipul": 1, "inspect": 1, "entir": 1, "transmiss": 1, "static": 1, "domain_nam": 1, "custom_c_62_bit": 1, "given": 1, "list_of_error": 1, "have": [1, 4, 6], "been": [1, 4, 6], "previous": 1, "python": [2, 3], "librari": [2, 3, 4, 5, 6], "pip": 2, "poetri": 2, "recommend": [2, 6], "develop": 2, "usag": 2, "guid": 2, "basic": 2, "advanc": 2, "overview": 2, "level": 2, "manag": 2, "backward": 2, "compat": [2, 5], "migrat": 2, "benefit": 2, "troubleshoot": 2, "For": [2, 3, 5], "git": [2, 3], "clone": [2, 3], "github": [2, 3], "dev": [2, 3], "lib": [2, 3], "cd": [2, 3], "page": 2, "There": 3, "sever": [3, 6], "wai": 3, "vcon": 3, "simplest": 3, "we": 3, "haven": 3, "t": [3, 6], "alreadi": 3, "curl": 3, "ssl": 3, "org": [3, 4, 5], "python3": 3, "repositori": 3, "depend": 3, "environ": 3, "12": 3, "main": 3, "authlib": 3, "uuid6": 3, "2024": 3, "7": [3, 6], "32": 3, "pydash": 3, "dateutil": 3, "9": 3, "mutagen": 3, "47": 3, "logger": 3, "pypdf": 3, "pillow": 3, "11": 3, "some": 3, "system": 3, "avail": [3, 4, 5], "abov": [3, 6], "describ": [4, 6], "latest": [4, 6], "ietf": 4, "function": [4, 6], "interoper": [4, 6], "implement": [4, 5], "declar": [4, 5], "capabl": [4, 5], "analyt": [4, 5], "ext": [4, 5], "f": [4, 5, 6], "warn": [4, 5], "better": [4, 6], "alic": [4, 5], "smith": 4, "123456789abcdef": [4, 5], "bob": 4, "johnson": [4, 5], "fn": [4, 5], "corp": [4, 5], "titl": 4, "softwar": 4, "engin": 4, "help": [4, 5], "proper": 4, "carol": 4, "wilson": 4, "america": [4, 5], "new_york": [4, 5], "across": 4, "multipl": 4, "test": [4, 5, 6], "remot": [4, 5], "67890": 4, "older": 4, "current_hash": 4, "manual": [4, 6], "abc123def456": 4, "properli": 4, "json_data": 4, "without": [4, 6], "continu": [4, 6], "onli": [4, 6], "appear": 4, "output": 4, "thei": 4, "maintain": 4, "To": [4, 5], "old": [4, 6], "simpl": 5, "verif": 5, "my_confer": 5, "access": 5, "Not": 5, "altern": 5, "getattr": 5, "pleas": 5, "section": 5, "below": 5, "mandatori": 6, "enforc": 6, "natur": 6, "simplifi": 6, "align": 6, "flexibl": 6, "user": 6, "longer": 6, "do": 6, "unchang": 6, "strict_vers": 6, "were": 6, "simpli": 6, "caus": 6, "choos": 6, "ignor": 6, "don": 6, "them": 6, "logic": 6, "present": 6, "No": 6, "break": 6, "els": 6, "reflect": 6, "reduc": 6, "complex": 6, "cleaner": 6, "futur": 6, "proof": 6, "evolv": 6, "encount": 6, "review": 6, "changelog": 6}, "objects": {"": [[1, 0, 0, "-", "vcon"]], "vcon": [[1, 1, 1, "", "Vcon"], [1, 0, 0, "-", "civic_address"], [1, 0, 0, "-", "dialog"], [1, 0, 0, "-", "party"], [1, 0, 0, "-", "vcon"]], "vcon.Vcon": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "add_analysis"], [1, 2, 1, "", "add_attachment"], [1, 2, 1, "", "add_critical"], [1, 2, 1, "", "add_dialog"], [1, 2, 1, "", "add_extension"], [1, 2, 1, "", "add_image"], [1, 2, 1, "", "add_incomplete_dialog"], [1, 2, 1, "", "add_lawful_basis_attachment"], [1, 2, 1, "", "add_party"], [1, 2, 1, "", "add_tag"], [1, 2, 1, "", "add_transfer_dialog"], [1, 2, 1, "", "add_wtf_transcription_attachment"], [1, 3, 1, "", "amended"], [1, 3, 1, "", "analysis"], [1, 3, 1, "", "attachments"], [1, 2, 1, "", "build_from_json"], [1, 2, 1, "", "build_new"], [1, 2, 1, "", "check_lawful_basis_permission"], [1, 3, 1, "", "created_at"], [1, 3, 1, "", "dialog"], [1, 2, 1, "", "dumps"], [1, 2, 1, "", "find_analysis_by_type"], [1, 2, 1, "", "find_attachment_by_purpose"], [1, 2, 1, "", "find_dialog"], [1, 2, 1, "", "find_dialogs_by_type"], [1, 2, 1, "", "find_lawful_basis_attachments"], [1, 2, 1, "", "find_party_index"], [1, 2, 1, "", "find_wtf_attachments"], [1, 2, 1, "", "generate_key_pair"], [1, 2, 1, "", "get_critical"], [1, 2, 1, "", "get_extensions"], [1, 2, 1, "", "get_party_objects"], [1, 2, 1, "", "get_tag"], [1, 3, 1, "", "group"], [1, 2, 1, "", "is_valid"], [1, 2, 1, "", "load"], [1, 2, 1, "", "load_from_file"], [1, 2, 1, "", "load_from_url"], [1, 3, 1, "", "meta"], [1, 3, 1, "", "parties"], [1, 2, 1, "", "post_to_url"], [1, 2, 1, "", "process_extensions"], [1, 4, 1, "", "property_handling"], [1, 3, 1, "", "redacted"], [1, 2, 1, "", "remove_critical"], [1, 2, 1, "", "remove_extension"], [1, 2, 1, "", "save_to_file"], [1, 2, 1, "", "set_created_at"], [1, 2, 1, "", "set_updated_at"], [1, 2, 1, "", "sign"], [1, 3, 1, "", "subject"], [1, 3, 1, "", "tags"], [1, 2, 1, "", "to_dict"], [1, 2, 1, "", "to_json"], [1, 3, 1, "", "updated_at"], [1, 3, 1, "", "uuid"], [1, 2, 1, "", "uuid8_domain_name"], [1, 2, 1, "", "uuid8_time"], [1, 2, 1, "", "validate_extensions"], [1, 2, 1, "", "validate_file"], [1, 2, 1, "", "validate_json"], [1, 3, 1, "", "vcon"], [1, 4, 1, "", "vcon_dict"], [1, 2, 1, "", "verify"]], "vcon.civic_address": [[1, 1, 1, "", "CivicAddress"]], "vcon.civic_address.CivicAddress": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "to_dict"]], "vcon.dialog": [[1, 1, 1, "", "Dialog"]], "vcon.dialog.Dialog": [[1, 4, 1, "", "MIME_TYPES"], [1, 4, 1, "", "VALID_DISPOSITIONS"], [1, 4, 1, "", "VALID_TYPES"], [1, 2, 1, "", "__init__"], [1, 2, 1, "", "add_external_data"], [1, 2, 1, "", "add_image_data"], [1, 2, 1, "", "add_inline_data"], [1, 2, 1, "", "add_streaming_video_reference"], [1, 2, 1, "", "add_video_data"], [1, 2, 1, "", "add_video_with_optimal_storage"], [1, 2, 1, "", "calculate_content_hash"], [1, 2, 1, "", "extract_image_metadata"], [1, 2, 1, "", "extract_video_metadata"], [1, 2, 1, "", "generate_thumbnail"], [1, 2, 1, "", "get_content_hash"], [1, 2, 1, "", "get_session_id"], [1, 2, 1, "", "get_video_format_from_mediatype"], [1, 2, 1, "", "has_thumbnail"], [1, 2, 1, "", "is_audio"], [1, 2, 1, "", "is_email"], [1, 2, 1, "", "is_external_data"], [1, 2, 1, "", "is_external_data_changed"], [1, 2, 1, "", "is_image"], [1, 2, 1, "", "is_incomplete"], [1, 2, 1, "", "is_inline_data"], [1, 2, 1, "", "is_pdf"], [1, 2, 1, "", "is_recording"], [1, 2, 1, "", "is_text"], [1, 2, 1, "", "is_transfer"], [1, 2, 1, "", "is_video"], [1, 2, 1, "", "set_content_hash"], [1, 2, 1, "", "set_session_id"], [1, 2, 1, "", "to_dict"], [1, 2, 1, "", "to_inline_data"], [1, 2, 1, "", "transcode_video"], [1, 2, 1, "", "verify_content_hash"]], "vcon.party": [[1, 1, 1, "", "Party"], [1, 1, 1, "", "PartyHistory"]], "vcon.party.Party": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "to_dict"]], "vcon.party.PartyHistory": [[1, 4, 1, "", "VALID_EVENTS"], [1, 2, 1, "", "__init__"], [1, 4, 1, "", "event"], [1, 4, 1, "", "party"], [1, 4, 1, "", "time"], [1, 2, 1, "", "to_dict"]], "vcon.vcon": [[1, 1, 1, "", "Attachment"], [1, 1, 1, "", "Vcon"]], "vcon.vcon.Attachment": [[1, 4, 1, "", "VALID_ENCODINGS"], [1, 2, 1, "", "__init__"], [1, 4, 1, "", "body"], [1, 4, 1, "", "encoding"], [1, 2, 1, "", "from_image"], [1, 4, 1, "", "purpose"], [1, 2, 1, "", "to_dict"]], "vcon.vcon.Vcon": [[1, 2, 1, "", "__init__"], [1, 2, 1, "", "add_analysis"], [1, 2, 1, "", "add_attachment"], [1, 2, 1, "", "add_critical"], [1, 2, 1, "", "add_dialog"], [1, 2, 1, "", "add_extension"], [1, 2, 1, "", "add_image"], [1, 2, 1, "", "add_incomplete_dialog"], [1, 2, 1, "", "add_lawful_basis_attachment"], [1, 2, 1, "", "add_party"], [1, 2, 1, "", "add_tag"], [1, 2, 1, "", "add_transfer_dialog"], [1, 2, 1, "", "add_wtf_transcription_attachment"], [1, 3, 1, "", "amended"], [1, 3, 1, "", "analysis"], [1, 3, 1, "", "attachments"], [1, 2, 1, "", "build_from_json"], [1, 2, 1, "", "build_new"], [1, 2, 1, "", "check_lawful_basis_permission"], [1, 3, 1, "", "created_at"], [1, 3, 1, "", "dialog"], [1, 2, 1, "", "dumps"], [1, 2, 1, "", "find_analysis_by_type"], [1, 2, 1, "", "find_attachment_by_purpose"], [1, 2, 1, "", "find_dialog"], [1, 2, 1, "", "find_dialogs_by_type"], [1, 2, 1, "", "find_lawful_basis_attachments"], [1, 2, 1, "", "find_party_index"], [1, 2, 1, "", "find_wtf_attachments"], [1, 2, 1, "", "generate_key_pair"], [1, 2, 1, "", "get_critical"], [1, 2, 1, "", "get_extensions"], [1, 2, 1, "", "get_party_objects"], [1, 2, 1, "", "get_tag"], [1, 3, 1, "", "group"], [1, 2, 1, "", "is_valid"], [1, 2, 1, "", "load"], [1, 2, 1, "", "load_from_file"], [1, 2, 1, "", "load_from_url"], [1, 3, 1, "", "meta"], [1, 3, 1, "", "parties"], [1, 2, 1, "", "post_to_url"], [1, 2, 1, "", "process_extensions"], [1, 4, 1, "", "property_handling"], [1, 3, 1, "", "redacted"], [1, 2, 1, "", "remove_critical"], [1, 2, 1, "", "remove_extension"], [1, 2, 1, "", "save_to_file"], [1, 2, 1, "", "set_created_at"], [1, 2, 1, "", "set_updated_at"], [1, 2, 1, "", "sign"], [1, 3, 1, "", "subject"], [1, 3, 1, "", "tags"], [1, 2, 1, "", "to_dict"], [1, 2, 1, "", "to_json"], [1, 3, 1, "", "updated_at"], [1, 3, 1, "", "uuid"], [1, 2, 1, "", "uuid8_domain_name"], [1, 2, 1, "", "uuid8_time"], [1, 2, 1, "", "validate_extensions"], [1, 2, 1, "", "validate_file"], [1, 2, 1, "", "validate_json"], [1, 3, 1, "", "vcon"], [1, 4, 1, "", "vcon_dict"], [1, 2, 1, "", "verify"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:property", "4": "py:attribute"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "property", "Python property"], "4": ["py", "attribute", "Python attribute"]}, "titleterms": {"vcon": [0, 1, 2, 4, 5, 6], "packag": 1, "submodul": 1, "civic_address": 1, "modul": 1, "dialog": [1, 4, 5], "parti": [1, 4, 5], "content": [1, 2, 4], "welcom": 2, "": 2, "document": 2, "instal": [2, 3], "indic": 2, "tabl": 2, "us": 3, "pip": 3, "poetri": 3, "recommend": 3, "develop": 3, "requir": [3, 4], "new": 4, "field": [4, 6], "overview": [4, 6], "object": 4, "level": 4, "extens": [4, 5], "ad": 4, "manag": [4, 5, 6], "enhanc": [4, 5], "inform": [4, 5], "sip": 4, "uri": 4, "support": 4, "decentr": 4, "identifi": 4, "did": 4, "vcard": 4, "format": 4, "timezon": 4, "complet": 4, "exampl": [4, 6], "session": [4, 5], "integr": 4, "hash": 4, "verif": 4, "json": 4, "serial": 4, "backward": [4, 6], "compat": [4, 6], "migrat": [4, 6], "guid": [4, 5, 6], "usag": 5, "basic": 5, "creat": [5, 6], "contain": 5, "read": 5, "advanc": 5, "work": [5, 6], "media": 5, "file": 5, "api": 5, "refer": 5, "version": 6, "chang": 6, "kei": 6, "i": 6, "now": 6, "option": 6, "remov": 6, "paramet": 6, "updat": 6, "method": 6, "signatur": 6, "For": 6, "exist": 6, "code": 6, "handl": 6, "versionless": 6, "valid": 6, "benefit": 6, "troubleshoot": 6, "common": 6, "issu": 6, "get": 6, "help": 6}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "sphinx": 57}, "alltitles": {"vcon": [[0, "vcon"]], "vcon package": [[1, "vcon-package"]], "Submodules": [[1, "submodules"]], "vcon.civic_address module": [[1, "module-vcon.civic_address"]], "vcon.dialog module": [[1, "module-vcon.dialog"]], "vcon.party module": [[1, "module-vcon.party"]], "vcon.vcon module": [[1, "module-vcon.vcon"]], "Module contents": [[1, "module-vcon"]], "Welcome to vcon\u2019s documentation!": [[2, "welcome-to-vcon-s-documentation"]], "Contents:": [[2, null]], "Installation": [[2, "installation"], [3, "installation"]], "Indices and tables": [[2, "indices-and-tables"]], "Using pip": [[3, "using-pip"]], "Using Poetry (recommended for development)": [[3, "using-poetry-recommended-for-development"]], "Requirements": [[3, "requirements"]], "Usage Guide": [[5, "usage-guide"]], "Basic Usage": [[5, "basic-usage"]], "Creating a vCon Container": [[5, "creating-a-vcon-container"]], "Reading a vCon Container": [[5, "reading-a-vcon-container"]], "Advanced Usage": [[5, "advanced-usage"]], "Working with Extensions": [[5, "working-with-extensions"]], "Working with Enhanced Party Information": [[5, "working-with-enhanced-party-information"]], "Working with Dialog Session Management": [[5, "working-with-dialog-session-management"]], "Working with Media Files": [[5, "working-with-media-files"]], "API Reference": [[5, "api-reference"]], "Overview": [[6, "overview"], [4, "overview"]], "Backward Compatibility": [[6, "backward-compatibility"], [4, "backward-compatibility"]], "Migration Guide": [[6, "migration-guide"], [4, "migration-guide"]], "Version Management Changes": [[6, "version-management-changes"]], "Key Changes": [[6, "key-changes"]], "Version Field Is Now Optional": [[6, "version-field-is-now-optional"]], "Removed Version Management Parameters": [[6, "removed-version-management-parameters"]], "Updated Method Signatures": [[6, "updated-method-signatures"]], "For Existing Code": [[6, "for-existing-code"]], "For Version Field Handling": [[6, "for-version-field-handling"]], "Examples": [[6, "examples"]], "Creating Versionless vCons": [[6, "creating-versionless-vcons"]], "Working with Existing vCons": [[6, "working-with-existing-vcons"]], "Validation Changes": [[6, "validation-changes"]], "Benefits": [[6, "benefits"]], "Troubleshooting": [[6, "troubleshooting"]], "Common Issues": [[6, "common-issues"]], "Getting Help": [[6, "getting-help"]], "New Required Fields": [[4, "new-required-fields"]], "vCon Object Level Extensions": [[4, "vcon-object-level-extensions"]], "Adding Extensions": [[4, "adding-extensions"]], "Managing Extensions": [[4, "managing-extensions"]], "Enhanced Party Information": [[4, "enhanced-party-information"]], "SIP URI Support": [[4, "sip-uri-support"]], "Decentralized Identifier (DID) Support": [[4, "decentralized-identifier-did-support"]], "vCard Format Support": [[4, "vcard-format-support"]], "Timezone Support": [[4, "timezone-support"]], "Complete Party Example": [[4, "complete-party-example"]], "Dialog Session Management and Content Integrity": [[4, "dialog-session-management-and-content-integrity"]], "Session Identifier": [[4, "session-identifier"]], "Content Hash for Integrity Verification": [[4, "content-hash-for-integrity-verification"]], "Complete Dialog Example": [[4, "complete-dialog-example"]], "JSON Serialization": [[4, "json-serialization"]]}, "indexentries": {}}) \ No newline at end of file diff --git a/docs/source/api/modules.rst b/docs/source/api/modules.rst index e4444a0..c940e4f 100644 --- a/docs/source/api/modules.rst +++ b/docs/source/api/modules.rst @@ -1,7 +1,8 @@ -vcon -==== +API Reference +============= .. toctree:: :maxdepth: 4 vcon + vcon.extensions diff --git a/docs/source/api/vcon.extensions.rst b/docs/source/api/vcon.extensions.rst new file mode 100644 index 0000000..e0d127a --- /dev/null +++ b/docs/source/api/vcon.extensions.rst @@ -0,0 +1,106 @@ +vcon.extensions package +======================= + +vcon.extensions module +---------------------- + +.. automodule:: vcon.extensions + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.base module +--------------------------- + +.. automodule:: vcon.extensions.base + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.registry module +------------------------------- + +.. automodule:: vcon.extensions.registry + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.lawful\_basis.attachment module +----------------------------------------------- + +.. automodule:: vcon.extensions.lawful_basis.attachment + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.lawful\_basis.extension module +---------------------------------------------- + +.. automodule:: vcon.extensions.lawful_basis.extension + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.lawful\_basis.processing module +----------------------------------------------- + +.. automodule:: vcon.extensions.lawful_basis.processing + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.lawful\_basis.registry module +--------------------------------------------- + +.. automodule:: vcon.extensions.lawful_basis.registry + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.lawful\_basis.validation module +----------------------------------------------- + +.. automodule:: vcon.extensions.lawful_basis.validation + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.wtf.attachment module +------------------------------------- + +.. automodule:: vcon.extensions.wtf.attachment + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.wtf.extension module +------------------------------------ + +.. automodule:: vcon.extensions.wtf.extension + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.wtf.processing module +------------------------------------- + +.. automodule:: vcon.extensions.wtf.processing + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.wtf.providers module +------------------------------------ + +.. automodule:: vcon.extensions.wtf.providers + :members: + :undoc-members: + :show-inheritance: + +vcon.extensions.wtf.validation module +------------------------------------- + +.. automodule:: vcon.extensions.wtf.validation + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/api/vcon.rst b/docs/source/api/vcon.rst index c282611..39cc2d8 100644 --- a/docs/source/api/vcon.rst +++ b/docs/source/api/vcon.rst @@ -1,8 +1,24 @@ vcon package ============ -Submodules ----------- +Module contents +--------------- + +The package root re-exports the classes and functions most code needs. + +.. automodule:: vcon + :members: + :undoc-members: + :show-inheritance: + :noindex: + +vcon.body module +---------------- + +.. automodule:: vcon.body + :members: + :undoc-members: + :show-inheritance: vcon.civic\_address module -------------------------- @@ -20,6 +36,22 @@ vcon.dialog module :undoc-members: :show-inheritance: +vcon.event module +----------------- + +.. automodule:: vcon.event + :members: + :undoc-members: + :show-inheritance: + +vcon.migration module +--------------------- + +.. automodule:: vcon.migration + :members: + :undoc-members: + :show-inheritance: + vcon.party module ----------------- @@ -28,18 +60,26 @@ vcon.party module :undoc-members: :show-inheritance: -vcon.vcon module ----------------- +vcon.session module +------------------- -.. automodule:: vcon.vcon +.. automodule:: vcon.session :members: :undoc-members: :show-inheritance: -Module contents ---------------- +vcon.validation module +---------------------- -.. automodule:: vcon +.. automodule:: vcon.validation + :members: + :undoc-members: + :show-inheritance: + +vcon.vcon module +---------------- + +.. automodule:: vcon.vcon :members: :undoc-members: :show-inheritance: diff --git a/docs/source/conf.py b/docs/source/conf.py index 98d8081..6efd5de 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -7,16 +7,19 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information import os +import re import sys sys.path.insert(0, os.path.abspath("../../src")) project = "vcon" -copyright = "2024, Thomas McCarthy-Howe" +copyright = "2024-2026, Thomas McCarthy-Howe" author = "Thomas McCarthy-Howe" -version = "0.7.0" -release = "0.7.0" +# Read the release from pyproject.toml so the docs never drift from the package. +with open(os.path.join(os.path.dirname(__file__), "..", "..", "pyproject.toml")) as _f: + release = re.search(r'(?m)^version\s*=\s*"([^"]+)"', _f.read()).group(1) +version = ".".join(release.split(".")[:2]) # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/docs/source/index.rst b/docs/source/index.rst index c908c9c..7725911 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,12 +1,22 @@ -.. vcon documentation master file, created by - sphinx-quickstart on Sat Jan 25 17:19:09 2025. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. +vcon +==== -Welcome to vcon's documentation! -================================ +``vcon`` is a Python library for building, reading, validating, signing and +migrating vCons. A vCon (Virtual Conversation) is a JSON container for one +conversation: its parties, sessions, dialog, events, attachments and analysis. -vcon is a Python library for working with vCon (Virtual Conversation) containers, which are standardized formats for storing conversation data and metadata. +This release (|release|) implements `draft-ietf-vcon-vcon-core-05 +`_. It writes vCon +syntax ``"0.5.0"`` and reads both ``"0.4.0"`` and ``"0.5.0"``; a 0.4.0 vCon is +migrated to 0.5.0 when it is loaded. + +.. code-block:: bash + + pip install vcon + +1.0 is a breaking release. If you are upgrading from 0.10 or earlier, read +:doc:`version_management` and the `migration guide +`_ first. .. toctree:: :maxdepth: 2 @@ -14,26 +24,16 @@ vcon is a Python library for working with vCon (Virtual Conversation) containers installation usage - new_required_fields version_management api/modules -Installation ------------- - -You can install vcon using pip: - -.. code-block:: bash - - pip install vcon - -For development installation: - -.. code-block:: bash +Other documentation +------------------- - git clone https://github.com/vcon-dev/vcon-lib.git - cd vcon-lib - poetry install +* `conserver.io: vCon Library `_: quickstart and API reference +* `Changelog `_ +* `Source on GitHub `_ +* `vcon on PyPI `_ Indices and tables ================== diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 3e3086f..f695bad 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -1,59 +1,50 @@ Installation ============ -There are several ways to install the vcon library. +``vcon`` requires Python 3.12 or later. Using pip --------- -The simplest way to install vcon is using pip: - .. code-block:: bash pip install vcon -Using Poetry (recommended for development) ------------------------------------------- +The image and PDF helpers need Pillow and pypdf, which the ``image`` extra +installs: -For development, we recommend using Poetry: +.. code-block:: bash -1. First, install Poetry if you haven't already: + pip install "vcon[image]" - .. code-block:: bash +Some video features call the ``ffmpeg`` binary, which must be installed +separately and on your ``PATH``. - curl -sSL https://install.python-poetry.org | python3 - +From source +----------- -2. Clone the repository: +The project uses Poetry: - .. code-block:: bash +.. code-block:: bash - git clone https://github.com/vcon-dev/vcon-lib.git - cd vcon-lib + git clone https://github.com/vcon-dev/vcon-lib.git + cd vcon-lib + poetry install + poetry run pytest -3. Install dependencies: +To build these docs locally: - .. code-block:: bash +.. code-block:: bash - poetry install + poetry install --with dev + cd docs + poetry run make html -This will create a virtual environment and install all dependencies, including development dependencies. +The output is in ``docs/build/html``. -Requirements +Dependencies ------------ -vcon requires Python 3.12 or later and has the following main dependencies: - -- authlib>=1.6.4 -- uuid6>=2024.7.10 -- requests>=2.32.3 -- pydash>=8.0.3 -- python-dateutil>=2.9.0 -- mutagen>=1.47.0 -- ffmpeg>=1.4 -- logger>=1.4 -- pypdf>=6.0.0 -- pillow>=11.3.0 - -Some video processing features require the `ffmpeg` system binary to be installed and available on your PATH. - -These dependencies will be automatically installed when you install vcon using any of the methods above. +The runtime dependencies are listed in ``pyproject.toml`` and installed +automatically: authlib, uuid6, requests, pydash, python-dateutil, mutagen, +ffmpeg and logger. Pillow and pypdf come with the ``image`` extra. diff --git a/docs/source/new_required_fields.rst b/docs/source/new_required_fields.rst deleted file mode 100644 index 24b8f73..0000000 --- a/docs/source/new_required_fields.rst +++ /dev/null @@ -1,313 +0,0 @@ -New Required Fields -=================== - -This document describes the new required fields added to the vCon library to support the latest IETF vCon specification requirements. - -Overview --------- - -The vCon library has been updated to include new fields that enhance functionality and interoperability: - -- **vCon Object Level**: Extensions and must-support requirements -- **Party Object**: SIP URI, Decentralized Identifier (DID), vCard format, and timezone -- **Dialog Object**: Session identifier and content hash for integrity verification - -vCon Object Level Extensions ----------------------------- - -Extensions allow vCon implementations to declare additional capabilities and requirements. - -Adding Extensions -~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - from vcon import Vcon - - vcon = Vcon.build_new() - - # Add extensions used in this vCon - vcon.add_extension("video") - vcon.add_extension("encryption") - vcon.add_extension("analytics") - - # Specify extensions that must be supported - vcon.add_critical("encryption") - vcon.add_critical("video") - -Managing Extensions -~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - # Get current extensions - extensions = vcon.get_extensions() # ["video", "encryption", "analytics"] - critical = vcon.get_critical() # ["encryption", "video"] - - # Remove extensions if needed - vcon.remove_extension("analytics") - vcon.remove_critical("video") - - # Check extension compatibility - required = vcon.get_critical() - available = vcon.get_extensions() - - for ext in required: - if ext not in available: - print(f"Warning: Required extension '{ext}' not available") - -Enhanced Party Information --------------------------- - -Parties now support additional contact and identification methods for better interoperability. - -SIP URI Support -~~~~~~~~~~~~~~~ - -SIP (Session Initiation Protocol) URIs allow parties to be contacted via VoIP: - -.. code-block:: python - - from vcon.party import Party - - party = Party( - name="John Doe", - tel="+1234567890", - sip="sip:john@example.com" - ) - -Decentralized Identifier (DID) Support -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -DIDs provide blockchain-based identity management: - -.. code-block:: python - - party = Party( - name="Alice Smith", - did="did:example:123456789abcdef" - ) - -vCard Format Support -~~~~~~~~~~~~~~~~~~~~ - -vCard format provides standardized contact information: - -.. code-block:: python - - party = Party( - name="Bob Johnson", - jCard={ - "fn": "Bob Johnson", - "tel": "+1234567890", - "email": "bob@example.com", - "org": "Example Corp", - "title": "Software Engineer" - } - ) - -Timezone Support -~~~~~~~~~~~~~~~~ - -Timezone information helps with proper time handling: - -.. code-block:: python - - party = Party( - name="Carol Wilson", - timezone="America/New_York" - ) - -Complete Party Example -~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - party = Party( - name="John Doe", - tel="+1234567890", - sip="sip:john@example.com", - did="did:example:123456789abcdef", - jCard={ - "fn": "John Doe", - "tel": "+1234567890", - "email": "john@example.com", - "org": "Example Corp" - }, - timezone="America/New_York" - ) - -Dialog Session Management and Content Integrity ------------------------------------------------ - -Dialogs now support session tracking and content integrity verification. - -Session Identifier -~~~~~~~~~~~~~~~~~~ - -Session IDs help track conversation sessions across multiple dialogs: - -.. code-block:: python - - from vcon.dialog import Dialog - from datetime import datetime, timezone - - dialog = Dialog( - type="text", - start=datetime.now(timezone.utc), - parties=[0, 1], - body="Hello, this is a test message!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - - # Get session ID - session_id = dialog.get_session_id() - - # Set session ID - dialog.set_session_id("session-67890") - -Content Hash for Integrity Verification -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Content hashes ensure data integrity and can replace the older alg/signature fields: - -.. code-block:: python - - # Calculate content hash - content_hash = dialog.calculate_content_hash() - dialog.set_content_hash(content_hash) - - # Verify content integrity - is_valid = dialog.verify_content_hash(content_hash) - print(f"Content integrity: {is_valid}") - - # Get current hash - current_hash = dialog.get_content_hash() - - # Set hash manually - dialog.set_content_hash("abc123def456") - -Complete Dialog Example -~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - dialog = Dialog( - type="text", - start=datetime.now(timezone.utc), - parties=[0, 1], - body="Hello, this is a test message!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - - # Calculate and set content hash for integrity verification - content_hash = dialog.calculate_content_hash() - dialog.set_content_hash(content_hash) - - # Verify content integrity - is_valid = dialog.verify_content_hash(content_hash) - print(f"Content integrity: {is_valid}") - -JSON Serialization ------------------- - -The new fields are properly serialized to JSON: - -.. code-block:: python - - # Create a vCon with new fields - vcon = Vcon.build_new() - vcon.add_extension("video") - vcon.add_critical("encryption") - - party = Party( - name="John Doe", - sip="sip:john@example.com", - did="did:example:123456789abcdef", - jCard={"fn": "John Doe"}, - timezone="America/New_York" - ) - vcon.add_party(party) - - dialog = Dialog( - type="text", - start=datetime.now(timezone.utc), - parties=[0], - body="Hello!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - dialog.set_content_hash(dialog.calculate_content_hash()) - vcon.add_dialog(dialog) - - # Serialize to JSON - json_data = vcon.to_json() - print(json_data) - -The resulting JSON will include: - -.. code-block:: json - - { - "uuid": "...", - "extensions": ["video"], - "critical": ["encryption"], - "parties": [{ - "name": "John Doe", - "sip": "sip:john@example.com", - "did": "did:example:123456789abcdef", - "jCard": {"fn": "John Doe"}, - "timezone": "America/New_York" - }], - "dialog": [{ - "type": "text", - "start": "...", - "parties": [0], - "body": "Hello!", - "session_id": {"local": "local-uuid", "remote": "remote-uuid"}, - "content_hash": "..." - }] - } - -Backward Compatibility ----------------------- - -All new fields are optional and backward compatible: - -- Existing vCon objects without the new fields will continue to work -- New fields only appear in JSON output when they have values -- The library maintains compatibility with older vCon versions - -Migration Guide ---------------- - -To migrate existing code to use the new fields: - -1. **Add Extensions**: Use `add_extension()` and `add_critical()` to declare capabilities -2. **Enhance Parties**: Add SIP, DID, jCard, and timezone information to Party objects -3. **Track Sessions**: Add session_id to Dialog objects for better session management -4. **Verify Integrity**: Use content_hash for data integrity verification instead of alg/signature - -Example migration: - -.. code-block:: python - - # Old code - party = Party(name="John", tel="+1234567890") - dialog = Dialog(type="text", start=datetime.now(), parties=[0], body="Hello") - - # New code - party = Party( - name="John", - tel="+1234567890", - sip="sip:john@example.com", - timezone="America/New_York" - ) - - dialog = Dialog( - type="text", - start=datetime.now(), - parties=[0], - body="Hello", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - dialog.set_content_hash(dialog.calculate_content_hash()) diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 758b09a..8cf0d29 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -1,213 +1,200 @@ Usage Guide =========== -This guide will help you get started with using the vcon library. +The examples on this page run in order, in one Python session. -Basic Usage ------------ +Building a vCon +--------------- -Creating a vCon Container -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here's a simple example of creating a vCon container: +A core-05 vCon has parties, sessions and dialog. A Session groups the dialog of +one conversation, and its ``parties`` are the receivers. A Dialog's ``parties`` +are only its contributors. .. code-block:: python - from vcon import Vcon - from vcon.party import Party - from vcon.dialog import Dialog from datetime import datetime, timezone - - # Create a new vCon container - vcon = Vcon.build_new() - - # Add extensions and must-support requirements - vcon.add_extension("video") - vcon.add_extension("encryption") - vcon.add_critical("encryption") - - # Add participants with enhanced contact information - party = Party( - name="John Doe", - tel="+1234567890", - sip="sip:john@example.com", - did="did:example:123456789abcdef", - jCard={ - "fn": "John Doe", - "tel": "+1234567890", - "email": "john@example.com" - }, - timezone="America/New_York" - ) - vcon.add_party(party) - - # Create a dialog with session tracking and content integrity - dialog = Dialog( + + from vcon import Vcon, Session, Dialog + from vcon.party import Party + + now = datetime.now(timezone.utc) + + vcon = Vcon.build_new() # writes "vcon": "0.5.0" + vcon.add_party(Party(tel="+15551230001", name="Alice", role="customer")) + vcon.add_party(Party(tel="+15551230002", name="Bob", role="agent")) + + session = vcon.add_session(Session(start=now, parties=[0, 1])) + + first = vcon.add_dialog(Dialog( type="text", - start=datetime.now(timezone.utc), + start=now, parties=[0], - body="Hello, this is a test message!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} - ) - - # Calculate and set content hash for integrity verification - content_hash = dialog.calculate_content_hash() - dialog.set_content_hash(content_hash) - - vcon.add_dialog(dialog) - - # Save the container - vcon.save_to_file("my_conference.vcon") + body="Hello, I need help with my account.", + encoding="none", + mediatype="text/plain", + ), session=session) -Reading a vCon Container -~~~~~~~~~~~~~~~~~~~~~~~~ + is_valid, errors = vcon.is_valid() + print(is_valid, errors) # True [] -To read an existing vCon container: + vcon.save_to_file("conversation.vcon.json") -.. code-block:: python +``add_session()``, ``add_dialog()`` and ``add_event()`` return the index of the +new object. ``add_dialog(..., session=i)`` also lists the Dialog in Session +``i``. + +Dialog types +~~~~~~~~~~~~ - from vcon import Vcon - - # Load a vCon container - vcon = Vcon.load_from_file("my_conference.vcon") - - # Access extensions - extensions = vcon.get_extensions() - critical = vcon.get_critical() - - # Get participants with enhanced information - parties = vcon.parties - for party in parties: - print(f"Name: {party['name']}") - print(f"SIP: {party.get('sip', 'Not set')}") - print(f"DID: {party.get('did', 'Not set')}") - print(f"Timezone: {party.get('timezone', 'Not set')}") - - # Alternative: Use get_party_objects() for Party object access - party_objects = vcon.get_party_objects() - for party in party_objects: - print(f"Name: {party.name}") - print(f"SIP: {getattr(party, 'sip', 'Not set')}") - print(f"DID: {getattr(party, 'did', 'Not set')}") - print(f"Timezone: {getattr(party, 'timezone', 'Not set')}") - - # Get dialogs with session information - dialogs = vcon.dialog - for dialog in dialogs: - print(f"Session ID: {getattr(dialog, 'session_id', 'Not set')}") - print(f"Content Hash: {getattr(dialog, 'content_hash', 'Not set')}") - -Advanced Usage --------------- - -Working with Extensions -~~~~~~~~~~~~~~~~~~~~~~~ - -Extensions allow vCon implementations to declare additional capabilities: +Core-05 has three Dialog types: ``recording``, ``text`` and ``incomplete``. +Audio and video are both ``recording`` Dialogs, told apart by ``mediatype``. +``Dialog(type="audio")`` and ``Dialog(type="video")`` still work, but they +raise a ``DeprecationWarning`` and build a ``recording``. .. code-block:: python - from vcon import Vcon - - vcon = Vcon.build_new() - - # Add extensions used in this vCon - vcon.add_extension("video") - vcon.add_extension("encryption") - vcon.add_extension("analytics") - - # Specify extensions that must be supported - vcon.add_critical("encryption") - vcon.add_critical("video") - - # Check extension compatibility - required = vcon.get_critical() - available = vcon.get_extensions() - - for ext in required: - if ext not in available: - print(f"Warning: Required extension '{ext}' not available") - -Working with Enhanced Party Information -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Parties now support additional contact and identification methods: + vcon.add_dialog(Dialog( + type="recording", + start=now, + parties=[0, 1], + url="https://example.com/call.wav", + mediatype="audio/x-wav", + duration=95, + ), session=session) + + # A call that was not answered: no content, only a disposition + vcon.add_incomplete_dialog(start=now, disposition="no-answer", parties=[0]) + + # An empty Dialog Object keeps a position so no other index moves + vcon.add_dialog(Dialog.placeholder()) # serializes as {} + +Parties +~~~~~~~ .. code-block:: python - from vcon.party import Party - - # Create a party with SIP URI for VoIP communication - party = Party( - name="Alice Johnson", - tel="+1234567890", - sip="sip:alice@example.com", + from vcon.civic_address import CivicAddress + + vcon.add_party(Party( + name="Carol", + tel="+15551230003", + sip="sip:carol@example.com", did="did:example:123456789abcdef", - jCard={ - "fn": "Alice Johnson", - "tel": "+1234567890", - "email": "alice@example.com", - "org": "Example Corp" - }, - timezone="America/New_York" - ) + timezone="America/New_York", + civicaddress=CivicAddress(country="US", a1="CA", a3="San Francisco"), + )) -Working with Dialog Session Management -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Sessions and Events +------------------- -Dialogs now support session tracking and content integrity verification: +Events record what happened during a Session: joins, drops, holds, mutes, key +presses, call transfers and channel contributors. Each Event applies to the +Sessions in ``sessions``. .. code-block:: python - from vcon.dialog import Dialog - from datetime import datetime, timezone - - # Create a dialog with session tracking - dialog = Dialog( - type="text", - start=datetime.now(timezone.utc), - parties=[0, 1], - body="Hello, this is a test message!", - session_id={"local": "local-uuid", "remote": "remote-uuid"} + from vcon import Event, SessionReference + + vcon.add_event(Event(type="join", time=now, sessions=session, party=0)) + vcon.add_event(Event(type="hold", time=now, sessions=session, party=0)) + vcon.add_event(Event(type="keydown", time=now, sessions=session, party=1, button="5")) + + # A blind transfer: `sessions` is the original call, `target_session` the + # call to the transfer target. + target = vcon.add_session(Session(start=now, parties=[1, 2])) + vcon.add_event(Event(type="blind-transfer", time=now, sessions=session, party=1, + transferee=0, transfer_target=2, target_session=target)) + + # Sessions can reference each other: child, peer, precursor or breakout + vcon.sessions[session]["sessions"] = [SessionReference(target, "peer").to_dict()] + +Each Event type has a parameter table (core-05 section 4.3.1.5). ``Event(...)`` +raises ``ValueError`` when a required parameter is missing or a forbidden one is +present, and ``Vcon.is_valid()`` checks the same table for Events read from +JSON. + +Attachments and analysis +------------------------ + +An attachment needs ``party`` plus ``dialog`` or ``session``. When you give +neither ``dialog`` nor ``session``, the library uses the only Session if the +vCon has exactly one and raises ``ValueError`` otherwise. + +.. code-block:: python + + vcon.add_attachment( + purpose="invoice", + body={"amount": 42}, + encoding="json", + party=0, + session=session, ) - - # Calculate content hash for integrity verification - content_hash = dialog.calculate_content_hash() - dialog.set_content_hash(content_hash) - - # Verify content integrity - is_valid = dialog.verify_content_hash(content_hash) - print(f"Content integrity: {is_valid}") -Working with Media Files -~~~~~~~~~~~~~~~~~~~~~~~~ + vcon.add_analysis( + type="sentiment", + vendor="example-vendor", + body={"sentiment": "positive"}, + encoding="json", + dialog=first, + ) -You can attach and manage media files in a vCon container by creating dialogs and/or attachments: +Tags are whole-vCon metadata. ``add_tag()`` lists every Session, and adds an +empty placeholder Session when the vCon has none. .. code-block:: python - from vcon import Vcon - from vcon.dialog import Dialog - from datetime import datetime, timezone - - vcon = Vcon.build_new() - - # Add a video recording dialog (external URL) - dialog = Dialog( - type="recording", - start=datetime.now(timezone.utc), - parties=[0], - url="https://example.com/recording.mp4", - mediatype="video/mp4" + vcon.add_tag("department", "billing") + print(vcon.get_tag("department")) # billing + +Extensions +---------- + +``extensions`` must list every extension the vCon uses, and ``critical`` the +ones a reader must understand. The lawful basis and WTF helpers add their own +extension names. + +.. code-block:: python + + from datetime import timedelta + + vcon.add_lawful_basis_attachment( + lawful_basis="consent", + expiration=(now + timedelta(days=365)).isoformat(), + purpose_grants=[ + {"purpose": "recording", "granted": True, "granted_at": now.isoformat()}, + ], + party_index=0, + session_index=session, ) - vcon.add_dialog(dialog) - - # Add an attachment (image/pdf) - vcon.add_image("document.pdf", purpose="identification") + print(vcon.check_lawful_basis_permission("recording", party_index=0)) # True + print(vcon.get_extensions()) # ['lawful_basis'] + +Reading and validating +---------------------- + +.. code-block:: python + + loaded = Vcon.load("conversation.vcon.json") # a path or an https URL + print(loaded.vcon) # 0.5.0 + + is_valid, errors = vcon.is_valid() # MUST-level rules + warnings = vcon.get_validation_warnings() # SHOULD-level findings + + is_valid, errors = Vcon.validate_file("conversation.vcon.json") + +Signing +------- + +``sign()`` uses RS256 by default. ``sign()`` and ``verify()`` reject the JWS +``alg`` value ``"none"`` with ``AlgorithmNotPermittedError``. + +.. code-block:: python -.. _api-reference: + private_key, public_key = Vcon.generate_key_pair() + vcon.sign(private_key) + print(vcon.verify(public_key)) # True -API Reference -------------- +Loading 0.4.0 vCons +------------------- -For more detailed information about the API, please refer to the sections below. +See :doc:`version_management`. diff --git a/docs/source/version_management.rst b/docs/source/version_management.rst index 7ea0d85..9ea96aa 100644 --- a/docs/source/version_management.rst +++ b/docs/source/version_management.rst @@ -1,190 +1,94 @@ -Version Management Changes -========================== +Versions and Migration +====================== -This document describes the changes to version management in the vCon library, including the removal of mandatory version enforcement and the optional nature of the version field. +Which spec each release implements +---------------------------------- -Overview --------- +============= ====================================== ================= +``vcon`` Specification Writes ``vcon`` +============= ====================================== ================= +1.0 ``draft-ietf-vcon-vcon-core-05`` ``"0.5.0"`` +0.10 ``draft-ietf-vcon-vcon-core-04`` ``"0.4.0"`` +============= ====================================== ================= -Starting with version 0.7.0, the vCon library has simplified version management by making the version field optional and removing automatic version enforcement. This aligns with the latest vCon specification changes and provides more flexibility for users. +``Vcon.build_new()`` writes ``"vcon": "0.5.0"``. The ``vcon`` parameter is +optional on read; when present, ``is_valid()`` requires it to be ``"0.5.0"``. -Key Changes ------------ +Loading a 0.4.0 vCon +-------------------- -Version Field Is Now Optional -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``vcon`` field in vCon objects is no longer required: - -- New vCon objects created with ``Vcon.build_new()`` do not include a version field by default -- Existing vCon objects with version fields continue to work unchanged -- The version field can be manually added if needed - -Removed Version Management Parameters -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following parameters have been removed from all Vcon methods: - -- ``strict_version`` parameter removed from: - - ``Vcon.__init__()`` - - ``Vcon.build_from_json()`` - - ``Vcon.build_new()`` - - ``Vcon.load()`` - - ``Vcon.load_from_file()`` - - ``Vcon.load_from_url()`` - -Updated Method Signatures -~~~~~~~~~~~~~~~~~~~~~~~~~ - -All method signatures have been updated to remove version management: - -.. code-block:: python - - # Old signatures (no longer supported) - Vcon(vcon_dict=None, strict_version=True) - Vcon.build_new(created_at=None, strict_version=True) - Vcon.build_from_json(json_str, strict_version=True) - Vcon.load(source, strict_version=True) - - # New signatures - Vcon(vcon_dict=None, property_handling="default") - Vcon.build_new(created_at=None, property_handling="default") - Vcon.build_from_json(json_str, property_handling="default") - Vcon.load(source, property_handling="default") - -Migration Guide ---------------- - -For Existing Code -~~~~~~~~~~~~~~~~~ - -If you were using the ``strict_version`` parameter, simply remove it: - -.. code-block:: 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) - -For Version Field Handling -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The version field is now optional. You can choose to: - -1. **Ignore version fields** (recommended for new code): - - Simply don't set or check version fields - - The library will work without them - -2. **Manually manage version fields** (if needed): - - Add version fields manually when creating vCon objects - - Check version fields in your application logic - -.. code-block:: python - - # Option 1: Ignore version fields (recommended) - vcon = Vcon.build_new() - # vcon.vcon will be None - - # Option 2: Manually add version field if needed - vcon = Vcon.build_new() - vcon.vcon_dict["vcon"] = "0.5.0" - # vcon.vcon will be "0.5.0" - -Backward Compatibility -~~~~~~~~~~~~~~~~~~~~~~ - -All changes are backward compatible: - -- Existing vCon objects with version fields continue to work -- The ``vcon`` property returns the version field if present, or ``None`` if not -- No breaking changes to existing functionality - -Examples --------- - -Creating Versionless vCons -~~~~~~~~~~~~~~~~~~~~~~~~~~ +Readers accept 0.4.0 and 0.5.0. A vCon that declares ``"vcon": "0.4.0"`` is +migrated to 0.5.0 on load, following core-05 Appendix A.1. Array indices are +preserved, and ``migration_report`` lists every value the migration inferred, +every fallback it used for a required field, and every item it could not +resolve. .. code-block:: python + import json from vcon import Vcon - # Create a new vCon without version field - vcon = Vcon.build_new() - print(vcon.vcon) # None - - # Add version field manually if needed - vcon.vcon_dict["vcon"] = "0.5.0" - print(vcon.vcon) # "0.5.0" - -Working with Existing vCons -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - # Load existing vCon (with or without version field) - vcon = Vcon.load("existing.vcon.json") - - # Check if version field exists - if vcon.vcon: - print(f"Version: {vcon.vcon}") - else: - print("No version field") - -Validation Changes -~~~~~~~~~~~~~~~~~~ - -The validation logic has been updated to reflect the optional nature of the version field: + old = { + "vcon": "0.4.0", + "uuid": "01928e10-193e-8231-b9a2-279e0d16bc46", + "created_at": "2024-01-01T00:00:00Z", + "parties": [{"tel": "+15551230001"}, {"tel": "+15551230002"}], + "dialog": [{ + "type": "recording", + "start": "2024-01-01T00:00:00Z", + "parties": [0, 1], + "url": "https://example.com/call.wav", + "mediatype": "audio/x-wav", + "duration": 95, + }], + } + with open("old.vcon.json", "w") as f: + json.dump(old, f) + + vcon = Vcon.load("old.vcon.json") + print(vcon.vcon) # 0.5.0 + print(vcon.migration_report.summary()) # 2 inferred, 0 fallback, 0 unresolved + print(len(vcon.sessions)) # 1 + +The same behavior applies to ``Vcon(dict)``, ``build_from_json()``, +``load_from_file()`` and ``load_from_url()``. Two parameters control it: + +* ``migrate_legacy=False`` keeps the raw 0.4.0 dict. Property handling is not + applied to it, so legacy parameters survive. +* ``strict_migration=True`` raises ``MigrationError`` when a required field has + no source, instead of using a fallback. + +A signed 0.4.0 vCon is kept signed on load. Verify it, then migrate it +explicitly; the report sets ``resign_required``, and the library never +re-signs. + +Migrating explicitly +-------------------- .. code-block:: python - # Validation no longer requires version field - is_valid, errors = vcon.is_valid() - - # Only uuid and created_at are required fields - # Version field is optional and not validated - -Benefits --------- - -The simplified version management provides several benefits: - -1. **Reduced Complexity**: No need to manage version parameters -2. **More Flexibility**: Version fields are optional and can be added as needed -3. **Better Interoperability**: Works with vCon objects from different sources -4. **Simplified API**: Cleaner method signatures without version management -5. **Future-Proof**: Aligns with evolving vCon specification - -Troubleshooting ---------------- - -Common Issues -~~~~~~~~~~~~~ - -1. **"strict_version" parameter errors**: - - Remove the ``strict_version`` parameter from all method calls - - Update method signatures to use ``property_handling`` instead + from vcon import migrate_0_4_0_to_0_5_0 -2. **Version field not found**: - - Check if the vCon object has a version field: ``vcon.vcon is not None`` - - Add version field manually if needed: ``vcon.vcon_dict["vcon"] = "0.5.0"`` + new_dict, report = migrate_0_4_0_to_0_5_0(old, strict=False) + print(new_dict["vcon"]) # 0.5.0 + for item in report.inferred: + print(item) -3. **Validation errors**: - - Ensure required fields (uuid, created_at) are present - - Version field is no longer required for validation + # Or get a Vcon back + vcon = Vcon.migrate_0_4_0_to_0_5_0(old) -Getting Help -~~~~~~~~~~~~ +What changes in a migrated vCon +------------------------------- -If you encounter issues with the version management changes: +* Every Dialog is listed in a Session. Recording-set membership becomes Session + membership, and nested recording sets become ``child`` Session references. +* ``transfer`` Dialogs and ``party_history`` entries become Events. +* Dialog ``parties`` keep only the contributors; the receivers move to the + Session. +* ``redacted`` and ``amended`` become ``redacted_from`` and ``amended_from``. +* Attachments without a scope get the only Session when exactly one exists. -1. Check the migration guide above -2. Review the changelog for detailed changes -3. Test with the updated method signatures -4. Ensure backward compatibility with existing vCon objects +The `changelog `_ +has the full list, and the `migration guide +`_ shows the +code changes when upgrading an application from 0.10 to 1.0. diff --git a/docs/usage.html b/docs/usage.html deleted file mode 100644 index f19e78f..0000000 --- a/docs/usage.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - - Usage Guide — vcon 0.7.0 documentation - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Usage Guide

-

This guide will help you get started with using the vcon library.

-
-

Basic Usage

-
-

Creating a vCon Container

-

Here’s a simple example of creating a vCon container:

-
from vcon import Vcon
-from vcon.party import Party
-from vcon.dialog import Dialog
-from datetime import datetime, timezone
-
-# Create a new vCon container
-vcon = Vcon.build_new()
-
-# Add extensions and must-support requirements
-vcon.add_extension("video")
-vcon.add_extension("encryption")
-vcon.add_critical("encryption")
-
-# Add participants with enhanced contact information
-party = Party(
-    name="John Doe",
-    tel="+1234567890",
-    sip="sip:john@example.com",
-    did="did:example:123456789abcdef",
-    jCard={
-        "fn": "John Doe",
-        "tel": "+1234567890",
-        "email": "john@example.com"
-    },
-    timezone="America/New_York"
-)
-vcon.add_party(party)
-
-# Create a dialog with session tracking and content integrity
-dialog = Dialog(
-    type="text",
-    start=datetime.now(timezone.utc),
-    parties=[0],
-    body="Hello, this is a test message!",
-    session_id={"local": "local-uuid", "remote": "remote-uuid"}
-)
-
-# Calculate and set content hash for integrity verification
-content_hash = dialog.calculate_content_hash()
-dialog.set_content_hash(content_hash)
-
-vcon.add_dialog(dialog)
-
-# Save the container
-vcon.save_to_file("my_conference.vcon")
-
-
-
-
-

Reading a vCon Container

-

To read an existing vCon container:

-
from vcon import Vcon
-
-# Load a vCon container
-vcon = Vcon.load_from_file("my_conference.vcon")
-
-# Access extensions
-extensions = vcon.get_extensions()
-critical = vcon.get_critical()
-
-# Get participants with enhanced information
-parties = vcon.parties
-for party in parties:
-    print(f"Name: {party['name']}")
-    print(f"SIP: {party.get('sip', 'Not set')}")
-    print(f"DID: {party.get('did', 'Not set')}")
-    print(f"Timezone: {party.get('timezone', 'Not set')}")
-
-# Alternative: Use get_party_objects() for Party object access
-party_objects = vcon.get_party_objects()
-for party in party_objects:
-    print(f"Name: {party.name}")
-    print(f"SIP: {getattr(party, 'sip', 'Not set')}")
-    print(f"DID: {getattr(party, 'did', 'Not set')}")
-    print(f"Timezone: {getattr(party, 'timezone', 'Not set')}")
-
-# Get dialogs with session information
-dialogs = vcon.dialog
-for dialog in dialogs:
-    print(f"Session ID: {getattr(dialog, 'session_id', 'Not set')}")
-    print(f"Content Hash: {getattr(dialog, 'content_hash', 'Not set')}")
-
-
-
-
-
-

Advanced Usage

-
-

Working with Extensions

-

Extensions allow vCon implementations to declare additional capabilities:

-
from vcon import Vcon
-
-vcon = Vcon.build_new()
-
-# Add extensions used in this vCon
-vcon.add_extension("video")
-vcon.add_extension("encryption")
-vcon.add_extension("analytics")
-
-# Specify extensions that must be supported
-vcon.add_critical("encryption")
-vcon.add_critical("video")
-
-# Check extension compatibility
-required = vcon.get_critical()
-available = vcon.get_extensions()
-
-for ext in required:
-    if ext not in available:
-        print(f"Warning: Required extension '{ext}' not available")
-
-
-
-
-

Working with Enhanced Party Information

-

Parties now support additional contact and identification methods:

-
from vcon.party import Party
-
-# Create a party with SIP URI for VoIP communication
-party = Party(
-    name="Alice Johnson",
-    tel="+1234567890",
-    sip="sip:alice@example.com",
-    did="did:example:123456789abcdef",
-    jCard={
-        "fn": "Alice Johnson",
-        "tel": "+1234567890",
-        "email": "alice@example.com",
-        "org": "Example Corp"
-    },
-    timezone="America/New_York"
-)
-
-
-
-
-

Working with Dialog Session Management

-

Dialogs now support session tracking and content integrity verification:

-
from vcon.dialog import Dialog
-from datetime import datetime, timezone
-
-# Create a dialog with session tracking
-dialog = Dialog(
-    type="text",
-    start=datetime.now(timezone.utc),
-    parties=[0, 1],
-    body="Hello, this is a test message!",
-    session_id={"local": "local-uuid", "remote": "remote-uuid"}
-)
-
-# Calculate content hash for integrity verification
-content_hash = dialog.calculate_content_hash()
-dialog.set_content_hash(content_hash)
-
-# Verify content integrity
-is_valid = dialog.verify_content_hash(content_hash)
-print(f"Content integrity: {is_valid}")
-
-
-
-
-

Working with Media Files

-

You can attach and manage media files in a vCon container by creating dialogs and/or attachments:

-
from vcon import Vcon
-from vcon.dialog import Dialog
-from datetime import datetime, timezone
-
-vcon = Vcon.build_new()
-
-# Add a video recording dialog (external URL)
-dialog = Dialog(
-    type="recording",
-    start=datetime.now(timezone.utc),
-    parties=[0],
-    url="https://example.com/recording.mp4",
-    mediatype="video/mp4"
-)
-vcon.add_dialog(dialog)
-
-# Add an attachment (image/pdf)
-vcon.add_image("document.pdf", purpose="identification")
-
-
-
-
-
-

API Reference

-

For more detailed information about the API, please refer to the sections below.

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/version_management.html b/docs/version_management.html deleted file mode 100644 index b977a32..0000000 --- a/docs/version_management.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - - Version Management Changes — vcon 0.7.0 documentation - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Version Management Changes

-

This document describes the changes to version management in the vCon library, including the removal of mandatory version enforcement and the optional nature of the version field.

-
-

Overview

-

Starting with version 0.7.0, the vCon library has simplified version management by making the version field optional and removing automatic version enforcement. This aligns with the latest vCon specification changes and provides more flexibility for users.

-
-
-

Key Changes

-
-

Version Field Is Now Optional

-

The vcon field in vCon objects is no longer required:

-
    -
  • New vCon objects created with Vcon.build_new() do not include a version field by default

  • -
  • Existing vCon objects with version fields continue to work unchanged

  • -
  • The version field can be manually added if needed

  • -
-
-
-

Removed Version Management Parameters

-

The following parameters have been removed from all Vcon methods:

-
    -
  • strict_version parameter removed from: -- Vcon.__init__() -- Vcon.build_from_json() -- Vcon.build_new() -- Vcon.load() -- Vcon.load_from_file() -- Vcon.load_from_url()

  • -
-
-
-

Updated Method Signatures

-

All method signatures have been updated to remove version management:

-
# Old signatures (no longer supported)
-Vcon(vcon_dict=None, strict_version=True)
-Vcon.build_new(created_at=None, strict_version=True)
-Vcon.build_from_json(json_str, strict_version=True)
-Vcon.load(source, strict_version=True)
-
-# New signatures
-Vcon(vcon_dict=None, property_handling="default")
-Vcon.build_new(created_at=None, property_handling="default")
-Vcon.build_from_json(json_str, property_handling="default")
-Vcon.load(source, property_handling="default")
-
-
-
-
-
-

Migration Guide

-
-

For Existing Code

-

If you were using the strict_version parameter, simply remove it:

-
# 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)
-
-
-
-
-

For Version Field Handling

-

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

-
    -
  1. Ignore version fields (recommended for new code): -- Simply don’t set or check version fields -- The library will work without them

  2. -
  3. Manually manage version fields (if needed): -- Add version fields manually when creating vCon objects -- Check version fields in your application logic

  4. -
-
# Option 1: Ignore version fields (recommended)
-vcon = Vcon.build_new()
-# vcon.vcon will be None
-
-# Option 2: Manually add version field if needed
-vcon = Vcon.build_new()
-vcon.vcon_dict["vcon"] = "0.4.0"
-# vcon.vcon will be "0.4.0"
-
-
-
-
-

Backward Compatibility

-

All changes are backward compatible:

-
    -
  • Existing vCon objects with version fields continue to work

  • -
  • The vcon property returns the version field if present, or None if not

  • -
  • No breaking changes to existing functionality

  • -
-
-
-
-

Examples

-
-

Creating Versionless vCons

-
from vcon import Vcon
-
-# Create a new vCon without version field
-vcon = Vcon.build_new()
-print(vcon.vcon)  # None
-
-# Add version field manually if needed
-vcon.vcon_dict["vcon"] = "0.4.0"
-print(vcon.vcon)  # "0.4.0"
-
-
-
-
-

Working with Existing vCons

-
# Load existing vCon (with or without version field)
-vcon = Vcon.load("existing.vcon.json")
-
-# Check if version field exists
-if vcon.vcon:
-    print(f"Version: {vcon.vcon}")
-else:
-    print("No version field")
-
-
-
-
-

Validation Changes

-

The validation logic has been updated to reflect the optional nature of the version field:

-
# Validation no longer requires version field
-is_valid, errors = vcon.is_valid()
-
-# Only uuid and created_at are required fields
-# Version field is optional and not validated
-
-
-
-
-
-

Benefits

-

The simplified version management provides several benefits:

-
    -
  1. Reduced Complexity: No need to manage version parameters

  2. -
  3. More Flexibility: Version fields are optional and can be added as needed

  4. -
  5. Better Interoperability: Works with vCon objects from different sources

  6. -
  7. Simplified API: Cleaner method signatures without version management

  8. -
  9. Future-Proof: Aligns with evolving vCon specification

  10. -
-
-
-

Troubleshooting

-
-

Common Issues

-
    -
  1. “strict_version” parameter errors: -- Remove the strict_version parameter from all method calls -- Update method signatures to use property_handling instead

  2. -
  3. Version field not found: -- Check if the vCon object has a version field: vcon.vcon is not None -- Add version field manually if needed: vcon.vcon_dict["vcon"] = "0.4.0"

  4. -
  5. Validation errors: -- Ensure required fields (uuid, created_at) are present -- Version field is no longer required for validation

  6. -
-
-
-

Getting Help

-

If you encounter issues with the version management changes:

-
    -
  1. Check the migration guide above

  2. -
  3. Review the changelog for detailed changes

  4. -
  5. Test with the updated method signatures

  6. -
  7. Ensure backward compatibility with existing vCon objects

  8. -
-
-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 056a767..b3a6af2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,31 @@ [tool.poetry] name = "vcon" -version = "1.0.0" +version = "1.0.1" description = "The vCon library - vCon 0.5.0 (draft-ietf-vcon-vcon-core-05) specification implementation" authors = ["Thomas McCarthy-Howe "] license = "MIT" readme = "README.md" +homepage = "https://www.conserver.io/vcon-library" +repository = "https://github.com/vcon-dev/vcon-lib" +documentation = "https://vcon-dev.github.io/vcon-lib/" +keywords = ["vcon", "ietf", "conversation", "call recording", "transcription"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Topic :: Communications :: Telephony", + "Topic :: Software Development :: Libraries :: Python Modules", +] packages = [ { include = "vcon", from = "src" } ] +[tool.poetry.urls] +"Changelog" = "https://github.com/vcon-dev/vcon-lib/blob/main/CHANGELOG.md" +"Migration guide" = "https://github.com/vcon-dev/vcon-lib/blob/main/MIGRATION_GUIDE.md" +"Issues" = "https://github.com/vcon-dev/vcon-lib/issues" +"Specification" = "https://datatracker.ietf.org/doc/draft-ietf-vcon-vcon-core/" + [tool.poetry.dependencies] python = "^3.12" authlib = "^1.6.12" diff --git a/setup.py b/setup.py index 12ff616..6b02437 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,10 @@ setup( name="vcon", - version="1.0.0", + version="1.0.1", author="Thomas McCarthy-Howe", author_email="ghostofbasho@gmail.com", - description="A package for working with vCon containers", + description="The vCon library - vCon 0.5.0 (draft-ietf-vcon-vcon-core-05) specification implementation", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/vcon-dev/vcon-lib", diff --git a/src/vcon/dialog.py b/src/vcon/dialog.py index 1f6379e..00b91ca 100644 --- a/src/vcon/dialog.py +++ b/src/vcon/dialog.py @@ -161,7 +161,8 @@ class Dialog: - text: Text-based communication (email, chat, SMS) - recording: Audio/video recording of the conversation - incomplete: Failed or incomplete conversation setup - - video: Video content with metadata + + ``"audio"`` and ``"video"`` are accepted as deprecated aliases for ``recording``. Dialog content can be stored inline or referenced externally: - Inline: Content stored directly in the body field @@ -174,6 +175,7 @@ class Dialog: - Images: JPEG, TIFF, PDF Changes in vCon 0.5.0 (draft-ietf-vcon-vcon-core-05): + - ``parties`` lists the contributors only. The receivers are in the ``parties`` of the Session Object that references the dialog. - ``originator`` moved to the Session Object. diff --git a/src/vcon/vcon.py b/src/vcon/vcon.py index 67039b4..2b7d27a 100644 --- a/src/vcon/vcon.py +++ b/src/vcon/vcon.py @@ -256,8 +256,9 @@ class Vcon: and analysis data. The vCon format supports features such as: + - Unique identification via UUID - - Optional versioning (version field is optional) + - The ``vcon`` syntax version (written as ``"0.5.0"``) - Timestamps for creation and updates - Party information with contact details (tel, name, sip, did, jCard, timezone) - Dialog content with media types and session information @@ -270,6 +271,7 @@ class Vcon: (``events``) for joins, drops, holds, key presses and transfers New in vCon 0.5.0 (draft-ietf-vcon-vcon-core-05): + - ``sessions`` and ``events`` arrays; ``Session`` and ``Event`` classes - ``redacted_from`` and ``amended_from`` replace ``redacted`` and ``amended`` - Attachments need ``party`` and ``dialog`` or ``session``