Skip to main content

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


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 details)

Uploaded Source

Built Distribution

userprovided-0.5.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file userprovided-0.5.0.tar.gz.

File metadata

  • Download URL: userprovided-0.5.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.9

File hashes

Hashes for userprovided-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d888e1da5bc74a2daef82ee8b693d685920a55b78261907151c4629c82d46cc0
MD5 96bc034216406c85d4543839e1a6a052
BLAKE2b-256 7471d2363a8082cd7ccd5a4e8748fe07c0b5532b6385e6d7db77f1b4e913cf65

See more details on using hashes here.

File details

Details for the file userprovided-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: userprovided-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.9

File hashes

Hashes for userprovided-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b18bc0039da1664523624211c54bc09d9f0d00c4a4ec2683da4346bd2545acd2
MD5 85f2354e82b6f9cb4a6fe2103d45aad6
BLAKE2b-256 f750a0a8ad601bf8fa2c4aecb9a23462854a7d003c9b914c7cbb7ac925ac28a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page