scratch-verify
Verify the ownership of a Scratch account.
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
Related
- scratch-verify - JavaScript version.
Metadata
Release files for scratch-verify 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scratch-verify-1.0.1.tar.gz | 2.2 kB | Without provenance | Details for scratch-verify-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scratch_verify-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for scratch_verify-1.0.1-py3-none-any.whl |
Total release size: 5.8 kB
Release files / scratch-verify-1.0.1.tar.gz
| Download URL | scratch-verify-1.0.1.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7ce00cb1e09c547a4eee6ef9280624262f77c5536f2e6768aade201f36416cb
|
|
BLAKE2b-256 checksum How to use checksums |
dc4df8917ba0dcba8e1d3f33ec2baaec32cb114e81f0fc14d033f7eb3667b27f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.32.1 CPython/3.7.4
|
Release files / scratch_verify-1.0.1-py3-none-any.whl
| Download URL | scratch_verify-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e27f1a5513ed62586e031053df806ce449be73cb05dc5e5f65911f6b75fba7e2
|
|
BLAKE2b-256 checksum How to use checksums |
42e7d8e340ba34c7050ea67af826ea2a3e5c3549cb50f53a6893dc4f875bb2b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.32.1 CPython/3.7.4
|
Security for scratch-verify 1.0.1
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.