Enum class Version
Package: keychain.constants
Description
Version number.
For general use in versioning data serialization formats, database schema, etc. This enum provides standardized version identifiers used throughout the keychain library to maintain compatibility across different releases and data formats.
Since: v2.0
Enum Class Summary
Enum Constant | Value | Description |
---|---|---|
0 |
Uninitialized version state |
|
1 |
Version released July 16, 2019 |
|
2 |
Version released March 4, 2020 |
|
3 |
Version released April 12, 2022 |
|
4 |
Version released January 2, 2023 |
|
5 |
Version released April 12, 2024 (Herbie Hancock’s birthday) |
Enum Class Detail
UNINITIALIZED_VERSION
Value: 0
Uninitialized version state. This indicates that no specific version has been set.
V20190716
Value: 1
Version released July 16, 2019. This represents an early version of the keychain library data formats.
V20200304
Value: 2
Version released March 4, 2020. This version introduced updates to the serialization and database schema.
V20220412
Value: 3
Version released April 12, 2022. This version included significant improvements to the core cryptographic operations.
Usage Example
from keychain.constants import Version
# Get the latest version
latest_version = Version.V20240412
print(f"Latest version: {latest_version}") # Outputs: 5
# Check version compatibility
def is_version_compatible(version):
return version.value >= Version.V20220412.value
# Example usage
current_version = Version.V20230102
if is_version_compatible(current_version):
print("Version is compatible with current features")
else:
print("Version may not support all current features")
# Version comparison
if latest_version.value > current_version.value:
print("A newer version is available")