All Projects → imkira → go-interpol

imkira / go-interpol

Licence: MIT license
interpol is a Go package for doing format-string like string interpolation using named parameters.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to go-interpol

Mixtext
MixText: Linguistically-Informed Interpolation of Hidden Space for Semi-Supervised Text Classification
Stars: ✭ 159 (+367.65%)
Mutual labels:  interpolation
Geostats.jl
An extensible framework for high-performance geostatistics in Julia
Stars: ✭ 222 (+552.94%)
Mutual labels:  interpolation
SGpp
SG⁺⁺ – the numerical library for Sparse Grids in all their variants.
Stars: ✭ 59 (+73.53%)
Mutual labels:  interpolation
Mathtoolbox
Mathematical tools (interpolation, dimensionality reduction, optimization, etc.) written in C++11 with Eigen
Stars: ✭ 172 (+405.88%)
Mutual labels:  interpolation
Hypertextliteral
Generate HTML, XML, and other web content using Swift string literal interpolation
Stars: ✭ 219 (+544.12%)
Mutual labels:  interpolation
equadratures
equadratures.org/
Stars: ✭ 92 (+170.59%)
Mutual labels:  interpolation
Lstm Crypto Price Prediction
Predicting price trends in cryptomarkets using an lstm-RNN for the use of a trading bot
Stars: ✭ 136 (+300%)
Mutual labels:  interpolation
comment-mark
Interpolate strings with HTML comment markers!
Stars: ✭ 21 (-38.24%)
Mutual labels:  interpolation
Mathnet Numerics
Math.NET Numerics
Stars: ✭ 2,688 (+7805.88%)
Mutual labels:  interpolation
polatory
Fast, memory-efficient 3D spline interpolation and global kriging, via RBF (radial basis function) interpolation.
Stars: ✭ 82 (+141.18%)
Mutual labels:  interpolation
3d Bat
3D Bounding Box Annotation Tool (3D-BAT) Point cloud and Image Labeling
Stars: ✭ 179 (+426.47%)
Mutual labels:  interpolation
Xesmf
Universal Regridder for Geospatial Data
Stars: ✭ 197 (+479.41%)
Mutual labels:  interpolation
GalerkinSparseGrids.jl
Sparse Grid Discretization with the Discontinuous Galerkin Method for solving PDEs
Stars: ✭ 39 (+14.71%)
Mutual labels:  interpolation
Unity Fastpacedmultiplayer
Features a Networking Framework to be used on top of Unity Networking, in order to implement an Authoritative Server with Lag Compensation, Client-Side Prediction/Server Reconciliation and Entity Interpolation
Stars: ✭ 162 (+376.47%)
Mutual labels:  interpolation
gpx-interpolate
Python function to interpolate GPX data using piecewise cubic Hermite splines
Stars: ✭ 35 (+2.94%)
Mutual labels:  interpolation
Interpolate
Swift interpolation for gesture-driven animations
Stars: ✭ 1,809 (+5220.59%)
Mutual labels:  interpolation
Pupa
Simple micro templating
Stars: ✭ 231 (+579.41%)
Mutual labels:  interpolation
natural-neighbor-interpolation
Fast, discrete natural neighbor interpolation in 3D on the CPU.
Stars: ✭ 63 (+85.29%)
Mutual labels:  interpolation
cmna-pkg
Computational Methods for Numerical Analysis
Stars: ✭ 13 (-61.76%)
Mutual labels:  interpolation
stroke-dasharray-interpolation-talk
Slides from 2015 D3.js talk
Stars: ✭ 17 (-50%)
Mutual labels:  interpolation

interpol

License GoDoc Build Status Coverage codebeat badge goreportcard

interpol is a Go package for doing format-string like string interpolation using named parameters.

Currently, a template only accepts variable placeholders delimited by brace characters (eg. "Hello {foo} {bar}").

Install

First, you need to install the package:

go get -u github.com/imkira/go-interpol

Documentation

For advanced usage, make sure to check the available documentation here.

Example

The following code should use interpol.WithMap function, which simply replaces every key with the corresponding value of the specified map. When run, it should output Hello World!!!.

package main

import (
	"fmt"

	"github.com/imkira/go-interpol"
)

func main() {
	m := map[string]string{
		"foo": "Hello",
		"bar": "World",
	}
	str, err := interpol.WithMap("{foo} {bar}!!!", m)
	if err != nil {
		fmt.Printf("Error: %v\n", err)
		return
	}
	fmt.Println(str)
}

Contribute

Found a bug? Want to contribute and add a new feature?

Please fork this project and send me a pull request!

License

go-interpol is licensed under the MIT license:

www.opensource.org/licenses/MIT

Copyright

Copyright (c) 2016 Mario Freitas. See LICENSE for further details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].