Registry / serialization / microsoft-kiota-serialization-text

microsoft-kiota-serialization-text

JSON →
library1.12.0pypypi✓ verified 25d ago

This library provides core serialization and deserialization capabilities for plain text (`text/plain`) within the Microsoft Kiota ecosystem for Python. It allows Kiota-generated API clients to handle text-based responses and requests. The current version is 1.10.1, and releases are frequent, synchronized with the broader Kiota project across multiple languages.

pip install microsoft-kiota-serialization-text
INSTALL
IMPORT
SIG · MICROSOFT-KIOTA-SE
M
microsoft-kiota-serialization-text
serializationpythonv1.12.0
Install
2.2s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.000s · 23MB
21MB installed
● package 21MB
Code
Verified usage

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

TextSerializationWriterFactory
from kiota_serialization_text.text_serialization_writer import TextSerializationWriterFactory
from kiota_serialization_text import TextSerializationWriterFactory

This quickstart demonstrates how to use `TextSerializationWriterFactory` to serialize a string to bytes and `TextParseNodeFactory` to deserialize those bytes back into a string, explicitly handling the 'text/plain' content type.

from microsoft_kiota_serialization_text import TextParseNodeFactory, TextSerializationWriterFactory # Instantiate the factory for text serialization writer_factory = TextSerializationWriterFactory() writer = writer_factory.get_serialization_writer('text/plain') # Serialize a string value writer.write_str_value(None, 'Hello from Kiota!') serialized_content = writer.get_serialized_content() # Returns bytes print(f"Serialized (bytes): {serialized_content}") print(f"Serialized (str): {serialized_content.decode('utf-8')}") # Instantiate the factory for text deserialization parser_factory = TextParseNodeFactory() parser = parser_factory.get_parse_node('text/plain', serialized_content) # Deserialize the string value deserialized_value = parser.get_string_value() print(f"Deserialized: {deserialized_value}")
Debug
Known issues
breakingSupport for Python 3.9 was dropped starting from version 1.10.0. Ensure your environment uses Python 3.10 or higher.
fix
Upgrade your Python environment to version 3.10 or newer.
affects: >=1.10.0
gotchaThis library specifically handles `text/plain` content. Attempting to use its factories with other content types (e.g., `application/json`, `application/xml`) will result in errors or incorrect parsing, as it lacks the necessary logic for those formats.
fix
Use the appropriate Kiota serialization library for the content type you are handling (e.g., `microsoft-kiota-serialization-json` for JSON).
affects: All
gotchaFor full integration within the Kiota request adapter pipeline, you must register `TextSerializationWriterFactory` and `TextParseNodeFactory` with `SerializationWriterFactoryRegistry.default_instance` and `ParseNodeFactoryRegistry.default_instance` respectively. Without registration, the default Kiota request adapter might not automatically pick up these factories for 'text/plain' content.
fix
Register factories using `SerializationWriterFactoryRegistry.default_instance.register_content_type('text/plain', TextSerializationWriterFactory)` and `ParseNodeFactoryRegistry.default_instance.register_content_type('text/plain', TextParseNodeFactory)`.
affects: All
breakingThe library 'microsoft-kiota-serialization-text' was not found. Ensure it is installed in your environment before attempting to import or use it.
fix
Install the library using your package manager, typically `pip install microsoft-kiota-serialization-text`.
affects: All
Upgrade
Version history
1.12.0latest on PyPI · released Aug 27, 2026
Audit
Dependencies
microsoft-kiota-abstractionsrequiredProvides the core interfaces for serialization and deserialization, which this library implements.
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
microsoft-kiota-serialization-text — pip install microsoft-kiota-serialization-text · libregistry