Skip to main content

Work-in-progress Tailscale library written in Rust.

Project description

ts_python

Python bindings for tailscale-rs.

At the moment, this exposes facilities for connecting to a tailnet and binding network sockets that have access to the tailnet.

Code Sample

import asyncio
import tailscale


async def main():
    # connect to the tailnet:
    dev = await tailscale.connect('tsrs_keys.json', "tskey-auth-$MY_AUTH_KEY")

    # bind a udp socket on this node's ipv4 address:
    tailnet_ipv4 = await dev.ipv4_addr()
    udp_sock = await dev.udp_bind((tailnet_ipv4, 1234))
    print(f'udp bound, local endpoint: {udp_sock.local_addr()}')

    # send a message to a peer once per second
    while True:
        await udp_sock.sendto(('1.2.3.4', 5678), msg=b"HELLO")
        print("sent message to peer")
        await asyncio.sleep(1)


if __name__ == "__main__":
    asyncio.run(main())

To run this demo:

$ TS_RS_EXPERIMENT=this_is_unstable_software python demo.py

Building and Usage

The easiest way to get the library is through pypi:

$ pip install tailscale

In development

If you want to use the module from within this repo, you'll need to build it. The best way to do that is with maturin:

# In the project where you want to use the tailscale bindings:
$ python -m virtualenv .venv
$ . .venv/bin/activate
$ pip install maturin

# Then in tailscale-rs:
$ cd ~/tailscale-rs/ts_python # use your path to a local clone of tailscale-rs
$ maturin develop             # build and install python bindings into your virtualenv

$ python -c 'import tailscale' && echo "ready!" # bindings are available!

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

tailscale_py-0.3.3-cp312-abi3-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.12+Windows x86-64

tailscale_py-0.3.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

tailscale_py-0.3.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.6 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

tailscale_py-0.3.3-cp312-abi3-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

Details for the file tailscale_py-0.3.3-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: tailscale_py-0.3.3-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tailscale_py-0.3.3-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bb06b6a9ab8ad67b3ecdc701ba63354b1079f0c6b7bf2febcf93061e6a4ca75a
MD5 48417648bbbcb776944378ef03dba162
BLAKE2b-256 50b9b8517cdd6de04fdce7bde812cd36b765a9b379e81c3ae5c75af63535421d

See more details on using hashes here.

File details

Details for the file tailscale_py-0.3.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: tailscale_py-0.3.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.12+, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tailscale_py-0.3.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba6988d60d7df9b61adaf24fef51a15f5e7fc651059ba7e0eb9df9a909e8f6bf
MD5 f80f8b49c99afacfc591e70859f2e90e
BLAKE2b-256 cdc8361e243737180124d9ad4eef7fd4ac00308f83619c3446fcfdbb9258210d

See more details on using hashes here.

File details

Details for the file tailscale_py-0.3.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: tailscale_py-0.3.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.12+, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tailscale_py-0.3.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 00e325beb11c791980cb4bd8d44cc290161f9ff8990d2932dde8c2f75a31a215
MD5 4d2eff173a4151e7a103dd108e80b73c
BLAKE2b-256 e3f4e850882e2836262813325c2d200d399fe092a7c2e1084646156bf94e3a5a

See more details on using hashes here.

File details

Details for the file tailscale_py-0.3.3-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: tailscale_py-0.3.3-cp312-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.12+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tailscale_py-0.3.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e53b89f924b5783fa0b1cd9160c25232704dcc7dbd5e31041d92e6b2a8f4634
MD5 92a4e9f406ea941e137dffd5e552eb24
BLAKE2b-256 d3727c38b9d7eebacce15abce96116bd301a667ae627ba3e3b81059b0af36855

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