Registry / type-stubs / vkbottle-types

vkbottle-types

JSON →
library5.199.99.21pypypi✓ verified 84d ago

vkbottle-types is a companion library to vkbottle, providing machine-generated type hints and Pydantic models for VK API methods and objects. It ensures robust type checking and auto-completion for developers working with the VK API. The current version is 5.199.99.20, with updates frequently released to reflect VK API changes.

pip install vkbottle-types
INSTALL
IMPORT
SIG · VKBOTTLE-TYPES
V
vkbottle-types
type-stubspythonv5.199.99.21
Install
6.3s avg
Import
7424ms
Disk
43MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.199.99.21 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 7.717s · 43.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 6.3s · import 7.130s · 45MB
43MB installed
● package 43MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

UsersUser
from vkbottle_types.objects import UsersUser
Commonly used Pydantic model for VK user profiles.
MessagesMessage
from vkbottle_types.objects import MessagesMessage
Represents the raw message object from the VK API, frequently used in vkbottle message handlers.
APIMethods
from vkbottle_types.methods import APIMethods
Provides type hints for VK API methods, useful for type-checking vkbottle's API object.
BaseModel
from vkbottle_types.base_model import BaseModel
The base Pydantic model from which all vkbottle-types objects inherit.

This quickstart demonstrates how to instantiate and interact with Pydantic models provided by `vkbottle-types`. These models allow for strong type-hinting and validation of VK API objects, which are typically received or sent when using the `vkbottle` library.

import json from vkbottle_types.objects import UsersUser, MessagesMessage # Example 1: Instantiating a User type user_data = { "id": 12345, "first_name": "Alex", "last_name": "Example", "is_closed": False, "can_access_closed": True } user: UsersUser = UsersUser(**user_data) print(f"User ID: {user.id}, Full Name: {user.first_name} {user.last_name}") print(f"User JSON: {user.json(indent=2)}") # Example 2: Demonstrating another type's structure message_payload_data = { "id": 1, "peer_id": 2000000001, "from_id": 12345, "date": 1678886400, "text": "Hello, vkbottle-types!", "random_id": 0, "attachments": [], "fwd_messages": [], "important": False, "is_hidden": False, "out": 0, "conversation_message_id": 1 } message_payload: MessagesMessage = MessagesMessage(**message_payload_data) print(f"Message text: '{message_payload.text}' from user {message_payload.from_id}") # These types are primarily used for type hinting and data validation # in vkbottle applications, not for direct API calls.
Debug
Known issues
gotchavkbottle-types versions should always be kept compatible with your vkbottle library version. Mismatched versions can lead to `AttributeError`, `TypeError`, or `ImportError` due to schema changes or internal refactors.
fix
Always update both `vkbottle` and `vkbottle-types` simultaneously using `pip install --upgrade vkbottle vkbottle-types`.
affects: All versions
gotchaAs vkbottle-types directly mirrors the VK API schema, rapid changes in the VK API might lead to temporary inconsistencies. The library's types may not exactly match the latest API responses until an update is released.
fix
Monitor the vkbottle-types GitHub repository for updates following VK API announcements. If encountering `AttributeError` on a new field, it might indicate an unreleased change.
affects: All versions
gotchaInstantiating some nested or polymorphic types directly from raw data can be challenging. Ensure your data structure precisely matches the expected Pydantic schema for complex objects to avoid `TypeError` or validation errors.
fix
Refer to the VK API documentation for the exact structure of complex objects or use vkbottle's parsing mechanisms when available.
affects: All versions
Errors
Common errors & fixes
AttributeError: 'MessagesMessage' object has no attribute 'some_new_field'
The VK API has introduced a new field that is not yet reflected in your installed `vkbottle-types` version, or the field name was misspelled.
fix
Update `vkbottle-types` to the latest version (`pip install --upgrade vkbottle-types`) or verify the field name against official VK API documentation.
TypeError: __init__() got an unexpected keyword argument 'old_field_name'
The VK API schema (and thus `vkbottle-types`) has removed or renamed a field that you are attempting to provide during model instantiation.
fix
Review the `vkbottle-types` model definition (e.g., in its source code) or VK API documentation for the correct and current field names. Remove or rename the problematic argument.
ImportError: cannot import name 'SomeType' from 'vkbottle_types.objects'
The specified type name is incorrect, misspelled, or the type has been moved/renamed in a newer version of `vkbottle-types`.
fix
Consult the `vkbottle-types` documentation or explore the `vkbottle_types` package content (e.g., using an IDE's autocomplete or `dir()`) to find the correct import path and symbol name.
Upgrade
Version history
5.199.99.21latest on PyPI · released Jun 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
43 hits · last 30 days
node
36
OpenAI (training)
1
Resources
vkbottle-types — pip install vkbottle-types · libregistry