Registry /
http-networking / microsoft-kiota-abstractions
Install & Compatibility
Where this runs
tested against v1.12.0 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.192s · 22.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.1s · import 0.172s · 23MB
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RequestInformation
✓ from kiota_abstractions.request_information import RequestInformation
RequestAdapter
✓ from kiota_abstractions.request_adapter import RequestAdapter
Parsable
✓ from kiota_abstractions.serialization import Parsable
ParseNode
✓ from kiota_abstractions.serialization import ParseNode
SerializationWriter
✓ from kiota_abstractions.serialization import SerializationWriter
HttpMethod
✓ from kiota_abstractions.http.method import HttpMethod
BaseRequestBuilder
✓ from kiota_abstractions.base_request_builder import BaseRequestBuilder
This quickstart demonstrates how to implement the `Parsable` interface, a core abstraction for data models in Kiota. While typically Kiota generates these implementations, understanding `get_field_deserializers` and `serialize` is fundamental when working with or extending Kiota-generated SDKs. This example defines a simple model with string and datetime fields.
import datetime
from typing import Dict, Optional
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
class MySimpleModel(Parsable):
"""Represents a simple data model implementing Parsable."""
def __init__(self) -> None:
self._id: Optional[str] = None
self._name: Optional[str] = None
self._created_at: Optional[datetime.datetime] = None
@property
def id(self) -> Optional[str]:
return self._id
@id.setter
def id(self, value: Optional[str]) -> None:
self._id = value
@property
def name(self) -> Optional[str]:
return self._name
@name.setter
def name(self, value: Optional[str]) -> None:
self._name = value
@property
def created_at(self) -> Optional[datetime.datetime]:
return self._created_at
@created_at.setter
def created_at(self, value: Optional[datetime.datetime]) -> None:
self._created_at = value
def get_field_deserializers(self) -> Dict[str, callable]:
"""The deserialization information for the current model"""
return {
"id": lambda n: setattr(self, 'id', n.get_str_value()),
"name": lambda n: setattr(self, 'name', n.get_str_value()),
"createdAt": lambda n: setattr(self, 'created_at', n.get_datetime_value())
}
def serialize(self, writer: SerializationWriter) -> None:
"""Serializes information the current object"""
if not writer:
raise TypeError("writer cannot be None")
writer.write_str_value("id", self.id)
writer.write_str_value("name", self.name)
writer.write_datetime_value("createdAt", self.created_at)
# Example usage (typically handled by Kiota-generated code)
model = MySimpleModel()
model.id = "123"
model.name = "Test Model"
model.created_at = datetime.datetime.now(datetime.timezone.utc)
print(f"Model ID: {model.id}, Name: {model.name}, Created At: {model.created_at}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'microsoft.kiota.abstractions'
The 'microsoft-kiota-abstractions' Python package is not installed in the current environment.
fixInstall the package using pip: `pip install microsoft-kiota-abstractions`
Microsoft.Kiota.Abstractions: Content type text/html does not have a factory registered to be parsed.
The Kiota client received a response with a 'text/html' content type, but no deserialization factory is registered to handle it. This often occurs when an API returns an HTML error page instead of an expected data format like JSON.
fixEnsure the API consistently returns a parsable content type (e.g., `application/json`) or register a custom deserialization factory for 'text/html' if it's an expected response.
Unhandled exception. Microsoft.Kiota.Abstractions.ApiException: The server returned an unexpected status code and the error registered for this code failed to deserialize: [status code]
The Kiota client encountered an HTTP response with an unexpected status code (e.g., 404, 500) that was either not defined in the OpenAPI specification's error mappings or whose response body could not be deserialized into the expected error model.
fixImplement robust error handling by catching `ApiException` and inspecting `ResponseStatusCode`. Ensure your OpenAPI schema accurately defines error responses with schemas so Kiota can generate appropriate error models for deserialization.
Python codegen models of custom API errors do not map detail onto APIError's message attribute
When Kiota generates Python clients, custom error models containing a 'detail' field might not automatically map this content to the generic `APIError.message` attribute, unlike in other generated languages.
fixManually access the 'detail' attribute from the specific generated error model, or adjust your Kiota generation configuration to provide a custom mapping to populate the `APIError.message` from the 'detail' field in the Python client.
Upgrade
Version history
1.12.0latest on PyPI · released Aug 27, 2026
Audit
Dependencies
No dependency data recorded yet.