Metadata-Version: 2.4
Name: xy2pct
Version: 0.2.1
Summary: Convert track coordinates to percentages along a lap
Author-email: jusaaatin <jusaaatin@gmail.com>
License: MIT License
        
        Copyright (c) 2026 JUSAAATIN
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Keywords: xy2pct,f1,percentages,coordinates,track,lap,data,analysis
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: matplotlib
Dynamic: license-file

# xy2pct
A tool that pinpoints the percentage along a predetermined track of given coordinates.

## Installation

To install the Python package, run:

```
pip install xy2pct
```

## Workflow

### Create track map 
1. use the `src/xy2pct/expy` folder for generated track files
2. use [generatelaparray.py](https://github.com/jusaaatin/f1-xy2pct/blob/main/generatelaparray.py) to spit out a file with x, y, and z coordinates for the track. The data will appear in `src/xy2pct/expy/(circuit_short_name).txt`.
3. manually delete extra data points and assign relevant ones to pit lane by moving them under "Pit Lane:"
4. use [parselaparray.py](https://github.com/jusaaatin/f1-xy2pct/blob/main/parselaparray.py) to check work (sample code to also go from file to array)


### Use xy2pct
```
def xy2pct(x, y, z, circuit_short_name) -> [onTrack, percentage]
```
1. use the function xy2pct(x, y, z, circuit_short_name) to convert any x, y, and z(optional) to a percentage along the track you specify in circuit_short_name. to find the variable, use the openf1 docs: https://api.openf1.org/v1/meetings?year=2026&country_name=Singapore and replace the country name with the one you want, and then find the name beside `circuit_short_name`.
