import json package_path = "package.json" with open(package_path) as package_file: package_data = json.load(package_file) print("Updating package: " + package_data["displayName"]) print("Starting package version: " + package_data["version"]) package_version_old = package_data["version"] package_version_split = package_version_old.split(".") package_version_split[-1] = str(int(package_version_split[-1]) + 1) package_version_new = ".".join(package_version_split) package_data["version"] = package_version_new print("Updated package version: " + package_data["version"]) with open(package_path, 'w') as package_file: json.dump(package_data, package_file, indent=4)