diff --git a/README.md b/README.md index 3a72ece..693fd8b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,25 @@ # ToStruct.jl Easy way to convert dict to struct + +## Usage + +``` +julia> using ToStruct + +julia> struct S1 + int::Int + str::String + end + +julia> struct S2 + s1::S1 + end + +julia> raws2 = Dict("s1" => Dict("int" => 1, "str" => "foo")) +Dict{String,Dict{String,Any}} with 1 entry: + "s1" => Dict{String,Any}("int"=>1,"str"=>"foo") + +julia> ToStruct.tostruct(raws2, S2) +S2(S1(1, "foo")) +```