Skip to content

Commit 6333daf

Browse files
committed
Converted Serialization formats list to table
PR Kotlin#2010
1 parent 6dbb8a9 commit 6333daf

File tree

1 file changed

+24
-159
lines changed

1 file changed

+24
-159
lines changed

formats/README.md

+24-159
Original file line numberDiff line numberDiff line change
@@ -5,165 +5,30 @@ were not included in the core library.
55

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

8-
## JSON
9-
10-
* Artifact id: `kotlinx-serialization-json`
11-
* Platform: all supported platforms
12-
* Status: stable
13-
14-
## HOCON
15-
16-
* Artifact id: `kotlinx-serialization-hocon`
17-
* Platform: JVM only
18-
* Status: experimental
19-
20-
Allows deserialization of `Config` object from popular [lightbend/config](https://github.com/lightbend/config) library
21-
into Kotlin objects.
22-
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).
23-
24-
## ProtoBuf
25-
26-
* Artifact id: `kotlinx-serialization-protobuf`
27-
* Platform: all supported platforms
28-
* Status: experimental
29-
30-
## CBOR
31-
32-
* Artifact id: `kotlinx-serialization-cbor`
33-
* Platform: all supported platforms
34-
* Status: experimental
35-
36-
## Properties
37-
38-
* Artifact id: `kotlinx-serialization-properties`
39-
* Platform: all supported platforms
40-
* Status: experimental
41-
42-
Allows converting arbitrary hierarchy of Kotlin classes to a flat key-value structure à la Java Properties.
8+
| Format | Artifact id | Platform | Status | Notes |
9+
|------------|------------------------------------|-------------------------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
10+
| JSON | `kotlinx-serialization-json` | all supported platforms | stable |
11+
| HOCON | `kotlinx-serialization-hocon` | JVM only | 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). |
12+
| ProtoBuf | `kotlinx-serialization-protobuf` | all supported platforms | experimental |
13+
| CBOR | `kotlinx-serialization-cbor` | all supported platforms | experimental |
14+
| Properties | `kotlinx-serialization-properties` | all supported platforms | experimental | Allows converting arbitrary hierarchy of Kotlin classes to a flat key-value structure à la Java Properties. |
4315

4416
## Other community-supported formats
4517

