Skip to main content

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

  • dice4
  • dice
  • (dice2)
  • dice8
  • digit
  • dice10
  • dice12
  • dice20
  • bzz
  • lots

Run tests

python -m unittest

Project details


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 details)

Uploaded Source

Built Distribution

plurk_dice-0.0.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file plurk-dice-0.0.3.tar.gz.

File metadata

  • Download URL: plurk-dice-0.0.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for plurk-dice-0.0.3.tar.gz
Algorithm Hash digest
SHA256 893818a8931f329bea3484243ac090f1ea5bcb665119945c4e00095e074cf2d6
MD5 43ce98b9bd982c5613e9b70a5db4e1f0
BLAKE2b-256 6f29b430c584f7e79c4dd77b735cd784b41afc38dcb0c4f94678e180cca98e70

See more details on using hashes here.

File details

Details for the file plurk_dice-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: plurk_dice-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for plurk_dice-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7e905390ed28428cb4f1b912bc71850a63e3ba0d4e757c1b76ffb3c77eb20b11
MD5 a415f47ac61bf96f170ffd741556ead5
BLAKE2b-256 47c2b9fd1a73211aa90762988128624fd26a03ae13e66a31348dbb2279fb5fe4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page