core.media
==========

.. py:module:: core.media

.. autoapi-nested-parse::

   Manages media files and their associated metadata, supporting storage,
   nested media retrieval, and type validation.





Module Contents
---------------

.. py:class:: Media

   Represents a media file with associated properties and storage details.

   Attributes:
   - filename: The file path of the media.
   - key: An optional identifier for the media.
   - urls: A list of URLs where the media is stored or accessible.
   - properties: Additional metadata or transformations for the media.
   - _mimetype: The media's mimetype (e.g., image/jpeg, video/mp4).


   .. py:attribute:: filename
      :type:  str


   .. py:attribute:: key
      :type:  str
      :value: None



   .. py:attribute:: urls
      :type:  List[str]
      :value: []



   .. py:attribute:: properties
      :type:  dict


   .. py:method:: store(metadata: Any, url: str = 'url-not-available', storages: List[Any] = None) -> None


   .. py:method:: all_inner_media(include_self=False)

      Retrieves all media, including nested media within properties or transformations on original media.
      This function returns a generator for all the inner media.




   .. py:method:: is_stored(in_storage) -> bool


   .. py:method:: set(key: str, value: Any) -> Media


   .. py:method:: get(key: str, default: Any = None) -> Any


   .. py:method:: add_url(url: str) -> None


   .. py:property:: mimetype
      :type: str



   .. py:method:: is_video() -> bool


   .. py:method:: is_audio() -> bool


   .. py:method:: is_image() -> bool


   .. py:method:: is_valid_video() -> bool


