randRegion
A country's first-level divisions: a Korean 시·도, or a US state or the District of Columbia. Each is drawn as often as any other, whatever its size.
randLocation with level fixed to 'region'LocationLevel.region"region", handing back the division's name alone rather than the whole location.
javascript
import { randRegion } from 'randino';
randRegion({ language: 'ko', count: 3 }); // ['세종특별자치시', '울산광역시', '강원특별자치도']
randRegion({ language: 'en', count: 3 }); // ['Idaho', 'Georgia', 'Vermont']
randRegion({ language: 'en', output: 'detail' });
// [{ location: 'Arkansas', language: 'en', level: 'region',
// country: 'United States', region: 'Arkansas', city: null, district: null }]dart
import 'package:randino/randino.dart';
randRegion(language: LocationLanguage.ko, count: 3); // [세종특별자치시, 울산광역시, 강원특별자치도]
randRegion(language: LocationLanguage.en, count: 3); // [Idaho, Georgia, Vermont]The detail form is randRegionDetails.
python
from randino import rand_region
rand_region(language="ko", count=3) # ['세종특별자치시', '울산광역시', '강원특별자치도']
rand_region(language="en", count=3) # ['Idaho', 'Georgia', 'Vermont']Korea has sixteen of them and the United States fifty-one, so unique: trueunique: trueunique=True with a larger count returns every one and stops there.
Options
| Option | Type | Default | Description |
|---|---|---|---|
language | LocationLanguageOptionLocationLanguage?LocationLanguageOption | 'all'null"all" | Which language, and so which country, the places are from. Left out, it picks one per result and mixes them. |
count | numberintint | 1 | How many results to return. Clamped to 0 … 10000. |
minLengthminLengthmin_length | numberint?int | None | no bound | Minimum length in characters, of the whole string returned. |
maxLengthmaxLengthmax_length | numberint?int | None | no bound | Maximum length in characters. A range nothing fits is answered with the closest length there is. |
startsWithstartsWithstarts_with | stringString?str | —null"" | Keep only results whose first character is this one. |
unique | booleanboolbool | falsefalseFalse | Never return the same result twice. Returns fewer than asked once the list runs out. |
random | () => numberRandom?Callable[[], float] | None | —nullNone | Where the randomness comes from. Defaults to the platform's ordinary generator. |
output | RandOutputRandOutput | 'value'"value" | Strings, or one LocationDetail per result. |
See also
randLocation— the region with the country above it and the divisions below.randCity— the level below the region.