Skip to main content

A Playwright-based WhatsApp client to interact with x-cortex.

Project description

x-whatsapp

x-whatsapp by x-cortex is a python library for automating WhatsApp interactions. It uses playwright to automate tasks such as sending messages, fetching chat history, and listening for new messages on WhatsApp Web.

Usage

Initializing the Client

from x_whatsapp import WhatsappClient

# Initialize the client with debugging enabled
client = WhatsappClient(DEBUG=True)
# Initialize Playwright and launch the browser
await client.initialize_playwright()
# Log in to WhatsApp
await client.login()

Sending a Message

await client.send_message("contact_name", "Hello from x-whatsapp!")

Fetching Chat History

await client.open_chat_panel("contact_name")
messages = await client.extract_messages()
for message in messages:
    print(message)

Logging Out

await client.logout()

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

x_whatsapp-0.1.2.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

x_whatsapp-0.1.2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file x_whatsapp-0.1.2.tar.gz.

File metadata

  • Download URL: x_whatsapp-0.1.2.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for x_whatsapp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ba765b6a94440efec5236be588bb052e69c0845500872baf3638f8d016624ead
MD5 ae8f051a30d9744b92629c788e49db80
BLAKE2b-256 6b3c29ca07daef69109d8b00f4b114082115f1e398da667f17c071898334183b

See more details on using hashes here.

File details

Details for the file x_whatsapp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: x_whatsapp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for x_whatsapp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4d99205476ebcce553d7831a03866254814241026b61704c7187d08205e4d154
MD5 54fc959a5f6b15b22ac5935edff42398
BLAKE2b-256 28d3eae90295e4a12bbde65c5a8129bdb094952089d081977c923f94efcabe36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page