Skip to main content

EasyEntry

Overview

EasyEntry enter data into a program and easily check if they are valid.

Uses dictionaries to define the properties of the data:

  • type: str, int, float, date, time, email, passwd and menu.

  • default: sets a default by pressing the return key

  • options: defines a list of allowed values: [‘a’, ‘b’,…]

  • minmax: sets minimum and maximum limits for a value: [0, 100]

  • required: defines the obligation or not to introduce a value: True or False

  • and others (See the property list).

Example:

import easyentry as ee

ee.global_required = True

person = {}
person['name'] = {'type':'str'}
person['city'] = {'type':'str', 'default':'Seville'}
person['age']  = {'type':'int', 'minmax': [0,100]}
person['height']  = {'type':'float'}
person['bicycle']  = {'type':'str', 'options': ['y','n']}
person['datetrip'] = {'type':'date', 'default': 'now'}
person['email'] = {'type':'email', 'required': False}

name = ee.entry('What is your name?', (person, 'name'))
city = ee.entry('What city you live?', (person, 'city'))
age = ee.entry('How old are you?', (person, 'age'))
height = ee.entry('Height?', (person, 'height'))
bicycle = ee.entry('Do you have a bicycle?', (person, 'bicycle'))
datetrip = ee.entry('Date of trip?', (person, 'datetrip'))
email = ee.entry('Your email address', (person, 'email'))

Creates a options menu

To build a menu:

person['info'] = {'type':'menu', 'title':'Select an option', 'options':['phone','mail','none'], 'rindex':True}
info = ee.entry('To receive information by...', (person, 'info'))

Options:

  • rindex: With True returns the number of the selected option

  • sorted: sort the list of options (True/False)

Output:

To receive information by...
(1) phone
(2) mail
(3) none
Select an option [3]:

Password

Enter a password:

person['passwd'] = {'type':'passwd'}

passwd = ee.entry('Enter password', (person, 'passwd'))
repeat = ee.entry('Repeat password', (person, 'passwd'))

if passwd == repeat:
    print(passwd)

Property list

Properties of the data types available:

  • str: required, options or minmax and default

  • int: required, options or minmax and default

  • float: required, options or minmax and default

  • date: required, options or mixmax and default:date or now

  • time: required, options or mixmax and default:time or now

  • password: required

  • email: required

  • menu: required, title, options, default, sorted and rindex

Constants

The constants are used to set the values that define the general behavior of EasyEntry:

# Message to be displayed when data is not valid:
# - You can type the message in your language
# - If the value is omitted, the default is the current (in English)

ee.error_message = 'Invalid input, please try again'

# Set format 'date' and 'time':
# - Date format: '%Y-%m-%d' -> YYYY-MM-DD (default)
# - Hour format: '%H:%M:%S' -> HH:MM:SS   (default)

ee.date_format = '%d-%m-%Y'
ee.time_format = '%H:%M'

# Set the type of numerical data (int and float):
# - True and value = '' : var int   -> return 0
#                         var float -> return 0.0
# - False (default) and value = '': return ''

ee.strict_return = False

# Establish whether it is mandatory to enter a valid value or
# an empty entry (press return) is allowed
# - True  -> You must enter a valid value in all fields
# - False -> The field can be empty (default)
# The value of the 'required' property of a field overrides
# the global value

ee.global_required = True

Metadata

Release files for easyentry 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easyentry 0.0.9
File Size Uploaded Provenance Actions
easyentry-0.0.9.tar.gz 19.6 kB Without provenance Details for easyentry-0.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for easyentry 0.0.9
File Interpreter ABI Platform Actions
easyentry-0.0.9-py2.py3-none-any.whl Python 2, Python 3 none any Details for easyentry-0.0.9-py2.py3-none-any.whl

Total release size: 29.0 kB

Release files / easyentry-0.0.9.tar.gz

Download URL easyentry-0.0.9.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
39d08b8ad490a6a750661d0a39b4bef88c85313ae97640db3ce3fef579fb284d
BLAKE2b-256 checksum
How to use checksums
ea3b97276f0628100aa27569c30bd09c1fec0785a5713e151aa2b45fc5647f99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / easyentry-0.0.9-py2.py3-none-any.whl

Download URL easyentry-0.0.9-py2.py3-none-any.whl
Size 9.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
239aaaa0b6f68b200bf5398ff9234175d9c533873c94f2195a5977fd6ff9d137
BLAKE2b-256 checksum
How to use checksums
44c1e90b9a7b70f7918b95e0137f4686fb5804420e27c0c2ebdc995766c86a4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for easyentry 0.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files No provenance

0.0.8

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page