Skip to main content

Verify the ownership of a Scratch account.

Project description

scratch-verify

Verify the ownership of a Scratch account.

PyPI Badge

Install

pip install scratch-verify

Usage

from scratch_verify import create_code, verify_code

# The user should go to https://scratch.mit.edu/projects/440710593 and provide `code`
code = create_code()

# Verify if the user provided it
is_verified = verify_code(username, code)

API

scratch_verify.create_code()

Generate a verification code for the user to provide at https://scratch.mit.edu/projects/440710593. This is just a convenience method - you can use any numerical code. Returns a 6-digit number.

from scratch_verify import create_code

print(create_code())
#=> "435543"

scratch_verify.verify_code(username, code, completion_timeout?)

Verify whether the user is authenticated.

username

Type: string

The username to authenticate.

code

Type: string

The code to check for.

completion_timeout

Type: number
Default: Infinity

The maximum amount of seconds that can pass since the user provided the code before it is no longer accepted.

from scratch_verify import verify_code

# If the user has authenticated
print(verify_code("RichieNB", "435543"))
#=> True

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

scratch-verify-1.0.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

scratch_verify-1.0.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file scratch-verify-1.0.0.tar.gz.

File metadata

  • Download URL: scratch-verify-1.0.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.32.1 CPython/3.7.4

File hashes

Hashes for scratch-verify-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dae60fb95567dd1493864cd90e94e329ad4c8b4b5b90f8e0d2eaf6623de9d170
MD5 418b3d6fd1258e0e7b1133c0404352fa
BLAKE2b-256 90530e55032a4614aed2df831124e1a5b4834036f661ce2bd496e9a9a3b7b471

See more details on using hashes here.

File details

Details for the file scratch_verify-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: scratch_verify-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.32.1 CPython/3.7.4

File hashes

Hashes for scratch_verify-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa53b83677b0eef14c61dae2cf7730fa063a4c138f1566fdc7b80aea2b851b4b
MD5 6fde2972d9a0c3fd9594fb2e8cef0bdb
BLAKE2b-256 c47607ac4c770d66ba7945230390642ad8233315112a8153c5cf32d1098c1338

See more details on using hashes here.

Supported by

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