Liking cljdoc? Tell your friends :D

brazilian-utils.states.core


code->ufclj/s

(code->uf code)

Returns the UF keyword for a given IBGE state code.

Arguments:

  • code: String or integer representing the IBGE state code

Returns a keyword with the UF or nil if not found.

Example: (code->uf "8") ;; :SP (code->uf 8) ;; :SP (code->uf "3") ;; :CE (first match if multiple states have same code)

Returns the UF keyword for a given IBGE state code.

Arguments:
- code: String or integer representing the IBGE state code

Returns a keyword with the UF or nil if not found.

Example:
(code->uf "8") ;; :SP
(code->uf 8) ;; :SP
(code->uf "3") ;; :CE (first match if multiple states have same code)
sourceraw docstring

name->ufclj/s

(name->uf name)

Returns the UF keyword for a given state name.

Arguments:

  • name: String with the full or partial state name (case-insensitive)

Returns a keyword with the UF or nil if not found.

Example: (name->uf "São Paulo") ;; :SP (name->uf "são paulo") ;; :SP (name->uf "Rio de Janeiro") ;; :RJ

Returns the UF keyword for a given state name.

Arguments:
- name: String with the full or partial state name (case-insensitive)

Returns a keyword with the UF or nil if not found.

Example:
(name->uf "São Paulo") ;; :SP
(name->uf "são paulo") ;; :SP
(name->uf "Rio de Janeiro") ;; :RJ
sourceraw docstring

uf->area-codesclj/s

(uf->area-codes uf)

Returns the telephone area codes (DDDs) for a UF.

Arguments:

  • uf: Keyword representing the state abbreviation

Returns a vector of integers or nil if not found.

Example: (uf->area-codes :SP) ;; [11 12 13 14 15 16 17 18 19] (uf->area-codes :RJ) ;; [21 22 24] (uf->area-codes :XX) ;; nil

Returns the telephone area codes (DDDs) for a UF.

Arguments:
- uf: Keyword representing the state abbreviation

Returns a vector of integers or nil if not found.

Example:
(uf->area-codes :SP) ;; [11 12 13 14 15 16 17 18 19]
(uf->area-codes :RJ) ;; [21 22 24]
(uf->area-codes :XX) ;; nil
sourceraw docstring

uf->codeclj/s

(uf->code uf)

Returns the numeric IBGE code for a given UF.

The IBGE code is a numeric identifier used by the Brazilian Institute of Geography and Statistics to uniquely identify each state.

Arguments:

  • uf: Keyword representing the state abbreviation (e.g., :SP, :RJ)

Returns: An integer representing the IBGE code, or nil if the UF is invalid.

Examples: (uf->code :SP) ;; 35 (uf->code :RJ) ;; 33 (uf->code :XX) ;; nil

Returns the numeric IBGE code for a given UF.

The IBGE code is a numeric identifier used by the Brazilian Institute of Geography and Statistics
to uniquely identify each state.

Arguments:
- uf: Keyword representing the state abbreviation (e.g., :SP, :RJ)

Returns:
 An integer representing the IBGE code, or nil if the UF is invalid.
 
Examples:
 (uf->code :SP) ;; 35
 (uf->code :RJ) ;; 33
 (uf->code :XX) ;; nil
sourceraw docstring

uf->ie-lengthclj/s

(uf->ie-length uf)

Returns the expected length of State Registration (IE) for a UF.

Some states accept multiple lengths, in this case returns a vector.

Arguments:

  • uf: Keyword representing the state abbreviation

Returns an integer or vector of integers, or nil if not found.

Example: (uf->ie-length :SP) ;; 12 (uf->ie-length :BA) ;; [8 9] (uf->ie-length :XX) ;; nil

Returns the expected length of State Registration (IE) for a UF.

Some states accept multiple lengths, in this case returns a vector.

Arguments:
- uf: Keyword representing the state abbreviation

Returns an integer or vector of integers, or nil if not found.

Example:
(uf->ie-length :SP) ;; 12
(uf->ie-length :BA) ;; [8 9]
(uf->ie-length :XX) ;; nil
sourceraw docstring

uf->state-nameclj/s

(uf->state-name uf)

Returns the full state name for a UF keyword.

Arguments:

  • uf: Keyword representing the state abbreviation

Returns a string with the state name or nil if not found.

Example: (uf->state-name :SP) ;; "São Paulo" (uf->state-name :RJ) ;; "Rio de Janeiro" (uf->state-name :XX) ;; nil

Returns the full state name for a UF keyword.

Arguments:
- uf: Keyword representing the state abbreviation

Returns a string with the state name or nil if not found.

Example:
(uf->state-name :SP) ;; "São Paulo"
(uf->state-name :RJ) ;; "Rio de Janeiro"
(uf->state-name :XX) ;; nil
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