Skip to main content

python-cpdlc

A simple CPDLC client for flight simulation written by python

Quick Start

  1. install package with pip or any tools you like
pip install python-cpdlc
  1. use example code under
    By the way, dont forgot to logon your ATC CPDLC first :)
import asyncio

from python_cpdlc import CPDLC


async def main():
    # Create CPDLC client instance
    cpdlc = CPDLC()

    # Set your hoppie code
    cpdlc.set_logon_code("11111111111")

    # Set your email for network change (If you dont need to change network, you can skip it)
    cpdlc.set_email("halfnothingno@gmail.com")

    # of course, you can use your own hoppie server
    # cpdlc.set_acars_url("http://127.0.0.1:80")

    # you can add callback function which will be called when cpdlc connected and disconnected
    # there can only be one callback function per event
    # cpdlc.set_cpdlc_connect_callback(lambda: None)
    # cpdlc.set_cpdlc_disconnect_callback(lambda: None)
    # cpdlc.set_cpdlc_atc_info_update_callback(lambda: None)

    # you also can add message callback
    # cpdlc.add_message_sender_callback()
    # cpdlc.add_message_receiver_callback()

    # Decorators are recommended unless your callback function is a class method
    # @cpdlc.listen_message_receiver()
    # def message_receiver(msg: AcarsMessage):
    #     pass
    # @cpdlc.listen_message_sender()
    # def message_sender(to: str, msg: str):
    #     pass

    # you should set your callsign before you use CPDLC, and you can change this anytime you like
    # but if you change this callsign, you may miss some message send to you
    cpdlc.set_callsign("CES2352")

    # after set complete, you need to initialize service
    cpdlc.initialize_service()

    # you can reset service or reinitialize service anytime you like
    # cpdlc.reset_service()
    # cpdlc.reinitialize_service()

    # you can get your current network by cpdlc.network
    # you can change your network if necessary
    # cpdlc.change_network(Network.VATSIM)

    # some function...
    # cpdlc.query_info()
    # cpdlc.send_telex_message()
    # cpdlc.departure_clearance_delivery()

    # send login request
    cpdlc.cpdlc_login("ZSHA")

    # wait 60 seconds
    await asyncio.sleep(60)

    # request logout
    cpdlc.cpdlc_logout()


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

Release files for python-cpdlc 1.3.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-cpdlc 1.3.8
File Size Uploaded
python_cpdlc-1.3.8.tar.gz 29.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-cpdlc 1.3.8
File Interpreter ABI Platform
python_cpdlc-1.3.8-py3-none-any.whl Python 3 none any Details

Total release size: 64.5 kB

Release files / python_cpdlc-1.3.8.tar.gz

Download URL python_cpdlc-1.3.8.tar.gz
Size 29.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c09c37618c5ab872b49c3d5c40abff79a2f56cc630912f766da5b5f284959ec3
BLAKE2b-256 checksum
How to use checksums
16240af1fe37f6c50a9deabc72ac08d549e56cd1632617de453021812b92691b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.25.4 CPython/3.10.7 Windows/10

Release files / python_cpdlc-1.3.8-py3-none-any.whl

Download URL python_cpdlc-1.3.8-py3-none-any.whl
Size 35.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c1f3e5e81e91cee7827c15dd7e67a2cc5e4a4583256e079e32f05fb19a918ba
BLAKE2b-256 checksum
How to use checksums
daf31b91e8c64f8f30cdbe4272e6367aed87371484d3ce676f09017209c16d9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.25.4 CPython/3.10.7 Windows/10

Release history Release notifications | RSS feed

This release

1.3.8 This release

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page