Skip to main content

An asynchronous Python implementation of the Android Quick Share (Nearby Share) protocol

Project description

pyquickshare

Ruff logo GitHub Actions Workflow Status GitHub Actions Workflow Status Coveralls

An asynchronous Python implementation of the Android Quick Share (Nearby Share) protocol

System requirements

pyquickshare has following expectations from the system:

  • some mDNS implementation (avahi, systemd-resolved, etc.)
  • Bluetooth stack using BlueZ reachable via D-Bus

As these are de-facto standards on Linux, pyquickshare should work on most Linux distributions.

Firewalls

As Quick Share uses a direct connection between devices, it is necessary to allow incoming connections on the advertised port. firewalld is supported out of the box (but not required).

pyquickshare temporarily reconfigures firewalld (if available) to accept an incoming connection on it's advertised port. This is done by adding a temporary rule to the currently "active" zone. This rule is automatically removed by firewalld after 5 minutes.

Communication with firewalld is done over D-Bus, polkit may prompt for authentication.

Installation

pip install git+https://github.com/teaishealthy/pyquickshare

Features

Receive is fully implemented, namely WiFi credentials, files, and text. Sending only supports files, but support for sending text and WiFi credentials is planned.

Transfer

Only LAN/Wifi is supported at the moment, but Bluetooth is planned.

Discovery

pyquickshare uses mDNS to discover other devices on the local network. BLE is only used to trigger advertisment at the moment.

Usage

example.py is a basic example of how to use pyquickshare. It provides a command line interface to send and receive files using Quick Share:

uv run example.py receive
uv run example.py send <file>

Notes and Acknowledgements

  • The code in pyquickshare/protos is generated from protobuf sources licensed under Apache 2.0. As a derivative work, these generated files remain under the original Apache 2.0 license. A copy of the original license can be found in the pyquickshare/protos directory.

  • This project would not have been possible without the amazing reverse engineering work done by grishka on the Quick Share protocol. Check out NearDrop, a similar project for Mac OS.

  • WiFi-Direct: While according to Google's Nearby documentation and the protobuf fields WiFi-Direct is supposed to be an available medium, it seems that Quick Share does not use it. It more likely uses WiFi-Aware which isn't widely supported outside of Android devices.

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

pyquickshare-0.1.0.tar.gz (92.6 kB view details)

Uploaded Source

Built Distribution

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

pyquickshare-0.1.0-py3-none-any.whl (71.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyquickshare-0.1.0.tar.gz
  • Upload date:
  • Size: 92.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for pyquickshare-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bcc909bbaad9be109b9db63f6c1f9dcc86f943cff7b7ccba7b7211c09b69f8ff
MD5 1dfb296368b857e70cd3dcff05752db7
BLAKE2b-256 34309483c5406b026fa95003f92e4951916ac9679a627394369d4ad2989477a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyquickshare-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9262da753ddc2e1527225533620a336f040cd8425e366e8783cfe307213d65f9
MD5 fd5fe5e043398a21fb9454ba204a86bb
BLAKE2b-256 fce2fd635a512fe45c251519fe0cbfddbbed4b926bce8085db7e1f6ffabfe162

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