A third-party Python API of Plurk Dice Emojis
Project description
Plurk Dice
Install
pip install plurk-dice
Usage
>>> from plurk_dice import Dice
# Roll a dice directly
>>> Dice(20).roll()
{'result': 7, 'url': 'https://s.plurk.com/ff94b39b3f0927042f8479fac0fd92d1.png'}
>>> Dice("bzz").roll(base64=True)
{'result': 'B', 'url': 'https://s.plurk.com/e3481a0219283c49455d8af6012980ea.png', 'base64': 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARxJREFUeNqs1bFLAmEYx/H3Ui6c2sR0jByV3EWE2gMRkyJpcDOXBsF2JynrDwhqUf8MHaWWtKWtocBwDhzCvhePcYOHd+/bC5/hOR5+vHfv3XOWrb6V5krgEEOMlxc3lP6KoYEbpP8jMIU48riTWjswigpCUmdwiz3dwCpyrnqOJLJhjbB91Fz1APeY4CNo4A5aciCf6Mjzm/51OK+NT1voYYERDlb1+Q0L4VrC+tj16vUTZuESX7iSnSqTwDpmaMJe178u7AxvOJedKpPAE7ygEuDgPANLeEI5SJhX4BEeUQwatirQuc1nnZ0tOV/KJiIooI42urojKCyz7BinuMCDwUj7HV/veJUPvK8MlyW/AGdQbsvEmJsE/ggwAMem4bIle0IVAAAAAElFTkSuQmCC'}
# Roll dices parse from text
>>> Dice.parse("(dice20)(dice8)")
[{'result': 2, 'url': 'https://s.plurk.com/27866de1cbed77d98cd8a886205c9dcb.png'}, {'result': 6, 'url': 'https://s.plurk.com/17c9123ed084f917ede14447afdfabdf.png'}]
>>> Dice.parse("(dice20)(dice8)", base64=True)
...
Support emojis
-
(dice2)
Run tests
python -m unittest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plurk-dice-0.0.3.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for plurk_dice-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e905390ed28428cb4f1b912bc71850a63e3ba0d4e757c1b76ffb3c77eb20b11 |
|
MD5 | a415f47ac61bf96f170ffd741556ead5 |
|
BLAKE2b-256 | 47c2b9fd1a73211aa90762988128624fd26a03ae13e66a31348dbb2279fb5fe4 |