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.8.tar.gz
(2.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file IsDigit-0.0.8.tar.gz.
File metadata
- Download URL: IsDigit-0.0.8.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d9d794bd88111d6ee44d669c05505ec81848005cbb8f7ea5a4597255ccc8783
|
|
| MD5 |
dd5764f186662c2923e6f5c7078f41da
|
|
| BLAKE2b-256 |
f6ca099547a4bdf91d384e46928576d9c38f34c7f385a902521ab8af51809fd2
|
File details
Details for the file IsDigit-0.0.8-py2-none-any.whl.
File metadata
- Download URL: IsDigit-0.0.8-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f585ae0ce10c632650870ca14377a3a9143e6e60df56b2768bb8784b20ac690b
|
|
| MD5 |
7e80b05b1922d904b7e11f30764af609
|
|
| BLAKE2b-256 |
20002259fb5c6544d9d8e4eba29a5cfc463a19c7389a330fcb221c84a1fdf7df
|