summaryrefslogtreecommitdiff
path: root/formats/README.md
blob: eb29d61fb984e52ed98852054952b2aeea294973 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Serialization formats

This area of repository contains different libraries with various add-on formats which 
were not included in the core library.

For convenience, they have same `groupId`, versioning and release cycle as core library.

## JSON

* Artifact id: `kotlinx-serialization-json`
* Platform: all supported platforms
* Status: stable

## HOCON 

* Artifact id: `kotlinx-serialization-hocon`
* Platform: JVM only
* Status: experimental

Allows deserialization of `Config` object from popular [lightbend/config](https://github.com/lightbend/config) library 
into Kotlin objects.
You can learn about "Human-Optimized Config Object Notation" or HOCON from library's [readme](https://github.com/lightbend/config#using-hocon-the-json-superset).

## ProtoBuf

* Artifact id: `kotlinx-serialization-protobuf`
* Platform: all supported platforms
* Status: experimental

## CBOR

* Artifact id: `kotlinx-serialization-cbor`
* Platform: all supported platforms
* Status: experimental

## Properties

* Artifact id: `kotlinx-serialization-properties`
* Platform: all supported platforms
* Status: experimental

Allows converting arbitrary hierarchy of Kotlin classes to a flat key-value structure à la Java Properties.

## Other community-supported formats

### Avro

* GitHub repo: [sksamuel/avro4k](https://github.com/sksamuel/avro4k)
* Artifact ID: `com.sksamuel.avro4k:avro4k`
* Platform: JVM only

This library allows serialization and deserialization of objects to and from [Avro](https://avro.apache.org). It will read and write from Avro binary or json streams or generate Avro Generic Records directly. It will also generate Avro schemas from data classes. The library allows for easy extension and overrides for custom schema formats, compatiblity with schemas defined outside out of the JVM and for types not supported out of the box.

### Bson

* GitHub repo: [jershell/kbson](https://github.com/jershell/kbson)
* Artifact ID: `com.github.jershell:kbson`
* Platform: JVM only

Allows serialization and deserialization of objects to and from [BSON](https://docs.mongodb.com/manual/reference/bson-types/).

### Ktoml 
* GitHub repo: [akuleshov7/ktoml](https://github.com/akuleshov7/ktoml)
* Artifact ID: `com.akuleshov7:ktoml-core`
* Platforms: multiplatform, all Kotlin supported platforms

Fully Native and Multiplatform Kotlin serialization library for serialization/deserialization of TOML format.
This library contains no Java code and no Java dependencies and it implements multiplatform parser, decoder and encoder of TOML.

### Minecraft NBT (Multiplatform)

* GitHub repo: [BenWoodworth/knbt](https://github.com/BenWoodworth/knbt)
* Artifact ID: `net.benwoodworth.knbt:knbt`
* Platform: all supported platforms

Implements the [NBT format](https://minecraft.fandom.com/wiki/NBT_format) for kotlinx.serialization, and
provides a type-safe DSL for constructing NBT tags.

### MsgPack (Multiplatform)

* GitHub repo: [esensar/kotlinx-serialization-msgpack](https://github.com/esensar/kotlinx-serialization-msgpack)
* Artifact ID: `com.ensarsarajcic.kotlinx:serialization-msgpack`
* Platform: all supported platforms

Allows serialization and deserialization of objects to and from [MsgPack](https://msgpack.org/).

### SharedPreferences

* GitHub repo: [EdwarDDay/serialization.kprefs](https://github.com/EdwarDDay/serialization.kprefs)
* Artifact ID: `net.edwardday.serialization:kprefs`
* Platform: Android only

This library allows serialization and deserialization of objects into and from Android
[SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences).

### XML
* GitHub repo: [pdvrieze/xmlutil](https://github.com/pdvrieze/xmlutil)
* Artifact ID: `io.github.pdvrieze.xmlutil:serialization`
* Platform: all supported platforms

This library allows for reading and writing of XML documents with the serialization library.
It is multiplatform, providing both a shared parser/writer for xml as well as platform-specific
parsers where available. The library is designed to handle existing xml formats that use features that would 
not be available in other formats such as JSON.

### YAML

* GitHub repo: [charleskorn/kaml](https://github.com/charleskorn/kaml)
* Artifact ID: `com.charleskorn.kaml:kaml`
* Platform: JVM only

Allows serialization and deserialization of objects to and from [YAML](http://yaml.org).

### YAML (Multiplatform)

* GitHub repo: [him188/yamlkt](https://github.com/him188/yamlkt)
* Artifact ID: `net.mamoe.yamlkt:yamlkt`
* Platform: all supported platforms

Allows serialization and deserialization of objects to and from [YAML](http://yaml.org). 
Basic serial operations have been implemented, but some features such as compound keys and polymorphism are still work in progress.

### CBOR

* GitHub repo: [L-Briand/obor](https://github.com/L-Briand/obor)
* Artifact ID: `net.orandja.obor:obor`
* Platform: JVM, Android

Allow serialization and deserialization of objects to and from [CBOR](https://cbor.io/). This codec can be used to read and write from Java InputStream and OutputStream.

### Amazon Ion (binary only)

* GitHub repo: [dimitark/kotlinx-serialization-ion](https://github.com/dimitark/kotlinx-serialization-ion)
* Artifact ID: `com.github.dimitark:kotlinx-serialization-ion`
* Platform: JVM

Allow serialization and deserialization of objects to and from [Amazon Ion](https://amzn.github.io/ion-docs/). It stores the data in a flat binary format. Upon destialization, it retains the references between the objects.

### android.os.Bundle

* GitHub repo: [AhmedMourad0/bundlizer](https://github.com/AhmedMourad0/bundlizer)
* Artifact ID: `dev.ahmedmourad.bundlizer:bundlizer-core`
* Platform: Android

Allow serialization and deserialization of objects to and from [android.os.Bundle](https://developer.android.com/reference/android/os/Bundle).