Hello Julia community,
Am pleased to announce a new web framework focused on facilitating process of outputting Julia computed data to the web very easily. Feel that reason Python is still more mainstream than Julia is simply due to complete ecosystem of tools. More precisely many data scientists can easily use Flask to share their data with outside world. Not to that mention staying with 1 backend language is simply easier for many large teams.
Which is why I have developed Dance.jl
along with 2 plugins for integration with Docker and Webpack. Idea of project is to remove web abstraction layer for average Julia user, so that we can focus on what is really important: fast and complex data manipulation.
As quick summary on how to setup HTML and JSON GET/POST endpoints:
import DataFrames
using Dance.Router
function get_df() :: DataFrames.DataFrame
return DataFrames.DataFrame(A = 1:4, B = ["A", "B", "C", "D"])
end
function get_string() :: String
return "Hello World"
end
function post_dict(dict::Dict) :: Dict{String, Any}
return dict
end
route("/", get_string; method=GET, endpoint=EP_HTML)
route("/dataframe", get_df; method=GET)
route("/dict", post_dict)
Using regex as well as grouping routes of similar parameters is also possible:
route_group(route_prefix="/dict", method=GET, endpoint=EP_HTML, [
(path=r"/(?<value>\d.)", action=dict_1)
(path=r"/(?<key>\w+)/(?<value>\d{3})", action=dict_2, html_file="html/file")
])
For more details, please take a look at each package’s readme here.
Or for the impatient reader, a hands-on quick demo project that I have made for a hackathon.
Is still very young package as you can see from Github project roadmap, so welcome all kind of feedback.
Cheers