Skip to main content

A pure Python library for encoding, decoding and compressing Asterix CAT240 messages.

Project description

Python 3.10 PyPI Documentation Test coverage Unit tests Ruff

[Documentation 📚]

Pycatzao

Pycatzao is a pure Python library for encoding, decoding and compressing Asterix CAT240 messages.

📚 Usage & Documentation

Pycatzao releases are available as wheel packages for macOS, Windows and Linux on PyPI. Install it using pip:

$ pip install pycatzao

If you prefer installing this library from source, run:

# optional
$ pip install -r requirements.txt
$ pip install -e .

After installing, simply import pycatzao and start fooling around with its API:

import pycatzao

print("Version:", pycatzao.__version__)

for block in pycatzao.decode_file("my-cat240-data.bin"):
    process_cat240_block(
        range=block["r"],
        azimuth=block["az"],
        amplitude=block["amp"],
        ...
    )  # do something meaningful with the data

See examples/cat240toHDF5.py for a more elaborated example or our documentation for a full list of available functions. Note, however, that you won't find an introduction into Asterix CAT240 here since we assume that you know the basics of the standard. If you need such an introduction though, simply search for Asterix CAT240 with a search engine of your choice or directly consult https://www.eurocontrol.int/asterix.

🎯 Goals

The purpose of this project is to have a slim and Python-only library with almost no dependencies. We don't plan to add support for other Asterix formats and there are certainly other libraries out there than can parse Asterix CAT240 faster than Pycatzao. However, does this mean that Pycatzao is slow? Certainly not! Pycatzao can easily parse data faster than real-time. On a decently equipped laptop one hour of compressed data is decoded in less than 100 seconds; this is more than 60k message per second... fast enough for most applications.

👷 Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to submit a pull request.

Development Setup

To set up your development environment, follow these steps:

  1. Clone the repository:

    $ git clone git@github.com:DLR-KN/pycatzao.git
    
  2. Change to the project directory:

    $ cd pycatzao
    
  3. Install the development dependencies using pip:

    $ pip install -e .[dev]
    

Pre-Commit-Hooks

To maintain code quality and avoid pushing invalid commits, we recommend using pre-commit hooks. These hooks perform automated checks before commits are made. To set up pre-commit hooks, follow these steps:

  1. Install the pre-commit package (if not already installed):

    $ pip install pre-commit
    
  2. Install the hooks:

    $ pre-commit install
    

Now, each time you commit changes, the pre-commit hooks will run checks such as formatting, linting, and more. If any issues are found, they will be flagged before the commit is made.

Running Tests

You can run tests using the following command:

$ pytest --cov=pycatzao

Make sure to run tests before submitting a pull request to ensure that everything is functioning as expected.

Generate documentation (optional)

If you like, you can generate the documentation locally by navigating to the docs/ folder and running:

$ cd docs && make html
[...]
The HTML pages are in build/html.

This will generate an HTML documentation under docs/build/html/. Open the generated index.html with a browser and start reading🤓

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

pycatzao-1.2.3.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

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

pycatzao-1.2.3-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file pycatzao-1.2.3.tar.gz.

File metadata

  • Download URL: pycatzao-1.2.3.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for pycatzao-1.2.3.tar.gz
Algorithm Hash digest
SHA256 6cef7eaba8f4bc52155e77f348cec9d5c4c3674d1ce434d420b1f8ea36ddcfdb
MD5 f21278cf3c615615768703c760dd1f96
BLAKE2b-256 b4fc3ac86dc01fd4a592331fa4b2fb4cc09ef3223444808c2a027486b5725e2a

See more details on using hashes here.

File details

Details for the file pycatzao-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: pycatzao-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for pycatzao-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7954e2f399a21ab2c481cd27bdb135bab706aa9a3df578221a74af0a0e0cdf8b
MD5 643cc843fd0824c13858cd22b4b811e0
BLAKE2b-256 20f53442b9515d29f1f0e7aac0b0c1beb5bbc6d06ea385834bb6e588382f9404

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