Skip to main content

Python library for interacting with Pineapple Pager devices

Project description

Pineapple Pager Python API

A Python library for interacting with the Pineapple Pager device. It allows you to connect, monitor events, and manage payloads from your Pineapple device using Python.

Features

  • Connect to a Pineapple device
  • Send alerts via Pager API
  • List and manage payloads
  • Monitor events like deauth floods or handshake captures

Installation

  1. Clone the repository:
git clone https://github.com/tpollard64/pineapple-pager-python-api.git
cd pineapple-pager-python-api
  1. Install dependencies:
pip install -r requirements.txt

Setup

Store your Pineapple password in an environment variable for security:

export PINEAPPLE_PASSWORD="your_password_here"

On Windows PowerShell:

setx PINEAPPLE_PASSWORD "your_password_here"

Usage

import os
from pineapple.client import PineappleClient
from pineapple.pager import PagerAPI
from pineapple.payloads import PayloadManager

password = os.getenv("PINEAPPLE_PASSWORD")
if not password:
    raise ValueError("Environment variable PINEAPPLE_PASSWORD is not set")

client = PineappleClient(password=password)
client.connect()

pager = PagerAPI(client)
payloads = PayloadManager(client)

pager.alert(
    title="API Connected",
    message="Python API successfully connected to Pineapple Pager"
)

print(payloads.list_categories())
print(payloads.list_payloads("alerts"))

client.close()

Examples

Check the examples/ folder for more usage examples.

Contributing

Contributions are welcome. Open issues or submit pull requests.

Troubleshooting

  • Connection errors: Ensure the Pineapple device is reachable, SSH is enabled, and the correct port is used.
  • Environment variable not set: Make sure PINEAPPLE_PASSWORD is exported before running scripts.
  • Dependency issues: Run pip install -r requirements.txt from the project root.

License

MIT License

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

pineapple_pager_api-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

pineapple_pager_api-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file pineapple_pager_api-0.1.0.tar.gz.

File metadata

  • Download URL: pineapple_pager_api-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for pineapple_pager_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f320c16b4baa08b3bdc42de983d2d94a8c33ff1f2ea6c23cfe0f96790a6e72b0
MD5 9fca1101b5039f2e4ed9b10146cc0854
BLAKE2b-256 ad657bac57b0420784d85a74c57a69998051bf230830f4bdb9f847c4fafff193

See more details on using hashes here.

File details

Details for the file pineapple_pager_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pineapple_pager_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd389267e17c6c3e14e747ff6cb25936e5544fa1be770503b4ad3dbab37abf87
MD5 84f52efc24f2d3d28da4f7dec5e83931
BLAKE2b-256 359bdac3600096b034bff8d0b43cbb421aa4158d21ebf07a0d7175b2643b011d

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