{"id":15018647,"url":"https://github.com/adafruit/adafruit_circuitpython_pcf8563","last_synced_at":"2025-06-14T09:06:26.893Z","repository":{"id":37959292,"uuid":"395137732","full_name":"adafruit/Adafruit_CircuitPython_PCF8563","owner":"adafruit","description":" Adafruit CircuitPython drivers for the PCF8563 realtime clock. ","archived":false,"fork":false,"pushed_at":"2025-05-15T22:15:37.000Z","size":585,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-06-14T09:04:41.705Z","etag":null,"topics":["circuitpython","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adafruit.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-11T23:12:17.000Z","updated_at":"2025-05-15T14:04:43.000Z","dependencies_parsed_at":"2024-09-21T15:00:55.325Z","dependency_job_id":"bb5c66d7-4071-4df8-9b99-cd95d2002151","html_url":"https://github.com/adafruit/Adafruit_CircuitPython_PCF8563","commit_stats":{"total_commits":92,"total_committers":19,"mean_commits":4.842105263157895,"dds":0.8369565217391304,"last_synced_commit":"14878b19377efd4e8f8394aad27ae4aa05a2277d"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/adafruit/Adafruit_CircuitPython_PCF8563","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_PCF8563","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_PCF8563/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_PCF8563/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_PCF8563/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adafruit","download_url":"https://codeload.github.com/adafruit/Adafruit_CircuitPython_PCF8563/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_PCF8563/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259790456,"owners_count":22911547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circuitpython","hacktoberfest"],"created_at":"2024-09-24T19:52:13.947Z","updated_at":"2025-06-14T09:06:26.887Z","avatar_url":"https://github.com/adafruit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nIntroduction to Adafruit's PCF8563 Real Time Clock (RTC) Library\n================================================================\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-pcf8563/badge/?version=latest\n    :target: https://docs.circuitpython.org/projects/pcf8563/en/latest/\n    :alt: Documentation Status\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n    :target: https://discord.gg/nBQh6qu\n    :alt: Discord\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_PCF8563/workflows/Build%20CI/badge.svg\n    :target: https://github.com/adafruit/Adafruit_CircuitPython_PCF8563/actions/\n    :alt: Build Status\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n    :target: https://github.com/astral-sh/ruff\n    :alt: Code Style: Ruff\n\nThis is a great battery-backed real time clock (RTC) that allows your\nmicrocontroller project to keep track of time even if it is reprogrammed,\nor if the power is lost. Perfect for datalogging, clock-building, time\nstamping, timers and alarms, etc.\n\nThe PCF8563 is simple and inexpensive but not a high precision device.\nIt may lose or gain multiple seconds a day. For a high-precision,\ntemperature compensated alternative, please check out the\n`DS3231 precision RTC. \u003chttps://www.adafruit.com/products/3013\u003e`_\nIf you need a DS1307 for compatibility reasons, check out our\n`DS1307 RTC breakout \u003chttps://www.adafruit.com/products/3296\u003e`_.\n\nDependencies\n=============\n\nThis driver depends on the `Register \u003chttps://github.com/adafruit/Adafruit_CircuitPython_Register\u003e`_\nand `Bus Device \u003chttps://github.com/adafruit/Adafruit_CircuitPython_BusDevice\u003e`_\nlibraries. Please ensure they are also available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`a library and driver bundle \u003chttps://github.com/adafruit/Adafruit_CircuitPython_Bundle\u003e`_.\n\nInstalling from PyPI\n====================\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI \u003chttps://pypi.org/project/adafruit-circuitpython-pcf8563/\u003e`_. To install for current user:\n\n.. code-block:: shell\n\n    pip3 install adafruit-circuitpython-pcf8563\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install adafruit-circuitpython-pcf8563\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n    mkdir project-name \u0026\u0026 cd project-name\n    python3 -m venv .venv\n    source .venv/bin/activate\n    pip3 install adafruit-circuitpython-pcf8563\n\n\nUsage Notes\n===========\n\nBasics\n------\n\nOf course, you must import the library to use it:\n\n.. code:: python\n\n    import busio\n    from adafruit_pcf8563.pcf8563 import PCF8563\n    import time\n\nAll the Adafruit RTC libraries take an instantiated and active I2C object\n(from the `busio` library) as an argument to their constructor. The way to\ncreate an I2C object depends on the board you are using. For boards with labeled\nSCL and SDA pins, you can:\n\n.. code:: python\n\n    from board import *\n\nNow, to initialize the I2C bus:\n\n.. code:: python\n\n    i2c_bus = board.I2C()\n\nOnce you have created the I2C interface object, you can use it to instantiate\nthe RTC object:\n\n.. code:: python\n\n    rtc = PCF8563(i2c_bus)\n\nDate and time\n-------------\n\nTo set the time, you need to set ``datetime`` to a `time.struct_time` object:\n\n.. code:: python\n\n    rtc.datetime = time.struct_time((2017,1,9,15,6,0,0,9,-1))\n\nAfter the RTC is set, you retrieve the time by reading the `datetime`\nattribute and access the standard attributes of a struct_time such as ``tm_year``,\n``tm_hour`` and ``tm_min``.\n\n.. code:: python\n\n    t = rtc.datetime\n    print(t)\n    print(t.tm_hour, t.tm_min)\n\nAlarm\n-----\n\nTo set the time, you need to set `alarm` to a tuple with a `time.struct_time`\nobject and string representing the frequency such as \"hourly\":\n\n.. code:: python\n\n    rtc.alarm = (time.struct_time((2017,1,9,15,6,0,0,9,-1)), \"daily\")\n\nAfter the RTC is set, you retrieve the alarm status by reading the\n`alarm_status` attribute. Once True, set it back to False to reset.\n\n.. code:: python\n\n    if rtc.alarm_status:\n        print(\"wake up!\")\n        rtc.alarm_status = False\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs \u003chttps://docs.circuitpython.org/projects/pcf8563/en/latest/\u003e`_.\n\nFor information on building library documentation, please check out `this guide \u003chttps://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1\u003e`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n\u003chttps://github.com/adafruit/Adafruit_CircuitPython_PCF8563/blob/master/CODE_OF_CONDUCT.md\u003e`_\nbefore contributing to help this project stay welcoming.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_pcf8563","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_pcf8563","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_pcf8563/lists"}