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:
- It's sister-project exoskeleton needs some special features. This would be for example not only to check whether a string is an URL, but to also check whether the scheme is http or https.
- Extensive testing (unittests and automatic test generation with the hypothesis package)
- 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)
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
userprovided-0.5.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for userprovided-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b18bc0039da1664523624211c54bc09d9f0d00c4a4ec2683da4346bd2545acd2 |
|
MD5 | 85f2354e82b6f9cb4a6fe2103d45aad6 |
|
BLAKE2b-256 | f750a0a8ad601bf8fa2c4aecb9a23462854a7d003c9b914c7cbb7ac925ac28a7 |