:py:mod:`imessagedb` ==================== .. py:module:: imessagedb .. autoapi-nested-parse:: Provides access to the iMessage chat.db, including parsing and output Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 __main__/index.rst attachment/index.rst attachments/index.rst chat/index.rst chats/index.rst db/index.rst generate_html/index.rst generate_text/index.rst handle/index.rst handles/index.rst message/index.rst messages/index.rst utils/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: imessagedb.DB Functions ~~~~~~~~~ .. autoapisummary:: imessagedb.convert_to_database_date imessagedb.convert_from_database_date imessagedb.safe_filename imessagedb._create_default_configuration imessagedb._get_contacts imessagedb.run Attributes ~~~~~~~~~~ .. autoapisummary:: imessagedb.__version__ imessagedb.mac_epoch_start imessagedb.DEFAULT_CONFIGURATION .. py:data:: __version__ .. py:class:: DB(database_name=None, config=None) A class to connect to an iMessage database .. py:property:: connection :type: sqlite3.Cursor Returns a connection to query the database .. py:property:: handles :type: imessagedb.handles.Handles Returns an imessagedb.Handles class with all the handles .. py:property:: chats :type: imessagedb.chats.Chats Returns an imessagedb.Chats class with all the chats .. py:property:: attachment_list :type: imessagedb.attachments.Attachments Returns an imessagedb.Attachments class with all the attachments .. py:property:: config :type: configparser.ConfigParser Returns the configuration object .. py:property:: control Returns a shortcut to the CONTROL section of the configuration .. py:method:: Messages(query_type: str, title: str, numbers: list = None, chat_id: str = None) -> imessagedb.messages.Messages A wrapper to create a Messages class .. py:method:: HTMLOutput(me: str, message_list: imessagedb.messages.Messages, inline=False, output_file=None) -> imessagedb.generate_html.HTMLOutput A wrapper to create an HTMLOutput class .. py:method:: TextOutput(me: str, message_list: imessagedb.messages.Messages, output_file=None) -> imessagedb.generate_text.TextOutput A wrapper to create a TextOutput class .. py:method:: disconnect() -> None Disconnects from the database .. py:data:: mac_epoch_start .. py:function:: convert_to_database_date(date_string: str) -> float .. py:function:: convert_from_database_date(date_value: float) -> datetime.datetime .. py:function:: safe_filename(filename: str) -> str .. py:data:: DEFAULT_CONFIGURATION :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ [CONTROL] # Whether or not to copy the attachments into a different directory. This is needed for two reasons: # 1) The web browser does not have access to the directory that the attachments are stored, so it cannot display them # 2) Some of the attachments need to be converted in order to be viewed in the browser copy = True # The directory to put the output. The html file will go in {copy_directory}/{Person}.html, # and the attachments will go in {copy_directory}/{Person}_Attachments. If you specify HOME, then # it will put it in your home directory copy directory = HOME # If the file already exists in the destination directory it is not recopied, but that can be overridden by # specifying 'force copy' as true force copy = False # 'Skip attachments' ignores attachments skip attachments = False # Additional details show some other information on each message, including the chat id and any edits that have # been done additional details = False # Some extra verbosity if true verbose = True [DISPLAY] # Output type, either html or text output type = html # Number of messages in each html file. If this is 0 or not specified, it will be one large file. # There may be more messages than this per file, as it splits at the next date change after that number # of messages. split output = 1000 # Inline attachments mean that the images are in the HTML instead of loaded when hovered over inline attachments = False # Popup location is where the attachment popup window shows up, and is either 'upper right', 'upper left' or 'floating' popup location = upper right # 'me' is the name to put for your text messages me = Me # The color for the name in text output. No color is used if 'use text color' is false. # The color can only be one of the following options: # black, red, green, yellow, blue, magenta, cyan, white, light_grey, dark_grey, # light_red, light_green, light_yellow, light_blue, light_magenta, light_cyan # The way that the color selection works is that it will use the first color on the color list for the first person # in the conversation, the second for the second, third for the third, etc. If there are more participants than colors, # it will wrap around to the first color. use text color = True text color list = red, green, yellow, blue, magenta, cyan reply text color = light_grey # The background and name color of the messages in html output # The options for colors can be found here: https://www.w3schools.com/cssref/css_colors.php # The way that the color selection works is that it will use the first color on the color list for the first person # in the conversation, the second for the second, third for the third, etc. If there are more participants than colors, # it will wrap around to the first color. html background color list = AliceBlue, Cyan, Gold, Lavender, LightGreen, PeachPuff, Wheat html name color list = Blue, DarkCyan, DarkGoldenRod, Purple, DarkGreen, Orange, Sienna # The background color of the thread in replies thread background = HoneyDew [CONTACTS] # A person that you text with can have multiple numbers, and you may not always want to specify the full specific # number as stored in the handle database, so you can do the mapping here, providing the name of a person, # and a comma separated list of numbers Samantha: +18434676040, samanthasmilt@gmail.com, s12ddd2@colt.edu Abe: +16103499696 Marissa: +14029490739 """ .. raw:: html
.. py:function:: _create_default_configuration(filename: str) -> None Generates a default configuration if one is not passed in .. py:function:: _get_contacts(configuration: configparser.ConfigParser) -> dict .. py:function:: run() -> None Run the imessagedb command line