{ "info": { "author": "Adafruit Industries", "author_email": "circuitpython@adafruit.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries", "Topic :: System :: Hardware" ], "description": "Introduction to Adafruit's PCF8523 Real Time Clock (RTC) Library\n================================================================\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-pcf8523/badge/?version=latest\n :target: https://circuitpython.readthedocs.io/projects/pcf8523/en/latest/\n :alt: Documentation Status\n\n.. image :: https://img.shields.io/discord/327254708534116352.svg\n :target: https://discord.gg/nBQh6qu\n :alt: Discord\n\n.. image:: https://travis-ci.com/adafruit/Adafruit_CircuitPython_PCF8523.svg?branch=master\n :target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_PCF8523\n :alt: Build Status\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. Equipped with PCF8523 RTC - it can\nrun from 3.3V or 5V power & logic!\n\nThe PCF8523 is simple and inexpensive but not a high precision device.\nIt may lose or gain up to two seconds a day. For a high-precision,\ntemperature compensated alternative, please check out the\n`DS3231 precision RTC. `_\nIf you need a DS1307 for compatibility reasons, check out our\n`DS1307 RTC breakout `_.\n\n.. image:: _static/3295-00.jpg\n :alt: PCF8523 Breakout Board\n\nDependencies\n=============\n\nThis driver depends on the `Register `_\nand `Bus Device `_\nlibraries. Please ensure they are also available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`a library and driver bundle `_.\n\nInstalling from PyPI\n--------------------\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI `_. To install for current user:\n\n.. code-block:: shell\n\n pip3 install adafruit-circuitpython-pcf8523\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n sudo pip3 install adafruit-circuitpython-pcf8523\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n mkdir project-name && cd project-name\n python3 -m venv .env\n source .env/bin/activate\n pip3 install adafruit-circuitpython-pcf8523\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 import adafruit_pcf8523\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\nYou can also use pins defined by the onboard `microcontroller` through the\n`microcontroller.pin` module.\n\nNow, to initialize the I2C bus:\n\n.. code:: python\n\n i2c_bus = busio.I2C(SCL, SDA)\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 = adafruit_pcf8523.PCF8523(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\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n`_\nbefore contributing to help this project stay welcoming.\n\nBuilding locally\n================\n\nZip release files\n-----------------\n\nTo build this library locally you'll need to install the\n`circuitpython-build-tools `_ package.\n\n.. code-block:: shell\n\n python3 -m venv .env\n source .env/bin/activate\n pip install circuitpython-build-tools\n\nOnce installed, make sure you are in the virtual environment:\n\n.. code-block:: shell\n\n source .env/bin/activate\n\nThen run the build:\n\n.. code-block:: shell\n\n circuitpython-build-bundles --filename_prefix adafruit-circuitpython-pcf8523 --library_location .\n\nSphinx documentation\n-----------------------\n\nSphinx is used to build the documentation based on rST files and comments in the code. First,\ninstall dependencies (feel free to reuse the virtual environment from above):\n\n.. code-block:: shell\n\n python3 -m venv .env\n source .env/bin/activate\n pip install Sphinx sphinx-rtd-theme\n\nNow, once you have the virtual environment activated:\n\n.. code-block:: shell\n\n cd docs\n sphinx-build -E -W -b html . _build/html\n\nThis will output the documentation to ``docs/_build/html``. Open the index.html in your browser to\nview them. It will also (due to -W) error out on any warning like Travis will. This is a good way to\nlocally verify it will pass.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/adafruit/Adafruit_CircuitPython_PCF8523", "keywords": "adafruit pcf8523 real time clock rtc breakout hardware micropython circuitpython", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "adafruit-circuitpython-pcf8523", "package_url": "https://pypi.org/project/adafruit-circuitpython-pcf8523/", "platform": "", "project_url": "https://pypi.org/project/adafruit-circuitpython-pcf8523/", "project_urls": { "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_PCF8523" }, "release_url": "https://pypi.org/project/adafruit-circuitpython-pcf8523/1.3.0/", "requires_dist": null, "requires_python": "", "summary": "CircuitPython library for PCF8523 real time clock.", "version": "1.3.0" }, "last_serial": 5739060, "releases": { "1.2.0": [ { "comment_text": "", "digests": { "md5": "8211593a75329c1e464209e3615e2ed6", "sha256": "c926028f50276c203e312b760535576ce4e7554a4329c2a9d1d518559b27f596" }, "downloads": -1, "filename": "adafruit-circuitpython-pcf8523-1.2.0.tar.gz", "has_sig": false, "md5_digest": "8211593a75329c1e464209e3615e2ed6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 261884, "upload_time": "2018-08-07T23:41:01", "url": "https://files.pythonhosted.org/packages/44/46/4976e7a85f5a8989c9c246ef87e2b4e9915269dde47c324ffaae3e69d989/adafruit-circuitpython-pcf8523-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "d1352c8b8a895fd3ae332572743a8484", "sha256": "4a38645d94e1b9cd41dc2f7ede924fd4a8eb9296895a40f3dd20c51c00d3807d" }, "downloads": -1, "filename": "adafruit-circuitpython-pcf8523-1.2.1.tar.gz", "has_sig": false, "md5_digest": "d1352c8b8a895fd3ae332572743a8484", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 261879, "upload_time": "2018-11-12T17:38:48", "url": "https://files.pythonhosted.org/packages/9a/26/ccf751c65c7085351a587c2dba4c36e534dde3ce55b0396f78086715b952/adafruit-circuitpython-pcf8523-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "b1431096b485983c0ec1c6e0ffdec1f9", "sha256": "e621654903897a8311049c99f083dcabe3662d5b8b939c7b337cd3aa46d97d37" }, "downloads": -1, "filename": "adafruit-circuitpython-pcf8523-1.2.2.tar.gz", "has_sig": false, "md5_digest": "b1431096b485983c0ec1c6e0ffdec1f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 259845, "upload_time": "2019-01-15T03:12:32", "url": "https://files.pythonhosted.org/packages/1e/99/0b85eba1c299649715235f06094463f6323d111ddf197afb4f8042bb2e4e/adafruit-circuitpython-pcf8523-1.2.2.tar.gz" } ], "1.2.3": [ { "comment_text": "", "digests": { "md5": "e4cd57afaab4d6e563df7d734f3e737c", "sha256": "e746ec4d83d14e7564e350277dd732c4283b76e28c7e4a159a4c7d38d5089be1" }, "downloads": -1, "filename": "adafruit-circuitpython-pcf8523-1.2.3.tar.gz", "has_sig": false, "md5_digest": "e4cd57afaab4d6e563df7d734f3e737c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 260741, "upload_time": "2019-03-26T17:16:17", "url": "https://files.pythonhosted.org/packages/ca/d1/1c214d73f4219d7f063e88cf6a8cdde41cc74c9947706f119ae89d0088a1/adafruit-circuitpython-pcf8523-1.2.3.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "d5c96ddb9c1af29762120cfb87277619", "sha256": "88efe8bd83b3eef73db5839b7de5778ec4e25a3c5a7a051b90b6f9c5e8a8d8c6" }, "downloads": -1, "filename": "adafruit-circuitpython-pcf8523-1.3.0.tar.gz", "has_sig": false, "md5_digest": "d5c96ddb9c1af29762120cfb87277619", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 260743, "upload_time": "2019-08-27T19:09:14", "url": "https://files.pythonhosted.org/packages/cf/33/32b49a2b0b7f92bec72af5bb9f6ec62cfad4502a79028bee3e93dd8e3f78/adafruit-circuitpython-pcf8523-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d5c96ddb9c1af29762120cfb87277619", "sha256": "88efe8bd83b3eef73db5839b7de5778ec4e25a3c5a7a051b90b6f9c5e8a8d8c6" }, "downloads": -1, "filename": "adafruit-circuitpython-pcf8523-1.3.0.tar.gz", "has_sig": false, "md5_digest": "d5c96ddb9c1af29762120cfb87277619", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 260743, "upload_time": "2019-08-27T19:09:14", "url": "https://files.pythonhosted.org/packages/cf/33/32b49a2b0b7f92bec72af5bb9f6ec62cfad4502a79028bee3e93dd8e3f78/adafruit-circuitpython-pcf8523-1.3.0.tar.gz" } ] }