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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tailscale_py-0.3.1-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: tailscale_py-0.3.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a11934ec8f52bd464017c69e0230292ef0afab0912b830a5ad6cdeff3b4fdb47
|
|
| MD5 |
e070d033693de6d97cabe2140ff83e37
|
|
| BLAKE2b-256 |
95e7d44f36cbdcc81a9ca1c88e0ed6c55119f61e79273f194d847a71a14433f1
|
File details
Details for the file tailscale_py-0.3.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: tailscale_py-0.3.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0ccaf6faa2f07db99b0b84f9a01f94258fe88b029b78f65aae4630912ed6590
|
|
| MD5 |
ba0553bf01b99a51b544ff11a9a146ec
|
|
| BLAKE2b-256 |
803333008ae4206a54ab2b06b24144a5cd8f89fb4cf34307b7fdeb625a8f90e9
|
File details
Details for the file tailscale_py-0.3.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: tailscale_py-0.3.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 3.5 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73b31f1bc717a9db0e8f51aff6885d2827b80f2a6cc7b5442e6938c3e5e624da
|
|
| MD5 |
98e585253e461edeaecd3a227caa36c9
|
|
| BLAKE2b-256 |
5618c315329026195e47c6e68182893be6f7ef072bdfef402395240dda8b2f88
|
File details
Details for the file tailscale_py-0.3.1-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: tailscale_py-0.3.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae6fac97521dd078f96dbfc5359e7e77651b3d345243b0389931b4996f8aa6f3
|
|
| MD5 |
34573c0b3f4180a44c38340d4693f77e
|
|
| BLAKE2b-256 |
dc53cbdb340226b23bacec0adcacafb06220a197fab4c97e4aecb22e0a010554
|