Skip to content

aljaroudi/randos-pip

Repository files navigation

randos

A Python pip package for generating randomness

Downloads Python Support pip version a CodeClimate Issues Debt

Requirements

Python 3.7+

Installation

pip install randos

Usage

1. Random integers

random_ints(length: int, minimum: int = 0, maximum: int = 100) -> list[int]
  • example
>>>random_ints(3)
[3,5,7]

2. Random line from a file

random_line(file_name: str, separator: str = None, number_of_lines: int = None) -> str | tuple[str,str]

3. Random city

random_city(include_country: bool = False) -> str | tuple[str,str]
  • example
>>>city = random_city()
'San Diego'
>>>city, country = random_city(True)
('San Diego', 'United States')

4. Random country

random_country(include_abbr: bool = False) -> str | tuple[str,str]
  • example
>>>country = random_country()
'United States'
>>>country, abbr = random_country(True)
('United States', 'US')

5. Random emoji

random_emoji(include_desc: bool = False) -> str | tuple[str,str]
  • example
>>>emoji = random_emoji()
'🦝'
>>>emoji, desc = random_emoji(True)
('🦝,', 'Raccoon')

6. Random bool

random_bool() -> bool
  • example
>>>boolean = random_bool()
True

7. Random travel city

random_travel_city(include_country: bool = False) -> str | tuple[str,str]
  • example
>>>city = random_travel_city()
'San Diego'
>>>city, country = random_travel_city(True)
('San Diego', 'United States')

7. Random tourist attraction

random_travel_dest() -> str
  • example
>>>place = random_travel_destination()
'Glacier National Park'

About

A Python pip package for generating randomness

Topics

Resources

License

Stars

Watchers

Forks

Languages