Data Module

seestarpy.data.delete_files(folder, filenames)

Delete specific files from an observation folder via SMB.

Warning

This permanently removes data from the Seestar’s internal eMMC storage. There is no undo.

Parameters:
  • folder (str) – Name of the folder under MyWorks (e.g. "M 81").

  • filenames (list of str) – File names to delete within the folder.

Returns:

dict of {str – Mapping of each filename to True if deleted successfully, False if the file was not found or deletion failed.

Return type:

bool}

Examples

>>> from seestarpy import data
>>> data.delete_files("M 81", ["old_stack.fit", "old_stack.jpg"])
{'old_stack.fit': True, 'old_stack.jpg': True}
seestarpy.data.delete_folder(folder)

Recursively delete an observation folder and all its files via SMB.

Warning

This permanently removes data from the Seestar’s internal eMMC storage. There is no undo.

Parameters:

folder (str) – Name of the folder under MyWorks to delete (e.g. "M 81_sub").

Return type:

None

Examples

>>> from seestarpy import data
>>> data.list_folders()
{'M 81': 3, 'M 81_sub': 37, 'Lunar': 2}
>>> data.delete_folder("M 81_sub")
>>> data.list_folders()
{'M 81': 3, 'Lunar': 2}
seestarpy.data.download_file(folder, filename, dest='.')

Download a single file from the Seestar via HTTP.

The Seestar runs an HTTP file server on port 80. This function streams the file to a local directory in 64 KB chunks.

Parameters:
  • folder (str) – Folder under MyWorks, e.g. "M 81" or "M 81_sub".

  • filename (str) – Name of the file to download, e.g. "DSO_Stacked_33_M 81_20.0s_20260311_213509.fit".

  • dest (str) – Local directory to save the file in. Created if it doesn’t exist. Default ".".

Returns:

Absolute path to the downloaded file.

Return type:

str

Raises:
  • FileNotFoundError – If the file does not exist on the Seestar (HTTP 404).

  • ConnectionError – If the Seestar cannot be reached or another HTTP error occurs.

Examples

>>> from seestarpy import data
>>> data.download_file("M 81", "DSO_Stacked_33_M 81_20.0s_20260311_213509.fit")
'./DSO_Stacked_33_M 81_20.0s_20260311_213509.fit'
seestarpy.data.download_folder(folder='', dest='')

Download an entire observation folder from the Seestar’s eMMC via SMB.

Copies every file from the given folder under MyWorks to a local directory. Progress is printed to stdout as each file completes.

Parameters:
  • folder (str) – Name of the folder under MyWorks to download (e.g. "M 81_sub").

  • dest (str) – Local directory where the folder will be saved. Created automatically if it does not exist.

Return type:

None

Examples

>>> from seestarpy import data
>>> data.download_folder("M 81_sub", dest="/home/user/astro")
Downloading 37 files from 'M 81_sub' (150.0 MB)...
  [1/37] Light_M 81_10.0s_IRCUT_20250607-221746.fit (4.05 MB) OK
  ...
OK Download complete: 37 files
seestarpy.data.list_folder_contents(folder, filetype='*')

List every file inside an observation folder on the Seestar’s eMMC.

Uses the paginated JSON-RPC file listing API (port 4700), which is significantly faster than the previous SMB-based approach.

Parameters:
  • folder (str) – Name of the folder under MyWorks to list (e.g. "M 81_sub").

  • filetype (str, optional) –

    Filter files by type. One of:

    • "*" — all files (default)

    • "fit" — FITS files only (.fit)

    • "jpg" — full-size JPEGs only (excludes thumbnails)

    • "thn.jpg" — thumbnail JPEGs only (_thn.jpg)

    • "*jpg" — all JPEGs (full-size and thumbnails)

Returns:

dict of {str – Mapping of file names to their sizes in bytes.

Return type:

int}

Examples

>>> from seestarpy import data
>>> files = data.list_folder_contents("M 81_sub", filetype="fit")
>>> for name, size in list(files.items())[:3]:
...     print(f"{name}: {size / 1024:.0f} KB")
Light_M 81_10.0s_IRCUT_20250607-221746.fit: 4050 KB
Light_M 81_10.0s_IRCUT_20250607-221758.fit: 4050 KB
Light_M 81_10.0s_IRCUT_20250607-221810.fit: 4050 KB
seestarpy.data.list_folders()

List all observation folders stored on the Seestar’s internal eMMC.

Each observation session creates a folder under MyWorks (e.g. "M 81", "Lunar"). This function returns every folder together with the number of album entries it contains (i.e. stacked results, not individual files). Use list_folder_contents() to get the actual file listing.

Returns:

dict of {str – Mapping of folder names to the number of album entries they contain.

Return type:

int}

Examples

>>> from seestarpy import data
>>> data.list_folders()
{'M 81': 1, 'M 81_sub': 2053, 'Lunar': 2}