46-
### Avro
47-
48-
* GitHub repo: [sksamuel/avro4k](https://github.com/sksamuel/avro4k)
49-
* Artifact ID: `com.sksamuel.avro4k:avro4k`
50-
* Platform: JVM only
51-
52-
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.
53-
54-
### Bson
55-
56-
* GitHub repo: [jershell/kbson](https://github.com/jershell/kbson)
57-
* Artifact ID: `com.github.jershell:kbson`
58-
* Platform: JVM only
59-
60-
Allows serialization and deserialization of objects to and from [BSON](https://docs.mongodb.com/manual/reference/bson-types/).
61-
62-
### Ktoml
63-
* GitHub repo: [akuleshov7/ktoml](https://github.com/akuleshov7/ktoml)
64-
* Artifact ID: `com.akuleshov7:ktoml-core`
65-
* Platforms: multiplatform, all Kotlin supported platforms
66-
67-
Fully Native and Multiplatform Kotlin serialization library for serialization/deserialization of TOML format.
68-
This library contains no Java code and no Java dependencies and it implements multiplatform parser, decoder and encoder of TOML.
69-
70-
### Minecraft NBT (Multiplatform)
71-
72-
* GitHub repo: [BenWoodworth/knbt](https://github.com/BenWoodworth/knbt)
73-
* Artifact ID: `net.benwoodworth.knbt:knbt`
74-
* Platform: all supported platforms
75-
76-
Implements the [NBT format](https://minecraft.fandom.com/wiki/NBT_format) for kotlinx.serialization, and
77-
provides a type-safe DSL for constructing NBT tags.
78-
79-
### MsgPack (Multiplatform)
80-
81-
* GitHub repo: [esensar/kotlinx-serialization-msgpack](https://github.com/esensar/kotlinx-serialization-msgpack)
82-
* Artifact ID: `com.ensarsarajcic.kotlinx:serialization-msgpack`
83-
* Platform: all supported platforms
84-
85-
Allows serialization and deserialization of objects to and from [MsgPack](https://msgpack.org/).
86-
87-
### SharedPreferences
88-
89-
* GitHub repo: [EdwarDDay/serialization.kprefs](https://github.com/EdwarDDay/serialization.kprefs)
90-
* Artifact ID: `net.edwardday.serialization:kprefs`
91-
* Platform: Android only
92-
93-
This library allows serialization and deserialization of objects into and from Android
94-
[SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences).
95-
96-
### XML
97-
* GitHub repo: [pdvrieze/xmlutil](https://github.com/pdvrieze/xmlutil)
98-
* Artifact ID: `io.github.pdvrieze.xmlutil:serialization`
99-
* Platform: all supported platforms
100-
101-
This library allows for reading and writing of XML documents with the serialization library.
102-
It is multiplatform, providing both a shared parser/writer for xml as well as platform-specific
103-
parsers where available. The library is designed to handle existing xml formats that use features that would
104-
not be available in other formats such as JSON.
105-
106-
### YAML
107-
108-
* GitHub repo: [charleskorn/kaml](https://github.com/charleskorn/kaml)
109-
* Artifact ID: `com.charleskorn.kaml:kaml`
110-
* Platform: JVM only
111-
112-
Allows serialization and deserialization of objects to and from [YAML](http://yaml.org).
113-
114-
### YAML (Multiplatform)
115-
116-
* GitHub repo: [him188/yamlkt](https://github.com/him188/yamlkt)
117-
* Artifact ID: `net.mamoe.yamlkt:yamlkt`
118-
* Platform: all supported platforms
119-
120-
Allows serialization and deserialization of objects to and from [YAML](http://yaml.org).
121-
Basic serial operations have been implemented, but some features such as compound keys and polymorphism are still work in progress.
122-
123-
### CBOR
124-
125-
* GitHub repo: [L-Briand/obor](https://github.com/L-Briand/obor)
126-
* Artifact ID: `net.orandja.obor:obor`
127-
* Platform: JVM, Android
128-
129-
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.
130-
131-
### Amazon Ion (binary only)
132-
133-
* GitHub repo: [dimitark/kotlinx-serialization-ion](https://github.com/dimitark/kotlinx-serialization-ion)
134-
* Artifact ID: `com.github.dimitark:kotlinx-serialization-ion`
135-
* Platform: JVM
136-
137-
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.
138-
139-
### android.os.Bundle
140-
141-
* GitHub repo: [AhmedMourad0/bundlizer](https://github.com/AhmedMourad0/bundlizer)
142-
* Artifact ID: `dev.ahmedmourad.bundlizer:bundlizer-core`
143-
* Platform: Android
144-
145-
Allow serialization and deserialization of objects to and from [android.os.Bundle](https://developer.android.com/reference/android/os/Bundle).
146-
147-
### CSV
148-
* GitHub repo: [hfhbd/kotlinx-serialization-csv](https://github.com/hfhbd/kotlinx-serialization-csv)
149-
* Artifact ID: `app.softwork:kotlinx-serialization-csv`
150-
* Platform: all supported platforms
151-
152-
Allows serialization and deserialization of CSV files.
153-
There are still some limitations (ordered properties).
154-
155-
### Fixed Length Format
156-
* GitHub repo: [hfhbd/kotlinx-serialization-csv](https://github.com/hfhbd/kotlinx-serialization-csv)
157-
* Artifact ID: `app.softwork:kotlinx-serialization-flf`
158-
* Platform: all supported platforms
159-
160-
Allows serialization and deserialization of [Fixed Length Format files](https://www.ibm.com/docs/en/psfa/7.2.1?topic=format-fixed-length-files).
161-
Each property must be annotated with `@FixedLength` and there are still some limitations due to missing delimiters.
162-
163-
### JSON5
164-
165-
* GitHub repo: [xn32/json5k](https://github.com/xn32/json5k)
166-
* Artifact ID: `io.github.xn32:json5k`
167-
* Platform: JVM only
168-
169-
Library for the serialization to and deserialization from [JSON5](https://json5.org) text.
18+
| Format | GitHub repo and Artifact | Platform | Notes |
19+
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
20+
| Avro | [sksamuel/avro4k](https://github.com/sksamuel/avro4k) <br> `com.sksamuel.avro4k:avro4k` | 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. |
21+
| Bson | [jershell/kbson](https://github.com/jershell/kbson) <br> `com.github.jershell:kbson` | JVM only | Allows serialization and deserialization of objects to and from [BSON](https://docs.mongodb.com/manual/reference/bson-types/). |
22+
| TOML | [akuleshov7/ktoml](https://github.com/akuleshov7/ktoml) <br> `com.akuleshov7:ktoml-core` | all 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. |
23+
| Minecraft NBT | [BenWoodworth/knbt](https://github.com/BenWoodworth/knbt) <br> `net.benwoodworth.knbt:knbt` | 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. |
24+
| MsgPack | [esensar/kotlinx-serialization-msgpack](https://github.com/esensar/kotlinx-serialization-msgpack) <br> `com.ensarsarajcic.kotlinx:serialization-msgpack` | all supported platforms | Allows serialization and deserialization of objects to and from [MsgPack](https://msgpack.org/). |
25+
| SharedPreferences | [EdwarDDay/serialization.kprefs](https://github.com/EdwarDDay/serialization.kprefs) <br> `net.edwardday.serialization:kprefs` | Android only | This library allows serialization and deserialization of objects into and from Android [SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences). |
26+
| XML | [pdvrieze/xmlutil](https://github.com/pdvrieze/xmlutil) <br> `io.github.pdvrieze.xmlutil:serialization` | 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. |
27+
| YAML | [charleskorn/kaml](https://github.com/charleskorn/kaml) <br> `com.charleskorn.kaml:kaml` | JVM only | Allows serialization and deserialization of objects to and from [YAML](http://yaml.org). |
28+
| YAML | [him188/yamlkt](https://github.com/him188/yamlkt) <br> `net.mamoe.yamlkt:yamlkt` | 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. |
29+
| CBOR | [L-Briand/obor](https://github.com/L-Briand/obor) <br> `net.orandja.obor:obor` | 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. |
30+
| Amazon Ion (binary only) | [dimitark/kotlinx-serialization-ion](https://github.com/dimitark/kotlinx-serialization-ion) <br> `com.github.dimitark:kotlinx-serialization-ion` | JVM only | 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. |
31+
| android.os.Bundle | [AhmedMourad0/bundlizer](https://github.com/AhmedMourad0/bundlizer) <br> `dev.ahmedmourad.bundlizer:bundlizer-core` | Android | Allow serialization and deserialization of objects to and from [android.os.Bundle](https://developer.android.com/reference/android/os/Bundle). |
32+
| CSV | [hfhbd/kotlinx-serialization-csv](https://github.com/hfhbd/kotlinx-serialization-csv) <br> `app.softwork:kotlinx-serialization-csv` | all supported platforms | Allows serialization and deserialization of CSV files. There are still some limitations (ordered properties). |
33+
| Fixed Length Format | [hfhbd/kotlinx-serialization-csv](https://github.com/hfhbd/kotlinx-serialization-csv) <br> `app.softwork:kotlinx-serialization-flf` | all supported platforms | Allows serialization and deserialization of [Fixed Length Format files](https://www.ibm.com/docs/en/psfa/7.2.1?topic=format-fixed-length-files). Each property must be annotated with `@FixedLength` and there are still some limitations due to missing delimiters. |
34+
| JSON5 | [xn32/json5k](https://github.com/xn32/json5k) <br> `io.github.xn32:json5k` | JVM only | Library for the serialization to and deserialization from [JSON5](https://json5.org) text. |

0 commit comments

Comments
 (0)