Skip to main content

TRK-Loader-Python

Line Rider .trk format implemented in Python 3

Loading Tracks

from lrtools.trkformat import * # trk format
from lrtools.track import * # track and line objects
from lrtools.utils import * # utilities

To load a track name.trk:

track = load_trk("track.trk", "name")

Saving Tracks

from lrtools.trkformat import * # trk format
from lrtools.track import * # track and line objects
from lrtools.utils import * # utilities

To save a track as name.trk:

track = Track()
save_trk(track, "name.trk")

Track Structure

# assuming track is a Track object:
track.YGravity : int # Y gravity
track.XGravity : int # X gravity
track.GravityWellSize : int # Gravity well size
track.BGColorR : int
track.BGColorG : int
track.BGColorB : int
track.LineColorR : int
track.LineColorG : int
track.LineColorB : int
track.lines : List[Line]
track.Filename : str
track.Name : str
track.Remount : bool
track.ZeroStart : bool
track.frictionless : bool
track.ver : int (61 or 62)
track.StartOffset : Vector
track.Triggers : list
track.StartZoom : int
track.current_id : int
track.Triggers : list

Todo

  • Add prune() method to Track.Track to prune line IDs
  • write the rest of the docs on other parts line line triggers and the Line object
  • Add JSON support

Metadata

Release files for lrtools 1.0.3

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

Source distribution (sdist)

Source distribution for lrtools 1.0.3
File Size Uploaded
lrtools-1.0.3.tar.gz 8.4 kB Details

Built distribution (wheel)

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

Total release size: 17.1 kB

Release files / lrtools-1.0.3.tar.gz

Download URL lrtools-1.0.3.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9514f4ecd6765e1752273c2729925f3d31e5cb511c9e6b7967ebcf4fa2c4ff31
BLAKE2b-256 checksum
How to use checksums
025aa650417c92aeac19cc4b49c013392eb4fd1ea2c3eb757e209da3aa7f608d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

Release files / lrtools-1.0.3-py3-none-any.whl

Download URL lrtools-1.0.3-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0a038f8e22cd4e858bfc6d02d961221941ef8f2e27c56756f1d8d07716f4534
BLAKE2b-256 checksum
How to use checksums
3ceb902b904b1c9cf5e9fbb877a05023aaca95fe4401f57728f8ce3e8d5b233d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.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