An unofficial, synchronous Python client for the LocalSend v2 protocol.
Find a file
brennoflavio b1603825d4
All checks were successful
Type check / mypy (push) Successful in 1m27s
Publish documentation image / publish (push) Successful in 2m41s
expose method to refresh devices
2026-07-24 16:46:08 -03:00
.forgejo/workflows Documentation 2026-07-22 22:21:55 -03:00
.pi/prompts Document robustness issues 2026-07-22 01:04:05 -03:00
docs expose method to refresh devices 2026-07-24 16:46:08 -03:00
examples expose method to refresh devices 2026-07-24 16:46:08 -03:00
plan Add protocol test harness + plan to implement the procotol in python 2026-07-21 02:33:40 -03:00
protocol@4ee5748d49 Initial project structure 2026-07-21 01:38:17 -03:00
robustness Documentation 2026-07-22 22:21:55 -03:00
scripts Prepare project to be released 2026-07-22 01:31:03 -03:00
src/localsend expose method to refresh devices 2026-07-24 16:46:08 -03:00
tests expose method to refresh devices 2026-07-24 16:46:08 -03:00
.dockerignore Documentation 2026-07-22 22:21:55 -03:00
.gitignore Initial project structure 2026-07-21 01:38:17 -03:00
.gitmodules Initial project structure 2026-07-21 01:38:17 -03:00
.pre-commit-config.yaml Add pytest to pre commit 2026-07-22 01:14:11 -03:00
.python-version Lower python requeriments 2026-07-22 01:13:05 -03:00
AGENTS.md Implement QA 02, fix HTTPS connection 2026-07-21 17:02:07 -03:00
Justfile Add protocol test harness + plan to implement the procotol in python 2026-07-21 02:33:40 -03:00
LICENSE Initial project structure 2026-07-21 01:38:17 -03:00
main.py Initial project structure 2026-07-21 01:38:17 -03:00
pyproject.toml Documentation 2026-07-22 22:21:55 -03:00
README.md Update readme 2026-07-23 00:20:49 -03:00
typing_policy.py Initial project structure 2026-07-21 01:38:17 -03:00
uv.lock Documentation 2026-07-22 22:21:55 -03:00

LocalSend Python

An unofficial, synchronous Python client for the LocalSend v2 protocol.

Install

From PyPI:

uv add localsend-python

To test a local build in another project, build this repository and add its wheel:

./scripts/build.sh
cd /path/to/another-project
uv add /path/to/localsend-python/dist/*.whl

The dist/ directory contains both the universal wheel and source distribution.

Logging

The library emits standard-library logging records under the localsend namespace and does not configure application logging. Configure that logger in your application as needed:

import logging

logging.basicConfig(level=logging.INFO)
logging.getLogger("localsend").setLevel(logging.DEBUG)

Releases

Run the Release Forgejo workflow from master. It derives a tag from the project version, such as v0.1.0, then tests, builds, tags, and attaches both distributions to the Forgejo release. It refuses to run if that tag already exists. Select Publish the built artifacts to PyPI to also publish them; that option requires a repository secret named PYPI_API_TOKEN containing a PyPI API token.

Development

An AI Assisted implementation of the Localsend Protocol following a test first approach:

  • Add project strong typing configuration and agent instructions
  • Create a test harness out of Localsend protocol
  • Create a step by step plan to implement the harness into a internal syncronous function implementation
  • Implement plan step by step, testing against the harness, aiming to get a internal foundation for the public API
  • Implement a v0 of the public API
  • Implement a QA harness examples that allow testing the protocol in pratice, against a real device
  • Fix all issues found during manual QA and implement missing pieces of the protocol
  • Apply ruff / file breakdown, and adjust python requeriments, for better separation of concerns and make it easier to read
  • Do a comparisson against official localsend app, find gaps, and document problems in ./robustness
  • Prepare project to be released in pypi
  • Fix all ./robustness issues, generate a QA checklist for ./robustness
  • Add documentation
  • Retest all examples, with small and large files