Metadata-Version: 2.1
Name: civstation
Version: 0.1.2
Summary: Support for stationing used in civil plans
Author-email: Scott Windsor <windsorwindsor2@protonmail.com>
License: MIT License
        
        Copyright (c) 2024 Scott Windsor
        
        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.
Project-URL: Homepage, https://github.com/windsorwindsor2/civstation
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.txt

# civstation

## Overview
Provides a Station object, which represents a Station of the kind found in civil plans of roads and other linear features, where 5+10 for example represents a point 510 feet (or meters or any units) from an arbitrary starting point.

## Station objects
Import the Station class:
```python
from civstation import Station
```
Create a station object:
```python
sta = Station("4+56.78")
```

Stations can also be made from a number, which will convert it to a Station.
```python
>>>sta = Station(456.78)
>>>print (sta)
4+56.78
```

Stations can also be made from a Station, for ease of implentation.

Stations default to displaying two decimal places with trailing zeros. This can be changed by setting decimal_places to the desired number.

```python
>>>sta = Station(456.78, decimal_places = 4)
>>>print(sta)
4+56.7800
```


## Operations
Stations can be added, subtracted, and compared. 

Adding a station and a number (float, int, etc.) returns a Station. 

Subtracting a number from a station returns a Station.

Subtracting a a Station from a Station returns a **float**. This is because stations represent a position along a line. Subtracting two stations produces a *distance* not a *position*, best represented as a float, not a Station. However, this behavior can be overridden by setting `return_float_on_sub = False`, to work completely in Stations.

There doesn't appear to be a good reason to multiply or divide Stations, so it is not supported. If this is necessary, convert them to floats or another suitable type.  

## Definition of Station object
The following code shows the args taken by a Station object.
```python
class Station:
    def __init__(self, sta, decimal_places = 2, return_float_on_sub = True) -> None:
```

