Skip to content

A library with an abstract implementation of the serialization interface, basic serializer types, and support for integrations and extensions

License

Notifications You must be signed in to change notification settings

Depra-Inc/Serialization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Depra.Serialization

Table of Contents

🧾 Introduction

Depra.Serialization is a library that provides interfaces for abstracting serialization and deserialization of data.

💡 Features:

  • Standardization: Unified API for all serialization/deserialization formats.
  • Extensibility: Flexible architecture for extending functionality to suit your needs.
  • Testing: Code coverage with tests to ensure stability and reliability.
  • Documentation: Detailed documentation for ease of use.
  • License: Distributed under the Apache-2.0 license.
  • Free: Use this library in any projects, including commercial ones.
  • Security: The library does not contain code that can harm your project.
  • Support: Library support will continue indefinitely.
  • Independence: The library does not depend on other libraries and packages.
  • Lightweight: The library does not contain unnecessary code and dependencies.
  • Simplicity: The library has a simple and understandable architecture.
  • Debugging Convenience: The library throws clear exceptions and error messages in debug mode (DEBUG).

🦾 Capabilities:

  • Support for serialization and deserialization in the following formats:
    • Binary
    • JSON
    • XML
    • YAML
    • CSV

📥 Installation

📦 Via NuGet:

  1. Open the NuGet Package Manager window.
  2. Select the Packages tab.
  3. Search for Depra.Serialization.
  4. Choose the Depra.Serialization package.
  5. Select the project where you want to install the package.
  6. Click Install.

⚙️ Manual:

  1. Download the .dll file from the Releases section or download the source code.
  2. Import it into your project.

📖 Contents

The key concepts used in this library are described in the following interfaces:

  • IRawSerializer - Interface for serializing and deserializing data in byte[] format.
  • ITextSerializer - Interface for serializing and deserializing data in string format.
  • IStreamSerializer - Interface for serializing and deserializing data in Stream format.
  • IMemorySerializer - Interface for serializing and deserializing data in ReadOnlyMemory<byte> format.

📋 Usage Examples

  1. Create an instance of the serializer that supports the format you want to use. You can register it in the DI container if you are using it in your project.
IRawSerializer serializer = new BinarySerializer();
  1. Use the serializer to serialize and deserialize data.
var serialized = serializer.Serialize<MyDataType>(data);
var deserialized = await serializer.DeserializeAsync(serialized, typeof(MyDataType));

➕ Extensions

  • Depra.Json.Newtonsoft - Adds support for serialization and deserialization in JSON format using the Newtonsoft.Json library.
  • Depra.Json.Microsoft - Adds support for serialization and deserialization in JSON format using the System.Text.Json library.

🤝 Collaboration

I welcome feature requests and bug reports in the issues section, and I also accept pull requests.

🫂 Support

I am an independent developer, and most of the development of this project is done in my spare time. If you are interested in collaborating or hiring me for a project, please check out my portfolio and contact me!

🔐 License

This project is distributed under the Apache-2.0 license.

Copyright (c) 2023 Nikolay Melnikov n.melnikov@depra.org

About

A library with an abstract implementation of the serialization interface, basic serializer types, and support for integrations and extensions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages