Skip to content

randDistrict

The divisions inside a city: a Korean 읍·면·동. It is the legal 동 an address is written with rather than the administrative 동 a community centre serves, and never the 리 below a 읍 or 면.

randLocation with level fixed to 'district'LocationLevel.district"district", handing back the division's name alone rather than the whole location.

javascript
import { randDistrict } from 'randino';

randDistrict({ language: 'ko', count: 3 }); // ['가현동', '겸면', '행주외동']
randDistrict({ startsWith: '역', count: 3 }); // ['역북동', '역동', '역곡동']
randDistrict({ output: 'detail' });
// [{ location: '차황면', language: 'ko', level: 'district',
//    country: '대한민국', region: '경상남도', city: '산청군', district: '차황면' }]
dart
import 'package:randino/randino.dart';

randDistrict(language: LocationLanguage.ko, count: 3); // [가현동, 겸면, 행주외동]

The detail form is randDistrictDetails.

python
from randino import rand_district

rand_district(language="ko", count=3)  # ['가현동', '겸면', '행주외동']

Only Korean locations have this level. Asking for English returns nothing, and leaving language out draws Korean rather than spending half the draws on a country that has no districts.

javascript
randDistrict({ language: 'en' }); // []
dart
randDistrict(language: LocationLanguage.en); // []
python
rand_district(language="en")  # []

Options

OptionTypeDefaultDescription
languageLocationLanguageOptionLocationLanguage?LocationLanguageOption'all'null"all"Which language, and so which country, the places are from. Left out, it picks one per result and mixes them.
countnumberintint1How many results to return. Clamped to 0 … 10000.
minLengthminLengthmin_lengthnumberint?int | Noneno boundMinimum length in characters, of the whole string returned.
maxLengthmaxLengthmax_lengthnumberint?int | Noneno boundMaximum length in characters. A range nothing fits is answered with the closest length there is.
startsWithstartsWithstarts_withstringString?strnull""Keep only results whose first character is this one.
uniquebooleanboolboolfalsefalseFalseNever return the same result twice. Returns fewer than asked once the list runs out.
random() => numberRandom?Callable[[], float] | NonenullNoneWhere the randomness comes from. Defaults to the platform's ordinary generator.
outputRandOutputRandOutput'value'"value"Strings, or one LocationDetail per result.

See also

Released under the MIT License