Skip to main content

Discord Message Dredger

A quick and simple library to dredge through the Discord export package from the Request A Copy of Your Data option on Discord, since the internal file structure and just looking through it by hand is a bit of a pain.

Installation

python3 -m pip install discord-export-dredger

Usage

usage: dredger.py [-h] [-dm USERNAME] [-c CHANNEL SERVER] [-gc GROUP_CHAT] [-sl SAVE_LOCATION] package

positional arguments:
  package               the name or path path from current directory to the Discord data export package to fetch messages from

options:
  -h, --help            show this help message and exit
  -dm, --direct-message USERNAME
                        fetch your DM messages with the provided user in the package. Must use their true Discord username, not their display name.
  -c, --channel CHANNEL SERVER
                        fetch your messages in the specified channel from the specified server.
  -gc, --group-chat GROUP_CHAT
                        fetch your messages in a specified group chat
  -sl, --save-location SAVE_LOCATION
                        location to extract the files to. Current working directory if none provided

Python Library

class DiscordMessagesExport:
    """
    A representation and extactor for the saved messages in a Discord Request Your Own Data export package.
    """
    def __init__(self, data_package : str):
        """
        Create a new DiscordMessagesExport object with input Discord export package from the Discord Request Your Own Data function.
        
        :param self: this object
        :param data_package: str path to the Discord data export package
        :type data_package: str
        """

    def fetch_chat_with_name(self, name : str, save_path : str = "") -> str:
        """
        Fetch and extrat the chat with input name from the archive package and save it to save_path, 
        or the current working directory if none provided, and return the path to the message.json as a str
        
        :param self: this object
        :param name: name of chat to fetch
        :type name: str
        :param save_path: path to extract the chat to, or the current working directory if none provided
        :type save_path: str
        :return: string path to the messages.json file of the extracted chat
        :rtype: str
        """

    def get_Direct_Message(self, recipient_username : str, save_path : str = "") -> str:
        """
        Extract and return the path to the messages.json file of the Direct Message chat with the user with recipient_username.
        
        :param self: this object
        :param recipient_username: username of the other side of the direct message chat
        :type recipient_username: str
        :param save_path: path to extract the chat to, or the current working directory if none provided
        :type save_path: str
        :return: string path to the messages.json file of the extracted chat
        :rtype: str
        """

    def get_Channel(self, channel_name : str, server_name : str, save_path : str = "") -> str:
        """
        Extract and return the path to the messages.json file of the input channel chat in input server.
        
        :param self: this object
        :param channel_name: name of the channel in the server to fetch the message.json of
        :type channel_name: str
        :param server_name: the server that the input channel is in
        :type server_name: str
        :param save_path: path to extract the chat to, or the current working directory if none provided
        :type save_path: str
        :return: string path to the messages.json file of the extracted chat
        :rtype: str
        """

    def get_Group_Chat(self, group_chat_name : str, save_path : str = "") -> str:
        """
        Extract and return the path to the messages.json file of the group chat with input name.
        
        :param self: this object
        :param group_chat_name: name of group chat to fetch the message.json of
        :type group_chat_name: str
        :param save_path: path to extract the chat to, or the current working directory if none provided
        :type save_path: str
        :return: string path to the messages.json file of the extracted chat
        :rtype: str
        """

Note

If this was useful for you, let me know with a Star, Watch, or comment in Discussions on Github. It's just nice to know that someone out there got use out of my code since there's really no way to tell otherwise.

Changelog

V 1.0.0

  • Initial Release

Metadata

Release files for discord-export-dredger 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for discord-export-dredger 1.0.0
File Size Uploaded Provenance
discord_export_dredger-1.0.0.tar.gz 4.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for discord-export-dredger 1.0.0
File Interpreter ABI Platform
discord_export_dredger-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / discord_export_dredger-1.0.0.tar.gz

Download URL discord_export_dredger-1.0.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
30844d7bb7dd25b55ecfe8ad3e3c3bcfcad028d189f67dbc53d6fab23463669a
BLAKE2b-256 checksum
How to use checksums
e7db1e1388919aa98a4fc63cf96314248b36aa39f7d18c6275cf1ea682bf862b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / discord_export_dredger-1.0.0-py3-none-any.whl

Download URL discord_export_dredger-1.0.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09bf895afd5ae8509f2e2ab6e50bf34e13457ad2221d9d26468f6d137592f293
BLAKE2b-256 checksum
How to use checksums
76fa6507d01a957e7316e0d7dafeb5fbf6d011c6d663ba66ca38a5681b4150c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for discord-export-dredger 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page