.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/print_all_datafiles.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note You can download :ref:`below ` the full example code and run it online in `Codespaces `__ .. image:: https://github.com/codespaces/badge.svg :target: https://codespaces.new/spark-cleantech-l3/sda-copy?quickstart=1 --- .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_print_all_datafiles.py: Print all local data files. =========================== This script prints all data files synchronized on this local machines. Files are not necessarily downloaded. The script uses :py:func:`sda.api.load.list_all_files` which looks into all the Data Sharepoints synchronized on this machine either by having clicked the "Sync" (recommended) or "Add a Shortcut to my Drive" (not recommended, but works) buttons from the online Sharepoint / Documents page. Data Sharepoints local links must be defined in the local "~/sda.json" configuration file. .. GENERATED FROM PYTHON SOURCE LINES 18-20 First, we import the required libraries. ----------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 20-29 .. code-block:: Python from sda.api.load import list_all_files # Retrieve all files. file_paths = list_all_files(filter="*.xls*", max_recursion_level=2) print(f"Found {len(file_paths)} files. Here are the paths:") for i, path in enumerate(file_paths): print(f"{i:03}: {path}") .. _sphx_glr_download_auto_examples_print_all_datafiles.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: print_all_datafiles.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: print_all_datafiles.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: print_all_datafiles.zip `