A library to check user input.
Project description
userprovided
The package "userprovided" checks input for plausibility. For example it can check whether a string is a valid email address or an URL.
There are plenty of validators out there. The reasons to write another one:
- Its sister-project exoskeleton needs some special features.
- Extensive testing (100% test coverage / unit tests / automatic test generation with the hypothesis package)
- the code has type hints (PEP 484)
- Modularity
Installation and Use
Please take note that the development status of "userprovided" is "beta". This means it may still contain some bugs and some commands could change with one of the next releases.
Install exoskeleton using pip
or pip3
. For example:
pip install userprovided
You may consider using a virtualenv.
Examples
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import userprovided
### Mailadresses ###
userprovided.mail.is_email(None)
# => False
userprovided.mail.is_email('example@example.com')
# => True
### Cloud ###
userprovided.cloud.is_aws_s3_bucket_name('foobar')
# => True
### URLs ###
print(userprovided.url.is_url('https://www.example.com'))
# => True
print(userprovided.url.is_url('https://www.example.com', ('ftp')))
# => False (Schema does not match permitted)
### Hashes ###
print(userprovided.hash.hash_available('md5'))
# => ValueError because md5 is deprecated
print(userprovided.hash.hash_available('sha256'))
# => True on almost any system
Update and Deprecation Policy
It makes no sense to duplicate functionality already available in the Python Standard Library.
For example: userprovided
does not contain methods to check IP addresses as the library ipaddress
is (since Python 3.3.) part of the standard.
If this package contains functionality that becomes superseded by the Standard Library, it will start to log a depreciation warning. The functionality itself is planned to stay available for at least a major version of userprovided
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for userprovided-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69b16a0068372e65e0b78a547355bbdc9bf424c9de15f10712d969a22610eda0 |
|
MD5 | bd14ce92455f46c4d3c4884c060f8ead |
|
BLAKE2b-256 | fb977c82cc15127aec9ff76e1f013811fa97caf0c41250c3a456c4e718d1ae1d |