Packages
smart_city
5.3.0
6.0.0
5.4.7
5.4.6
5.4.5
5.4.4
5.4.3
5.4.2
5.4.1
5.4.0
5.3.0
5.2.8
5.2.6
5.2.5
5.2.4
5.2.3
5.2.2
5.2.1
5.2.0
5.1.1
5.1.0
5.0.7
5.0.6
5.0.5
5.0.4
5.0.3
5.0.2
5.0.1
5.0.0
4.0.1
4.0.0
3.25.0
3.24.0
3.23.0
3.22.0
3.21.0
3.20.1
3.20.0
3.19.1
3.19.0
3.18.3
3.18.2
3.18.1
3.18.0
3.17.0
3.16.0
3.15.1
3.15.0
3.14.1
3.14.0
3.13.0
3.12.0
3.11.0
3.10.0
3.9.0
3.8.0
3.7.0
3.6.0
3.5.1
3.5.0
3.4.0
3.3.0
3.2.4
3.2.3
3.2.1
3.2.0
3.1.0
3.0.0
2.9.0
2.8.2
2.8.0
2.7.1
2.7.0
2.6.1
2.5.0
2.4.2
retired
2.4.1
2.4.0
2.3.0
2.2.0
2.1.6
2.1.5
2.1.4
2.1.3
2.1.2
A library for shared helper modules in the Smart Cities Data project.
Current section
Files
Jump to
Current section
Files
smart_city
README.md
README.md
[](https://travis-ci.org/smartcitiesdata/smart_city)
[](https://hex.pm/packages/smart_city)
# SmartCity
This library defines helper functions that are used across SmartCity modules.
## Installation
```elixir
def deps do
[
{:smart_city, "~> 3.20.1"}
]
end
```
## Basic Usage
```elixir
iex> SmartCity.Helpers.to_atom_keys(%{"a" => 1, "b" => 2, "c" => 3})
%{a: 1, b: 2, c: 3}
iex> SmartCity.Helpers.to_atom_keys(%{"a" => %{"b" => "c"}})
%{a: %{b: "c"}}
iex> SmartCity.Helpers.deep_merge(%{a: 1, b: 2}, %{a: 3, c: 4})
%{a: 3, b: 2, c: 4}
```
Full documentation can be found at [https://hexdocs.pm/smart_city/api-reference.html](https://hexdocs.pm/smart_city/api-reference.html).
## Contributing
The build process runs these commands:
```bash
mix local.rebar --force
mix local.hex --force
mix deps.get
mix format --check-formatted
mix credo
mix test
```
## Releases
New versions are [published here](https://hexdocs.pm/smart_city/readme.html) whenever a Github release is cut.
The version # of `smart_city` is expected to sync with [`smart_city_test`](https://github.com/UrbanOS-Public/smart_city_test).
When cutting a release in either package, the other should also receive an update so that it utilizes the new package version.
Ex: After updating the `smart_city` version by changing the version in `mix.exs`, merging, and cutting a release, `smart_city_test` should receive an
update PR as well. That `smart_city_test` PR should update the version of `smart_city` in the `mix.exs` file, and a release of `smart_city_test` should
be made.
It's expected that the version of `smart_city` and `smart_city_test` always match in their `mix.exs` file and their github releases.
## License
SmartCity is released under the Apache 2.0 license - see the license at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)