Skip to main content

PyTAK is a Python package for rapid TAK integration.

Project description

PyTAK Logo

Python Team Awareness Kit (PyTAK)

PyTAK is a Python library and command-line TAK client for building small, usable TAK clients, servers, and gateways. It can be embedded in another application or used directly to send and receive Cursor on Target (CoT) data on TAK networks.

Install

python3 -m pip install pytak

Command-line example

Connect with a TAK onboarding URL directly from the CLI:

pytak "tak://com.atakmap.app/enroll?host=takserver.example.com&username=myuser&token=mytoken"

Generate onboarding data packages (PKCS#12, PEM, ATAK + iTAK ZIPs) without connecting:

pytak dp 'tak://com.atakmap.app/enroll?host=takserver.example.com&username=myuser&token=mytoken'

See Onboarding data packages in the docs.

Quick example

import asyncio, xml.etree.ElementTree as ET
from configparser import ConfigParser
import pytak

class MySender(pytak.QueueWorker):
    async def handle_data(self, data):
        await self.put_queue(data)
    async def run(self):
        while True:
            root = ET.Element("event", version="2.0", type="t-x-d-d",
                              uid="myMarker", how="m-g",
                              time=pytak.cot_time(), start=pytak.cot_time(),
                              stale=pytak.cot_time(3600))
            await self.handle_data(ET.tostring(root))
            await asyncio.sleep(20)

async def main():
    config = ConfigParser()
    config["mytool"] = {"COT_URL": "tcp://takserver.example.com:8087"}
    config = config["mytool"]
    clitool = pytak.CLITool(config)
    await clitool.setup()
    clitool.add_tasks(set([MySender(clitool.tx_queue, config)]))
    await clitool.run()

asyncio.run(main())

Features

  • TAK Protocol support: XML (TAK Protocol v0) and Protobuf (TAK Protocol v1, via takproto)
  • Multiple transports: TCP, TLS, UDP unicast, UDP multicast (Mesh SA), UDP broadcast, file, stdout, WebSockets
  • TLS client auth: PEM certs, PKCS#12 (.p12), password-protected keys
  • TAK enrollment: automatic certificate enrollment from a tak:// onboarding URL; pytak dp exports ATAK/iTAK connection packages
  • Marti REST API: send/receive CoT via TAK Server's HTTP API (marti:// URL scheme)
  • TAK Data Packages: import .zip pref packages containing server connection settings and certs
  • No required external deps: pure-Python asyncio core; optional extras for TLS enrollment and Protobuf

Documentation

Full documentation at pytak.rtfd.io including installation, configuration, examples, and troubleshooting.

License & Copyright

Copyright Sensors & Signals LLC https://www.snstac.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

asyncio_dgram is Copyright (c) 2019 Justin Bronder and is licensed under the MIT License, see pytak/asyncio_dgram/LICENSE for details.

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

pytak-7.4.1.tar.gz (104.8 kB view details)

Uploaded Source

Built Distribution

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

pytak-7.4.1-py3-none-any.whl (70.5 kB view details)

Uploaded Python 3

File details

Details for the file pytak-7.4.1.tar.gz.

File metadata

  • Download URL: pytak-7.4.1.tar.gz
  • Upload date:
  • Size: 104.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pytak-7.4.1.tar.gz
Algorithm Hash digest
SHA256 33a732b4d60a94749b0433030d294f111aa5cafce56329c893f116021bfb1c3f
MD5 6313c79f0529fb81b24876b9cc9a0a3e
BLAKE2b-256 2b001f7004973b349e6b49004a01407aefc1f69a6afad4c935767c674c31bbb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytak-7.4.1.tar.gz:

Publisher: ci.yml on snstac/pytak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytak-7.4.1-py3-none-any.whl.

File metadata

  • Download URL: pytak-7.4.1-py3-none-any.whl
  • Upload date:
  • Size: 70.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pytak-7.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f564b371d33fceb5afb6d65a678d51fa11fb829efc4ab422e2262cb717d4c63b
MD5 8cb07da0af0a2b46c7ab003ddde02c60
BLAKE2b-256 1e57eaa6711e717dd1d50643fd68c11bdfcf673f0b9efcabcdd73198bb0a33d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytak-7.4.1-py3-none-any.whl:

Publisher: ci.yml on snstac/pytak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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