Liking cljdoc? Tell your friends :D

brazilian-utils.cities.core

Utilities to work with Brazilian cities by state (UF).

Utilities to work with Brazilian cities by state (UF).
raw docstring

all-citiesclj/s

(all-cities)

Returns all cities with their respective states.

Returns a vector of maps with :state and :city keys.

Example: (all-cities) ;; [{:state :SP :city "São Paulo"} {:state :RJ :city "Rio de Janeiro"} ...]

Returns all cities with their respective states.

Returns a vector of maps with :state and :city keys.

Example:
(all-cities) ;; [{:state :SP :city "São Paulo"} {:state :RJ :city "Rio de Janeiro"} ...]
sourceraw docstring

all-city-namesclj/s

(all-city-names)

Returns all city names without state context.

Returns a vector of strings with all city names (flat list).

Example: (all-city-names) ;; ["São Paulo" "Rio de Janeiro" "Salvador" ...]

Returns all city names without state context.

Returns a vector of strings with all city names (flat list).

Example:
(all-city-names) ;; ["São Paulo" "Rio de Janeiro" "Salvador" ...]
sourceraw docstring

cities-ofclj/s

(cities-of state)

Returns all cities of a given state.

Arguments:

  • state: Keyword representing the state code (UF)

Returns a vector of strings with city names, or empty vector if state not found.

Example: (cities-of :SP) ;; ["São Paulo" "Campinas" ...]

Returns all cities of a given state.

Arguments:
- state: Keyword representing the state code (UF)

Returns a vector of strings with city names, or empty vector if state not found.

Example:
(cities-of :SP) ;; ["São Paulo" "Campinas" ...]
sourceraw docstring

cities-of!clj/s

(cities-of! state)

Returns all cities of a given state or throws on invalid state.

Arguments:

  • state: Keyword representing the state code (UF)

Returns a vector of strings with city names. Throws ex-info with {:state <value>} if state is invalid.

Example: (cities-of! :SP) ;; ["São Paulo" "Campinas" ...] (cities-of! :XX) ;; throws ex-info

Returns all cities of a given state or throws on invalid state.

Arguments:
- state: Keyword representing the state code (UF)

Returns a vector of strings with city names.
Throws ex-info with {:state <value>} if state is invalid.

Example:
(cities-of! :SP) ;; ["São Paulo" "Campinas" ...]
(cities-of! :XX) ;; throws ex-info
sourceraw docstring

city-exists?clj/s

(city-exists? state city-name)

Checks if a city exists in a given state.

Arguments:

  • state: Keyword representing the state code (UF)
  • city-name: String with the city name (case-insensitive)

Returns true if the city exists in that state, false otherwise.

Example: (city-exists? :SP "São Paulo") ;; true (city-exists? :SP "Rio de Janeiro") ;; false (city-exists? :RJ "Rio de Janeiro") ;; true

Checks if a city exists in a given state.

Arguments:
- state: Keyword representing the state code (UF)
- city-name: String with the city name (case-insensitive)

Returns true if the city exists in that state, false otherwise.

Example:
(city-exists? :SP "São Paulo") ;; true
(city-exists? :SP "Rio de Janeiro") ;; false
(city-exists? :RJ "Rio de Janeiro") ;; true
sourceraw docstring

find-city-by-nameclj/s

(find-city-by-name city-name)

Finds all occurrences of a city by its name (case-insensitive).

Arguments:

  • city-name: String with the city name to search

Returns a vector of maps with :state and :city keys for all matches.

Example: (find-city-by-name "São Paulo") ;; [{:state :SP :city "São Paulo"}] (find-city-by-name "santa cruz") ;; Multiple cities named Santa Cruz in different states

Finds all occurrences of a city by its name (case-insensitive).

Arguments:
- city-name: String with the city name to search

Returns a vector of maps with :state and :city keys for all matches.

Example:
(find-city-by-name "São Paulo") ;; [{:state :SP :city "São Paulo"}]
(find-city-by-name "santa cruz") ;; Multiple cities named Santa Cruz in different states
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close