We've created a couple library bundles for CircuitPython. The idea is that one can have all available libraries stored on the CircuitPython drive at once and then
import them as needed. (They won't all fit into memory though.) This makes experimentation super easy because you only need to load everything once.
Another advantage of the bundle is that it makes it easy to find a list of all libraries. Even if you can't store all of the libraries on the drive, for example the Gemma M0 is only 64kb, the bundle makes it easy to copy over what you need when you need it.
It also helps CircuitPython devs keep track of libraries and update them as things change.
So, lets get our example library into the community bundle. To do so, we'll make a pull request on GitHub. First, lets fork the community bundle.
Adding the submodule to the Library Bundle
Now to add our library to the bundle we'll do:
git submodule add URL_TO_LIBRARY_INCLUDING.git libraries/SUBFOLDER/lowercase_library_name
You'll change the following:
URL_TO_LIBRARY_INCLUDING.git - This will be the full URL to the library including the
.git on the end. To get this URL, click on "Clone" in the GitHub repo, choose HTTPS, and copy that URL. Or you can copy the URL from the repo and add the
SUBFOLDER - The subfolder will be
drivers. Choose which based on your library. Is it a driver? Choose
drivers. Is it a helper? Choose
lowercase_library_name - This is the name of your library, minus the
Adafruit_CircuitPython_, in lowercase letters.
git submodule add https://github.com/adafruit/Adafruit_CircuitPython_PyPortal.git libraries/drivers/pyportal
And then we'll verify it worked by looking at the build log and versions file.
drivers.rst Library List
Before we submit a pull request with our new library, lets update the bundle documentation to include a link to the documentation for our library. Use whichever method you wish to open
drivers.rst, choose one of the categories to place your documentation link. The current categories are: Board-specific Helpers, Helper, Blinky, Displays, Real-time Clocks, Motion Sensors, Environmental Sensors, Light Sensors, Distance Sensors, Radio, IO Expansion, and Miscellaneous. Or, you can create a new category if that best describes your library.
With your category chosen, simply add a new line to that section using the reStructuredText hyperlink format. Easiest way, is to copy an existing line and edit it to change both the link text and the URL.