Creating an Index

To create an index, run:

moonshine.create('your-index-name')

Uploading to an Index

To upload a file, specify both its source location and the destination index.

Moonshine will automatically assign unique file IDs in the index to prevent naming conflicts. We recommend saving the unique fileIDs as they are essential for making queries.

def progress_callback(progress: float):
  print(progress)

fileid = await moonshine.upload("./your-video-name.mp4", "your-index-name", progress_callback)
# fileid = "FHXYU838JHDWK.mp4"

After uploading, videos can take several minutes to complete indexing and become searchable.

Remote Uploads

Files can also be uploaded from remote sources. To do this, insert the link to the remote file in place of the path:

def progress_callback(progress: float):
  print(progress)

file_id = await moonshine.upload("https://example.com/test.mp4", "your-index-name", progress_callback)

Note that your files need to be publically accessible. If you need a secure cloud to cloud integration, reach out to us at team@usemoonshine.com.

Supported Filetypes

file typetype
.mp4video
.movvideo
.webmvideo

Need more file type support? Let us know at team@usemoonshine.com