Skip to main content

Here a simple script to control your NS

import os
import json

from ns_parental_controls import ParentalControl


def save(**k):
    with open('test.json', 'wt') as file:
        file.write(json.dumps(k, indent=2))


def load(**k):
    if not os.path.isfile('test.json'):
        return k

    try:
        with open('test.json', 'rt') as file:
            return json.load(file)
    except Exception as e:
        print(e)
        return k


pc = ParentalControl(
    save_state_callback=save,
    load_state_callback=load,
    callback_kwargs={'random': 'kwargs'}
)

if not pc.access_token:
    if not pc.session_token:
        print(pc.get_auth_url())
        pc.process_auth_link(input('copy paste the button link "select this account" here:\n'))
    else:
        pc.get_new_access_token()

# True means disable the NS
# False means enable the NS
pc.lock_device(config.DEVICE_LABEL, False) # this is equiv to using the "Disable Alarms for Toady" in the app

# use this command to set the playtime to a particular value
# pc.set_playtime_minutes_for_today(config.DEVICE_LABEL, 30)

# use this to add an amount of time to the existing value
pc.add_playtime_minutes_for_today(config.DEVICE_LABEL, 30)

Metadata

Release files for ns-parental-controls 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ns-parental-controls 2.0.0
File Size Uploaded Provenance Actions
ns_parental_controls-2.0.0.tar.gz 9.1 kB Without provenance Details for ns_parental_controls-2.0.0.tar.gz

Release files / ns_parental_controls-2.0.0.tar.gz

Download URL ns_parental_controls-2.0.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0b526786a2cda60000d5f39d4fcb80831784c393b99cd90ac7515194d32a2b13
BLAKE2b-256 checksum
How to use checksums
002dab0896cd435fdbdeaf2fbf559a2314992922e67d3c7cf7c26b08f16c7037
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Security for ns-parental-controls 2.0.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page