adafruit-circuitpython-sd


Nameadafruit-circuitpython-sd JSON
Version 3.3.22 PyPI version JSON
download
home_page
SummaryCircuitPython library for SD cards.
upload_time2023-12-09 17:33:23
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords adafruit sdcard sd card mount storage featherwing adaloggerbreakout hardware micropython circuitpython
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
Introduction
============

.. image:: https://readthedocs.org/projects/adafruit-circuitpython-sd/badge/?version=latest
    :target: https://docs.circuitpython.org/projects/sd/en/latest/
    :alt: Documentation Status

.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
    :target: https://adafru.it/discord
    :alt: Discord

.. image:: https://github.com/adafruit/Adafruit_CircuitPython_SD/workflows/Build%20CI/badge.svg
    :target: https://github.com/adafruit/Adafruit_CircuitPython_SD/actions/
    :alt: Build Status

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black
    :alt: Code Style: Black

CircuitPython driver for SD cards. This implements the basic reading and writing
block functionality needed to mount an SD card using `storage.VfsFat`.

Dependencies
=============
This driver depends on:

* `Adafruit CircuitPython 2.0.0+ <https://github.com/adafruit/circuitpython>`_
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_

Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.

Usage Example
=============

Mounting a filesystem on an SD card so that its available through the normal Python
ways is easy.

Below is an example for the Feather M0 Adalogger. Most of this will stay the same
across different boards with the exception of the pins for the SPI and chip
select (cs) connections.

.. code-block:: python

    import adafruit_sdcard
    import busio
    import digitalio
    import board
    import storage

    # Connect to the card and mount the filesystem.
    spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
    cs = digitalio.DigitalInOut(board.SD_CS)
    sdcard = adafruit_sdcard.SDCard(spi, cs)
    vfs = storage.VfsFat(sdcard)
    storage.mount(vfs, "/sd")

    # Use the filesystem as normal.
    with open("/sd/test.txt", "w") as f:
        f.write("Hello world\n")

Sharing the SPI bus with other devices
======================================

.. important::
    If the same SPI bus is shared with other peripherals, it is important that
    the SD card be initialized before accessing any other peripheral on the bus.
    Failure to do so can prevent the SD card from being recognized until it is
    powered off or re-inserted.


Documentation
=============

API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/sd/en/latest/>`_.

For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_sdcard/blob/main/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "adafruit-circuitpython-sd",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adafruit,sdcard,sd,card,mount,storage,featherwing,adaloggerbreakout,hardware,micropython,circuitpython",
    "author": "",
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/7f/a0/768f62162bf3097dbc2f10a3ad9341acc78297c8270a07b56661cabb3d67/adafruit-circuitpython-sd-3.3.22.tar.gz",
    "platform": null,
    "description": "\nIntroduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-sd/badge/?version=latest\n    :target: https://docs.circuitpython.org/projects/sd/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://adafru.it/discord\n    :alt: Discord\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_SD/workflows/Build%20CI/badge.svg\n    :target: https://github.com/adafruit/Adafruit_CircuitPython_SD/actions/\n    :alt: Build Status\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code Style: Black\n\nCircuitPython driver for SD cards. This implements the basic reading and writing\nblock functionality needed to mount an SD card using `storage.VfsFat`.\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython 2.0.0+ <https://github.com/adafruit/circuitpython>`_\n* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.\n\nUsage Example\n=============\n\nMounting a filesystem on an SD card so that its available through the normal Python\nways is easy.\n\nBelow is an example for the Feather M0 Adalogger. Most of this will stay the same\nacross different boards with the exception of the pins for the SPI and chip\nselect (cs) connections.\n\n.. code-block:: python\n\n    import adafruit_sdcard\n    import busio\n    import digitalio\n    import board\n    import storage\n\n    # Connect to the card and mount the filesystem.\n    spi = busio.SPI(board.SCK, board.MOSI, board.MISO)\n    cs = digitalio.DigitalInOut(board.SD_CS)\n    sdcard = adafruit_sdcard.SDCard(spi, cs)\n    vfs = storage.VfsFat(sdcard)\n    storage.mount(vfs, \"/sd\")\n\n    # Use the filesystem as normal.\n    with open(\"/sd/test.txt\", \"w\") as f:\n        f.write(\"Hello world\\n\")\n\nSharing the SPI bus with other devices\n======================================\n\n.. important::\n    If the same SPI bus is shared with other peripherals, it is important that\n    the SD card be initialized before accessing any other peripheral on the bus.\n    Failure to do so can prevent the SD card from being recognized until it is\n    powered off or re-inserted.\n\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/sd/en/latest/>`_.\n\nFor information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_sdcard/blob/main/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CircuitPython library for SD cards.",
    "version": "3.3.22",
    "project_urls": {
        "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_SD"
    },
    "split_keywords": [
        "adafruit",
        "sdcard",
        "sd",
        "card",
        "mount",
        "storage",
        "featherwing",
        "adaloggerbreakout",
        "hardware",
        "micropython",
        "circuitpython"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c7c106ffe370ce76438ecb8a9d01b50b90b2c9b0c0f6dd714ca32ed477a9492",
                "md5": "a2c6ae85c200da8afd848d0cad9acddb",
                "sha256": "83aad0f4021f562697e5f5596c6b75fe2f4bf18c2c5e2358c40bfa5ad39e3dad"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_sd-3.3.22-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a2c6ae85c200da8afd848d0cad9acddb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8884,
            "upload_time": "2023-12-09T17:33:21",
            "upload_time_iso_8601": "2023-12-09T17:33:21.246020Z",
            "url": "https://files.pythonhosted.org/packages/5c/7c/106ffe370ce76438ecb8a9d01b50b90b2c9b0c0f6dd714ca32ed477a9492/adafruit_circuitpython_sd-3.3.22-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7fa0768f62162bf3097dbc2f10a3ad9341acc78297c8270a07b56661cabb3d67",
                "md5": "ca151b570fa28e32263c0c17f1d5136c",
                "sha256": "46d69979b81ff78351c4eef7ca1a341dce65c5a7a08204e8ad3bca09553c83be"
            },
            "downloads": -1,
            "filename": "adafruit-circuitpython-sd-3.3.22.tar.gz",
            "has_sig": false,
            "md5_digest": "ca151b570fa28e32263c0c17f1d5136c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 30240,
            "upload_time": "2023-12-09T17:33:23",
            "upload_time_iso_8601": "2023-12-09T17:33:23.538246Z",
            "url": "https://files.pythonhosted.org/packages/7f/a0/768f62162bf3097dbc2f10a3ad9341acc78297c8270a07b56661cabb3d67/adafruit-circuitpython-sd-3.3.22.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-09 17:33:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adafruit",
    "github_project": "Adafruit_CircuitPython_SD",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "adafruit-circuitpython-sd"
}
        
Elapsed time: 0.15778s