Skip to main content

Simple, mainly useless, python package that checks if a string, int, or float is a digit.

Project description

Installing

From source:

  • pip install git+https://github.com/editid0/IsDigit

From pypi:

  • pip install -U IsDigit

Examples

from isdigit import IsDigit

digits = IsDigit(allow_floats=True, allow_ints=True)

print(digits.is_digit('1')) # returns True
print(digits.is_digit('1.0')) # returns True
print(digits.is_digit('1.0.0')) # returns False
print(digits.is_digit('x')) # returns False

Or, alternatively:

from isdigit import IsDigit

digits = IsDigit()

print(digits.is_digit('1')) # returns True
print(digits.is_digit('1.0')) # returns False
print(digits.is_digit('1.0.0')) # returns False
print(digits.is_digit('x')) # returns False

Using discord.py with IsDigit


Install


pip install

pip install -U IsDigit[discord]

Install from repo

pip install git+https://github.com/editid0/IsDigit[discord]

Basic Usage

Please do not use this code when making a bot. Read the discord.py docs instead.
This package is not affiliated with the discord.py library.
from isdigit import IsDigit
from discord.ext import commands

bot = commands.Bot(command_prefix='prefix')
digits = IsDigit()

@bot.command()
async def test(ctx, arg: digits):
    await ctx.send(type(arg))

@test.error
async def test_error(ctx, error):
    await ctx.send(error)

bot.run('token')

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

IsDigit-0.0.9.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

IsDigit-0.0.9-py2-none-any.whl (3.7 kB view details)

Uploaded Python 2

File details

Details for the file IsDigit-0.0.9.tar.gz.

File metadata

  • Download URL: IsDigit-0.0.9.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for IsDigit-0.0.9.tar.gz
Algorithm Hash digest
SHA256 2ad7ca1c7c1ecf8a545995ed286d8debb1bdeda4a72d3c477e6c4759ac45096f
MD5 b40e7e3cef58c985c1a49e0ed8f4b825
BLAKE2b-256 a04219d344073f9011925fc5fdac0e750fe2db4d16fb3de43a27e25797ccfdf9

See more details on using hashes here.

File details

Details for the file IsDigit-0.0.9-py2-none-any.whl.

File metadata

  • Download URL: IsDigit-0.0.9-py2-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for IsDigit-0.0.9-py2-none-any.whl
Algorithm Hash digest
SHA256 8bc89cb1b5d14f0a710db51efd8a80ef728019a555342279e609f37922213531
MD5 0d6f33be05f0ca8b6e98e3842d8542c3
BLAKE2b-256 81e039c63c837d2053e650008ff7d9983ac260f88ca44d91eedaa55355c40947

See more details on using hashes here.

Supported by

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