# Dance.jl - Python Flask equivalent web framework

**URL:** <https://discourse.julialang.org/t/dance-jl-python-flask-equivalent-web-framework/38560>\
**Category:** Package Announcements\
**Tags:** package, web, webapps\
**Created:** [May 1, 2020, 2:41pm UTC](https://discourse.julialang.org/t/dance-jl-python-flask-equivalent-web-framework/38560 "2020-05-01T14:41:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoh-meyers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yoh-meyers/32/14700_2.png) [@yoh-meyers](https://discourse.julialang.org/u/yoh-meyers)\
**Post date:** [May 1, 2020, 2:41pm UTC](https://discourse.julialang.org/t/dance-jl-python-flask-equivalent-web-framework/38560/1 "2020-05-01T14:41:54Z")

</div>

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:

```julia
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:

```julia
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](https://github.com/DanceJL).

Or for the impatient reader, a hands-on quick [demo project](https://github.com/yoh-meyers/covid19-health-monitoring-server) 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

---

<div class="post-metadata">

**Author:** ![WaseemSSaeed](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/waseemssaeed/32/15345_2.png) [@WaseemSSaeed](https://discourse.julialang.org/u/WaseemSSaeed)\
**Post date:** [June 1, 2020, 2:03pm UTC](https://discourse.julialang.org/t/dance-jl-python-flask-equivalent-web-framework/38560/2 "2020-06-01T14:03:20Z")

</div>

can you please name a keyword/s can help me to understand how this form of functions like (post\_dict) works in Julia?

---

<div class="post-metadata">

**Author:** ![yoh-meyers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yoh-meyers/32/14700_2.png) [@yoh-meyers](https://discourse.julialang.org/u/yoh-meyers)\
**Post date:** [June 13, 2020, 7:34pm UTC](https://discourse.julialang.org/t/dance-jl-python-flask-equivalent-web-framework/38560/3 "2020-06-13T19:34:05Z")

</div>

Hi Waseem,

Really sorry for delay in getting back, but was taking time of due to fatigue.

Anyways, not sure I fully understand your question.  
Are you asking about logic of input params to `post_dict`, or how their value is obtained in background?

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [June 13, 2020, 8:46pm UTC](https://discourse.julialang.org/t/dance-jl-python-flask-equivalent-web-framework/38560/4 "2020-06-13T20:46:06Z")

</div>

Thank you!

The package seems very interesting, specially in simple websites (I said simple due to the HTML output, it is a little limiting in my opinion). It can be specially useful in combination with JS frameworks, and in which the dynamic output should be returned in JSON to compose.

I expect when to have more free time to give a try, and compare with other Julia frameworks. Good work!
