Metadata-Version: 2.4
Name: python-cpdlc
Version: 1.0.1
Summary: A simple CPDLC client
Author-email: Half_nothing <Half_nothing@163.com>
License: GPL-3.0-or-later
Keywords: CPDLC,python,requests
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: Chinese (Simplified)
Classifier: Natural Language :: English
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools>=80.9.0
Requires-Dist: loguru>=0.7.3
Requires-Dist: requests>=2.32.4
Requires-Dist: beautifulsoup4>=4.13.4
Requires-Dist: lxml>=5.4.0
Dynamic: license-file

# python-cpdlc
A simple CPDLC client for flight simulation written by python

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

from python_cpdlc import CPDLC, Network

async def main():
    # Create CPDLC client with your email and hoppie code
    # Please dont use mine :(
    cpdlc = CPDLC("halfnothingno@gmail.com", "9BWovZBXLUy21m")
    # of course, you can use your own hoppie server
    # cpdlc = CPDLC("halfnothingno@gmail.com", "9BWovZBXLUy21m", "http://www.hoppie.nl/acars/system")
    
    # Set your callsign first, 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")
    
    # You can change your network if necessary
    # You can got your current network by cpdlc.network
    cpdlc.change_network(Network.VATSIM)
    
    # Start poll thread for message reveiver
    # If you dont call this function you cant receive message
    await cpdlc.start_poller()
    
    # send login request
    cpdlc.cpdlc_login("ZSHA")
    # you can also send some other thing like DCL or just some message to someone
    
    # wait 60 seconds
    await asyncio.sleep(60)
    
    # request logout
    cpdlc.cpdlc_logout()

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