| Name | civstation JSON |
| Version |
0.1.1
JSON |
| download |
| home_page | None |
| Summary | Support for stationing used in civil plans |
| upload_time | 2024-08-10 21:01:30 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.7 |
| 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. |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# 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 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:
```
Raw data
{
"_id": null,
"home_page": null,
"name": "civstation",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Scott Windsor <windsorwindsor2@protonmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c6/b3/98bf695c3ca5a776ab4c3c634b61a1b49cb7212f0ffb5b19f2d74872cd60/civstation-0.1.1.tar.gz",
"platform": null,
"description": "# civstation\r\n\r\n## Overview\r\nProvides 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.\r\n\r\n## Station objects\r\nImport the Station class:\r\n```python\r\nfrom civstation import Station\r\n```\r\nCreate a station object:\r\n```python\r\nsta = Station(\"4+56.78\")\r\n```\r\n\r\nStations can also be made from a number, which will convert it to a Station.\r\n```python\r\n>>>sta = Station(456.78)\r\n>>>print (sta)\r\n4+56.78\r\n```\r\n\r\nStations default to displaying two decimal places with trailing zeros. This can be changed by setting decimal_places to the desired number.\r\n\r\n```python\r\n>>>sta = Station(456.78, decimal_places = 4)\r\n>>>print(sta)\r\n4+56.7800\r\n```\r\n\r\n\r\n## Operations\r\nStations can be added, subtracted, and compared. \r\n\r\nAdding a station and a number (float, int, etc.) returns a Station. \r\n\r\nSubtracting a number from a station returns a Station.\r\n\r\nSubtracting 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.\r\n\r\nThere 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. \r\n\r\n## Definition of Station object\r\nThe following code shows the args taken by a Station object.\r\n```python\r\nclass Station:\r\n def __init__(self, sta, decimal_places = 2, return_float_on_sub = True) -> None:\r\n```\r\n\r\n",
"bugtrack_url": null,
"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.",
"summary": "Support for stationing used in civil plans",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/windsorwindsor2/civstation"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ad848c516387ca6c4d521c3e182f1f6f2c524dc181e10f220fd79031d15fe5b7",
"md5": "ba45a2631c289689de4454040625a090",
"sha256": "bf5613cbd4b3c1cad25b2e99f55ef391904b68e5f91f7582328095e33bbd4aae"
},
"downloads": -1,
"filename": "civstation-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ba45a2631c289689de4454040625a090",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4723,
"upload_time": "2024-08-10T21:01:28",
"upload_time_iso_8601": "2024-08-10T21:01:28.669278Z",
"url": "https://files.pythonhosted.org/packages/ad/84/8c516387ca6c4d521c3e182f1f6f2c524dc181e10f220fd79031d15fe5b7/civstation-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c6b398bf695c3ca5a776ab4c3c634b61a1b49cb7212f0ffb5b19f2d74872cd60",
"md5": "1ff5bce5285b912c608e647ce8a4745a",
"sha256": "1524416cab53bf35d3e03dcd7a214dba626b6042c288d4490b583e56a369440a"
},
"downloads": -1,
"filename": "civstation-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "1ff5bce5285b912c608e647ce8a4745a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 3850,
"upload_time": "2024-08-10T21:01:30",
"upload_time_iso_8601": "2024-08-10T21:01:30.305652Z",
"url": "https://files.pythonhosted.org/packages/c6/b3/98bf695c3ca5a776ab4c3c634b61a1b49cb7212f0ffb5b19f2d74872cd60/civstation-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-10 21:01:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "windsorwindsor2",
"github_project": "civstation",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "civstation"
}