Forms for aiogram
Project description
aiogram-forms
Introduction
aiogram-forms
is an addition for aiogram
which allows you to create different forms and process user input step by step easily.
Installation
pip install aiogram-forms
Usage
Create form you need by subclassing aiogram_forms.forms.Form
. Fields can be added with aiogram_forms.fields.Field
from aiogram_forms import forms, fields
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton
class UserForm(forms.Form):
LANGUAGE_CHOICES = ('English', 'Russian', 'Chinese')
LANGUAGE_KEYBOARD = ReplyKeyboardMarkup(resize_keyboard=True, row_width=3).add(*[
KeyboardButton(label) for label in LANGUAGE_CHOICES
])
name = fields.StringField('Name')
language = fields.ChoicesField('Language', LANGUAGE_CHOICES, reply_keyboard=LANGUAGE_KEYBOARD)
email = fields.EmailField('Email')
Code of Conduct
History
All notable changes to this project will be documented in CHANGELOG file.
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
aiogram-forms-0.1.1.tar.gz
(5.5 kB
view details)
Built Distribution
File details
Details for the file aiogram-forms-0.1.1.tar.gz
.
File metadata
- Download URL: aiogram-forms-0.1.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.7.10 Linux/4.15.0-143-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15f9b4d52a85cad8230aeb694df40bdee84c3e9c41f5ba92dc6868787de8a0bd |
|
MD5 | f207e94c505de384025fdac241620bed |
|
BLAKE2b-256 | 8f0d18d1c5e60e02a9b65975cbfadb6bd089f954602e23a871cadae4596aefd7 |
File details
Details for the file aiogram_forms-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: aiogram_forms-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.7.10 Linux/4.15.0-143-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b325d22c8065904e14ed4baf708fcf40484d78b0a9b1bc90c97279727743731 |
|
MD5 | d622d654fa2e7d98c9291a9da1789771 |
|
BLAKE2b-256 | 2c8d005a5164c80e8d74d21a67b90886297ea7c0ee8627d5293d957de03618fd |