Skip to main content

Introduction

Documentation Status Discord Build Status Code Style: Ruff

Network Time Protocol (NTP) helper for CircuitPython.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-ntp

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-ntp

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-ntp

Usage Example

import adafruit_connection_manager
import adafruit_ntp
import os
import time
import wifi

wifi_ssid = os.getenv("CIRCUITPY_WIFI_SSID")
wifi_password = os.getenv("CIRCUITPY_WIFI_PASSWORD")
wifi.radio.connect(wifi_ssid, wifi_password)

pool = adafruit_connection_manager.get_radio_socketpool(wifi.radio)
ntp = adafruit_ntp.NTP(pool, tz_offset=0, cache_seconds=3600)

while True:
    print(ntp.datetime)
    time.sleep(1)

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Metadata

Release files for adafruit-circuitpython-ntp 3.3.8

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

Source distribution (sdist)

Source distribution for adafruit-circuitpython-ntp 3.3.8
File Size Uploaded
adafruit_circuitpython_ntp-3.3.8.tar.gz 24.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adafruit-circuitpython-ntp 3.3.8
File Interpreter ABI Platform
adafruit_circuitpython_ntp-3.3.8-py3-none-any.whl Python 3 none any Details

Total release size: 29.9 kB

Release files / adafruit_circuitpython_ntp-3.3.8.tar.gz

Download URL adafruit_circuitpython_ntp-3.3.8.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3be99b6c1a2b1956a1658675287f9d1bb9bb3ef25998cf0ff62e6e561080895b
BLAKE2b-256 checksum
How to use checksums
dbb2f0fce124f9225dae8f69b1a0fe9455deeccadeda5d3516c42d0941769e51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / adafruit_circuitpython_ntp-3.3.8-py3-none-any.whl

Download URL adafruit_circuitpython_ntp-3.3.8-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bcc1878b2d219cf396e0f257421723516b2dc51ad573bd76f7818deb12c6cf2c
BLAKE2b-256 checksum
How to use checksums
3a4e1809de3a8f32cb882c79df17884cf9c7ea28aac068335974b12d1535e749
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

3.4.0

2 release files

This release

3.3.8 This release

2 release files

3.3.7

2 release files

3.3.6

2 release files

3.3.5

2 release files

3.3.4

2 release files

3.3.3

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.13

2 release files

3.0.11

2 release files

3.0.10

2 release files

3.0.9

2 release files

3.0.8

2 release files

3.0.7

2 release files

3.0.6

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.2.6

1 release file

2.2.5

1 release file

2.2.4

1 release file

2.2.3

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.0

1 release file

1.1.0

1 release file

1.0.2

1 release file

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