Skip to main content

python-psn

Pure Python parsing library for PSN V2 - PosiStageNet

Official PSN specification

Source code

PyPi page

Pytest

Check links in markdown

Installation

pip install pypsn

To install latest master from git via pip:

python -m pip install https://codeload.github.com/open-stage/python-psn/zip/refs/heads/master

Usage

import pypsn

# define a callback function
def callback_function(data):
    if isinstance(data, pypsn_module.psn_data_packet): # packet type: psn.psn_data_packet
        for tracker in data.trackers: # loop through all trackers
            print(tracker.pos) # print the received coordinates

    if isinstance(data, pypsn_module.psn_info_packet): # packet type: psn.psn_info_packet
        print(data.name) # print server name
        for tracker in data.trackers: # loop through all trackers
            print(tracker.tracker_name) # print the received tracker name

# provide a callback function and an IP address
receiver = pypsn.receiver(callback_function)
receiver.start()  # start the receiving thread

receiver.stop() # stop receiving

See examples folder for some more examples.

Development, status

  • Supporting PSN V2
  • Parsing only, not sending
  • Using threading module
  • Linux, Windows and macOS tested
  • Typed, no-strict
  • Initial pytest testing provided together with CI/CD setup

Type hints

  • At this point, the --no-strict-optional is needed for mypy tests to pass:
mypy pypsn/*py  --pretty  --no-strict-optional

Format

Testing

  • to test, use pytest
  • to test typing with mypy use
pytest --mypy -m mypy pypsn/*py

Metadata

Release files for pypsn 0.2.3

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

Built distribution (wheel)

Table of built distributions (wheels) for pypsn 0.2.3
File Interpreter ABI Platform
pypsn-0.2.3-py3-none-any.whl Python 3 none any Details

Release files / pypsn-0.2.3-py3-none-any.whl

Download URL pypsn-0.2.3-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b57fc1bdb65af90d1269f646816c252ca82b10cfc232288f7fe1f465ab492d60
BLAKE2b-256 checksum
How to use checksums
58aeb9bd4fc13a9144825d40e62f191a99848f581ca759d0c2929f2f114e430f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.2.3 This release

1 release file

0.2.1

2 release files

0.2

2 release files

0.1.1

2 release files

0.1.0

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