From 1c0e6da794ca3935173b3de67f416270fb255705 Mon Sep 17 00:00:00 2001 From: thenithinbalaji Date: Sat, 19 Mar 2022 13:21:33 +0530 Subject: [PATCH] version 1.0.0 --- README.rst | 2 +- build/lib/pyrandtoys/__init__.py | 8 + build/lib/pyrandtoys/functions.py | 234 +++++++++++++++++++++++ dist/pyrandtoys-1.0.0-py3-none-any.whl | Bin 0 -> 4436 bytes dist/pyrandtoys-1.0.0.tar.gz | Bin 0 -> 4099 bytes pyrandtoys.egg-info/PKG-INFO | 127 ++++++++++++ pyrandtoys.egg-info/SOURCES.txt | 9 + pyrandtoys.egg-info/dependency_links.txt | 1 + pyrandtoys.egg-info/top_level.txt | 1 + 9 files changed, 381 insertions(+), 1 deletion(-) create mode 100644 build/lib/pyrandtoys/__init__.py create mode 100644 build/lib/pyrandtoys/functions.py create mode 100644 dist/pyrandtoys-1.0.0-py3-none-any.whl create mode 100644 dist/pyrandtoys-1.0.0.tar.gz create mode 100644 pyrandtoys.egg-info/PKG-INFO create mode 100644 pyrandtoys.egg-info/SOURCES.txt create mode 100644 pyrandtoys.egg-info/dependency_links.txt create mode 100644 pyrandtoys.egg-info/top_level.txt diff --git a/README.rst b/README.rst index 018fa54..be5f9eb 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ PyRandToys -========= +========== ``pyrandtoys`` is a python module containing probability-based toys functions. It works offline and is compatible with both Python 2 and 3. diff --git a/build/lib/pyrandtoys/__init__.py b/build/lib/pyrandtoys/__init__.py new file mode 100644 index 0000000..fe9b4a2 --- /dev/null +++ b/build/lib/pyrandtoys/__init__.py @@ -0,0 +1,8 @@ +from pyrandtoys.functions import dice +from pyrandtoys.functions import coin +from pyrandtoys.functions import dreidel +from pyrandtoys.functions import cat +from pyrandtoys.functions import switch +from pyrandtoys.functions import spinner +from pyrandtoys.functions import combi +from pyrandtoys.functions import card diff --git a/build/lib/pyrandtoys/functions.py b/build/lib/pyrandtoys/functions.py new file mode 100644 index 0000000..150083e --- /dev/null +++ b/build/lib/pyrandtoys/functions.py @@ -0,0 +1,234 @@ +import random as rop +from typing import Tuple +from typing import Union + + +def dice(count: int = 1) -> Tuple[int, ...]: + """ + Rolls N dice + + Parameters: + count (int) : The number of dice to roll, default = 1 + + Returns: + tuple: The result of dice rolls. + Each tuple element is a number between 1 and 6. + """ + + res = () + + for _ in range(int(count)): + res += (rop.randint(1, 6),) + + return res + + +def coin(count: int = 1) -> Tuple[str, ...]: + """ + Toss N coins + + Parameters: + count (int) : The number of coins to toss, default = 1 + + Returns: + tuple: The result of coin toss. + A tuple element can be either HEADS or TAILS. + """ + + res = () + sample_space = ["HEADS", "TAILS"] + + for _ in range(int(count)): + res += (rop.choice(sample_space),) + + return res + + +def dreidel(count: int = 1) -> Tuple[str, ...]: + """ + Spin a dreidel N times + + Parameters: + count (int) : The number times to spin, default = 1 + + Returns: + tuple: The values of dreidel spins. + Each tuple element is one of these values: NUN, GIMEL, HE, SHIN. + """ + + res = () + sample_space = ["NUN", "GIMEL", "HE", "SHIN"] + + for _ in range(int(count)): + res += (rop.choice(sample_space),) + + return res + + +def cat(count: int = 1) -> Tuple[str, ...]: + """ + Perform Schrödinger's cat experiment N times + + Parameters: + count (int) : The number of times to perform the experiment, default = 1 + + Returns: + tuple: The status of cats. + A cat can be either ALIVE or DEAD. + """ + res = () + sample_space = ["ALIVE", "DEAD"] + + for _ in range(int(count)): + res += (rop.choice(sample_space),) + + return res + + +def switch(count: int = 1) -> Tuple[str, ...]: + """ + Toggle a switch N times + + Parameters: + count (int) : The number times to toggle a switch, default = 1 + + Returns: + tuple: The state of switches. + A switch can be either ON or OFF. + """ + res = () + sample_space = ["ON", "OFF"] + + for _ in range(int(count)): + res += (rop.choice(sample_space),) + + return res + + +def spinner(lower: int, upper: int = 0) -> int: + """ + Spin a spinner with numbers from lower to upper value + + Parameters: + lower (int) : lowest number on the spinner. + upper (int) : highest number on the spinner. + + Returns: + int: The value at which the spinner has stopped spinning. + + Result is a number between lower and upper. + """ + if lower > upper: + lower, upper = upper, lower + + return rop.randint(int(lower), int(upper)) + + +def card(count: int = 1) -> Tuple[str, ...]: + """ + Picks N cards from a deck of 52 cards + + Parameters: + count (int) : The number of cards to pick, default = 1 + + Returns: + tuple: The cards that have been picked. + Each tuple element is a card from a deck of 52 cards. + """ + + SUITS = ("Spades", "Clubs", "Hearts", "Diamonds") + RANKS = ( + "Ace", + "Two", + "Three", + "Four", + "Five", + "Six", + "Seven", + "Eight", + "Nine", + "Ten", + "Jack", + "Queen", + "King", + ) + + sample_space = [rank + " of " + suit for rank in RANKS for suit in SUITS] + + res = () + for _ in range(int(count)): + res += (rop.choice(sample_space),) + + return res + + +def combi(*argv: Union[str, int, list, tuple]) -> Tuple[Union[int, str], ...]: + """ + Randomise combinations between other functions + + Parameters: + Functions to randomise + + Returns: + tuple: The values of the randomised functions + """ + + res = [] + + for item in argv: + if isinstance(item, str): + item = item.lower() + try: + res.append(eval(item + "()")[0]) + except: + res.append(None) + + elif isinstance(item, list) or isinstance(item, tuple): + temp = () + for i in item: + + if isinstance(i, str): + i = i.lower() + try: + temp += (eval(i + "()")[0],) + except: + temp += (None,) + + elif isinstance(i, int): + sample_space = ["coin", "dice", "switch", "card"] + temp2 = () + + for _ in range(i): + rand_op = rop.choice(sample_space) + try: + temp2 += (eval(rand_op + "()")[0],) + except: + temp2 += (None,) + + temp += (temp2,) + + else: + temp += (None,) + + res.append(temp) + + elif isinstance(item, int): + + sample_space = ["coin", "dice", "switch", "card"] + temp = () + + for _ in range(item): + rand_op = rop.choice(sample_space) + try: + temp += (eval(rand_op + "()")[0],) + except: + temp += (None,) + + res.append(temp) + + res = tuple(res) + + if len(res) == 1 and isinstance(res[0], tuple): + return res[0] + else: + return res diff --git a/dist/pyrandtoys-1.0.0-py3-none-any.whl b/dist/pyrandtoys-1.0.0-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..b304cef82f2173b9c4baf2b41219c5a1f0f0325c GIT binary patch literal 4436 zcmaKvcTiK?8pV^)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3GbC?v^1S}AuB=Y7>(f{>&n&-Kdh)2 z;vV`O!sQ=h&RKHbN<}n?rJVDK+Cqp^+-E#r;O2sDFT=H&gl^c1^SxZf2kf)Z>c*kM zC2(<8J*oHf=)Jhxb8%1;sAYZ`^CjjdLWt*z71x<^ldlz9`ezdGuP`N+_h5>`5?ovn z3o|Kwi+AySP>7UWnAu``YtMI5sbI74oK>SPVfHmo(8&XgYpd?yw0u)kneZ}@g{7)# z8;BJI?we+-o5y~@$$%GvF!oIG8!c$Nn2GKCspxc&q#4D6_oMb#@e{-v8toqrL!~&k zv2ErPuYU3D)j;~?9}G7E>zZE`POdcUJ6Hv~MX2V91?!aS6?tPeKfZnob3z4)PiI+> z?5f$%bF(_UcRIPR8niFiMSnQ{NhDXGnErLtCH|Lddjv0^vOCO<3a)$k?yeaPY+zvh z?Ce7k$g5Xscj4tRF{ZIDu5*V;?0av%vCka$bdkuMXoufddEpf_DTRWL=pDj%uqU8j zjsDJoGuZ6Z;D1e?KO5axT}4HUW>j5!c$^Lehm8!4*6NE+ioNmB9Y(=5Mf#C7`s$kf zB8W&NMTy>+=$M$~wAkbd^}r}{d{1PGP7tm++^IO>6TG3DSyFv^r!dp zJ|huzam(4Em?_vF{P ze(XB2oW4Z?6!+ZkKB*gx%R2A+@Njx|q;aBiG8^7+y)qyiMYXwXbI8+W8nELXEj|)D za8$s)V@RJGs;QY zC+N{AAczI<|MT(bANu!G7xLHg&uRJZjDO0u{~-VXbs_hDW&Azq{vGm9SGb>$wbR)A zQ^+4KbiX5iZ>T?!rIdd}{ZKe+2&9#=p~kH``Ad;?#qG_~Kuz_dE4> hzx|i`6d3Yn>VMpaMv;;K^$Nx5;5oG{7yVzme*vwLa%lhn literal 0 HcmV?d00001 diff --git a/dist/pyrandtoys-1.0.0.tar.gz b/dist/pyrandtoys-1.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e8f5d5ad52772e841df82b888bd7ba58d07e9bc2 GIT binary patch literal 4099 zcmV+e5d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br%^VH>*yE1BnoJ!$=V>dTOy;60pt>_S zj6eB8lAW&}d~srpH3E_w3JtSX;-xMT-$L0^HNbDB^ph~Mh!3P zSyo7BrAlVJPW2KM_Plo1(onL5q zJ~h^Og8;-uZQ>LBRxsc+kL!%fYRpUN#tV#mkfj9g4l@Bz7e z+AGcmSoj_!&$XQR5G?oq{DAd8x&QOeTmM_Q|Fe|K<>mcPuYCP4%LjvfVfF2U?_mF% z?f*P16-sjdr`-P`^}pr)AJG55mHR(r|DWvtzwu7M&F}v!m9hVq`#*j>$ov1~{eSZQ zKY8PUyzxNZcpz^)kT)L48xQ1-2lDPMk>dDIsVJ>UylEB{9msZ{*L2+E|*W*e<4>olK=keRzRA% z9RKC`FUNm5{>$-y>G=PR!PT?lKNx$`{*MYJ8UJrt|I+B?`2Q!3|8oETpEv$5-2eYJ zcT_IO4&gP9|H0I6uRr*{_P=ucFBRth{h!04-2b^1xCSS$gHGPfPRiE@o$gqe20LcK zn}OGf&@K|W3qX$lGXDSBwht`Cv~c}PMX?fJ52ue;~+q@)~J8% zAYq_rJKWk$&o(EdGg%h~tKeD$;xoLx2sfY}r)Ld1y7=clIJt5h@*bw@bUx%bJ+}ce zo%r0L<0DUyV#h}!{ILsY8||-*avI$0xq`M^AID^=M3;?O;D*IerlJWEBJCU}bhVpN zqMO6$U_i$WcItY^*EivpyYP_9@pU>l}gyL4&w zahJsXOwXKlN#L$=*kwcfVgi4iqb|>8pp!1olU;DoC6Q^pb1qR9R7gfT=n^DIkRU;V z1PKx(NRS{wf&>W?BuJ1TL4pJc5+q2FAVGoz2@)hokRU;V1PQMK{tHX%<@W%{000OW BHwgd$ literal 0 HcmV?d00001 diff --git a/pyrandtoys.egg-info/PKG-INFO b/pyrandtoys.egg-info/PKG-INFO new file mode 100644 index 0000000..36a5f2c --- /dev/null +++ b/pyrandtoys.egg-info/PKG-INFO @@ -0,0 +1,127 @@ +Metadata-Version: 2.1 +Name: pyrandtoys +Version: 1.0.0 +Summary: Python Module for generating the result of probability based toys. +Home-page: https://github.com/thenithinbalaji/pyrandtoys +Author: thenithinbalaji +Author-email: thenithinbalaji@outlook.in +License: UNKNOWN +Keywords: python,random,probability,experiment +Platform: UNKNOWN +Classifier: Intended Audience :: Education +Classifier: Intended Audience :: Developers +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 3 +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: POSIX +Classifier: Operating System :: Microsoft :: Windows +Classifier: License :: OSI Approved :: MIT License +License-File: LICENSE.md + +PyRandToys +========== + +``pyrandtoys`` is a python module containing probability-based toys +functions. It works offline and is compatible with both Python 2 and 3. + +Installation +~~~~~~~~~~~~ + +:: + + pip install pyrandtoys + +Usage +~~~~~ + +:: + + import pyrandtoys + +Dice: +^^^^^ + ++ **Optional:** Number of Dice ```` ++ **Default:** Number of Dice = 1 ++ **Return Type:** ```` + +:: + + dice(number_of_dice) + +Coin: +^^^^^ + ++ **Optional:** Number of Coins ```` ++ **Default:** Number of Coins = 1 ++ **Return Type:** ```` + +:: + + coin(number_of_coins) + +Card: +^^^^^ + ++ **Optional:** Number of Cards ```` ++ **Default:** Number of Cards = 1 ++ **Return Type:** ```` + +:: + + card(number_of_cards) + +Similar Toys: +^^^^^^^^^^^^^ + ++ **Optional:** Number of Items ```` ++ **Default:** Number of Items = 1 ++ **Return Type:** ```` + +:: + + dreidel(number_of_dreis) + cat(number_of_cats) + switch(number_of_switches) + +Spinner: +^^^^^^^^ + ++ **Required:** Lower & Upper Limits ```` ++ **Default:** Lower Limit = 0 ++ **Return Type:** ```` + +:: + + spinner(lowerLimit, upperLimit) + +Toy Combinations: +^^^^^^^^^^^^^^^^^ + ++ **Default:** Number of Toys = 0 ++ **Return Type:** ```` + +**If you want to use a combination of toys then,** + **Required:** names of toys as ``, , `` + +:: + + combi("coin", "switch") + combi(("switch", "cat", "dice")) + combi(["dreidel", "coin", "coin", "cat"]) + +**For combination of x random toys,** + +:: + + combi(x) + +Project Links +~~~~~~~~~~~~~ + +- PyPI + `(https://pypi.org/project/pyrandtoys/) `__ +- GitHub + `(https://github.com/thenithinbalaji/pyrandtoys) `__ + + diff --git a/pyrandtoys.egg-info/SOURCES.txt b/pyrandtoys.egg-info/SOURCES.txt new file mode 100644 index 0000000..ac28381 --- /dev/null +++ b/pyrandtoys.egg-info/SOURCES.txt @@ -0,0 +1,9 @@ +LICENSE.md +README.rst +setup.py +pyrandtoys/__init__.py +pyrandtoys/functions.py +pyrandtoys.egg-info/PKG-INFO +pyrandtoys.egg-info/SOURCES.txt +pyrandtoys.egg-info/dependency_links.txt +pyrandtoys.egg-info/top_level.txt \ No newline at end of file diff --git a/pyrandtoys.egg-info/dependency_links.txt b/pyrandtoys.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/pyrandtoys.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/pyrandtoys.egg-info/top_level.txt b/pyrandtoys.egg-info/top_level.txt new file mode 100644 index 0000000..b8a7650 --- /dev/null +++ b/pyrandtoys.egg-info/top_level.txt @@ -0,0 +1 @@ +pyrandtoys