cereal

package module
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2020 License: MIT Imports: 4 Imported by: 0

README

Cereal

Package cereal implements access to python cerealizer archives.

Cerealizer is a "secure pickle-like" python module that serializes python objects into a data stream that can be saved and read for later use. It was written by Jean-Baptiste "Jiba" Lamy and is available at:

https://pypi.org/project/Cerealizer/

This package provides a pure Go implementation to decode and unmarshal data stored by python programs using the cerealizer library.

Details on the cerealizer file format can be found here.

Example

package main

import (
    "fmt"
    "ioutil"
    "log"

    "github.com/jamesbo13/cereal"
)

type SampleData struct {
    IntSlice []int
    String string
    Float float32
}

func main() {

    buf, _ := ioutil.ReadFile("filename")

    var d SampleData

    err := cereal.Unmarshal(buf, &d)
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("Decoded data:\n%#v\n")
}

Documentation

Overview

Package cereal implements access to python cerealizer archives.

Cerealizer is a "secure pickle-like" python module that serializes python objects into a data stream that can be saved and read for later use. It was written by Jean-Baptiste "Jiba" Lamy and is available at:

https://pypi.org/project/Cerealizer/

This package provides a pure Go implementation to decode and unmarshal data stored by python programs using the cerealizer library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal parses the cereal-encoded data and stores the result in the value pointed to by v.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL