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', validation_error_message='Wrong email format!')
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.2.0.tar.gz
(5.8 kB
view details)
Built Distribution
File details
Details for the file aiogram-forms-0.2.0.tar.gz
.
File metadata
- Download URL: aiogram-forms-0.2.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.7.11 Linux/5.4.0-80-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5fd7e47bce7e4db78015247cc5da2d3aa6691073869ffee27b59df88b82a3c6 |
|
MD5 | 411603a5169905882c97ed41dfd3e40b |
|
BLAKE2b-256 | 541b89d978d285a049ae070b386eac974ac8b520fda8b95344f49e164f7d3e66 |
File details
Details for the file aiogram_forms-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: aiogram_forms-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.7.11 Linux/5.4.0-80-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac6abd9b058ab51ad272b2a911b1973b7c79d51785768c1fa6c3c1e5ba583e3a |
|
MD5 | d39936944139f763c178092fadf29c6c |
|
BLAKE2b-256 | 6e8c3081d4a1efd12c2c3635aaf3748f6d071c9f76dfc57eb618c919aa03c4f7 |