New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/esonhugh/sculptor

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/esonhugh/sculptor

  • v0.1.3
  • Source
  • Go
  • Socket score

Version published
Created
Source

Sculptor

FlexFormer Logo

Go Report Card License: MIT

Sculptor is a flexible and powerful Go library for transforming data from various formats (CSV, JSON, etc.) into desired Go struct types.

It is designed to significantly simplify and accelerate the process of data ingestion and formatting.

Features

  • Ease of use: Simply define your struct with struct field tag and let sculptor handle the rest.
  • Support for multiple data file formats: CSV, JSON, and more.
  • Customized your processing: setup fallbackfuncs and customfuncs to handle your data.
  • More Options: Set your own delimiter, data parser func and time latency to control the speed of data processing.
  • Efficient handling of large data sets: Optimize memory usage and performance.

Installation

go get github.com/esonhugh/sculptor

Quick Start

package main

import (
        "github.com/esonhugh/sculptor"
	"log"
)

type TestStruct struct {
	Name string `select:"name"`
	Pass string `select:"pass"`
}

func main() {
	Doc := sculptor.NewDataSculptor("test.json").
		SetDocType(sculptor.JSON_DOCUMENT).
		SetQuery("name", "user").
		SetQuery("pass", "pass").
		SetTargetStruct(&TestStruct{})
	Doc.Do()  // not block.
	go func() {
		Doc.Wait()  // let process complete and close chan 
		// Doc.Wg.Wait()  // is real Doc.Wait() do.
		Doc.Close()  // Same as close(Doc.ConstructedOutput)
    }()
	for i := range Doc.ConstructedOutput {
		log.Print(i)
	}
}

Demo

demo of merging oneforall.csv and subfinder.json

More Example

Checkout the test folder to see more examples.

Doc

godoc: https://pkg.go.dev/github.com/esonhugh/sculptor

Contributing

welcome contributions! Free for fork and Pull Request.

License

sculptor is licensed under the MIT License. See LICENSE for more details.


Made with :heart: by Esonhugh

Inspired by AkaAny/gormja_core2

Inspired by Trickest

FAQs

Package last updated on 14 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc