https://github.com/librity/ignite_productivity_report
Rocket Seat - Ignite - Elixir - Challenge 3 - A simple Elixir program that generates an employee productivity report from raw CSV data.
https://github.com/librity/ignite_productivity_report
challenge elixir ignite rocketseat
Last synced: about 1 month ago
JSON representation
Rocket Seat - Ignite - Elixir - Challenge 3 - A simple Elixir program that generates an employee productivity report from raw CSV data.
- Host: GitHub
- URL: https://github.com/librity/ignite_productivity_report
- Owner: librity
- Created: 2021-03-10T05:27:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-25T12:06:27.000Z (over 4 years ago)
- Last Synced: 2025-02-25T17:46:13.441Z (over 1 year ago)
- Topics: challenge, elixir, ignite, rocketseat
- Language: Elixir
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ProductivityReport
A simple Elixir program that generates an employee productivity report from raw CSV data.
CSV colums are parsed as name, hours worked, day, month and year.
## Commands
```bash
$ mix deps.get
$ mix credo gen.config
$ mix credo
$ mix credo --strict
$ mix test
```
Generate reports:
```elixir
> ProductivityReport.build("test_report")
> ProductivityReport.build("gen_report")
```
Measuring execution time in microseconds:
```elixir
> :timer.tc(fn -> ProductivityReport.build("test_report") end)
> :timer.tc(fn -> ProductivityReport.build("gen_report") end)
```
Exploring Elixir's syntax:
```elixir
> %{a: 1, 2016: 4}
** (SyntaxError) iex:1:13: unexpected token: ":" (column 13, code point U+003A)
> %{a: 1, "2016": 4}
%{"2016": 4, a: 1}
> map = %{:a => 1, 2016 => 4}
%{2016 => 4, :a => 1}
> Map.get(map, 2016, :default)
4
> Map.get(map, 2017, :default)
:default
```
## Resources
- https://www.tutorialspoint.com/elixir/elixir_data_types.htm
- https://stackoverflow.com/questions/43630781/convert-integer-to-atom-in-elixir
- https://hexdocs.pm/elixir/master/Date.html
- https://hexdocs.pm/elixir/master/DateTime.html