Name | bssd-core JSON |
Version |
0.1.2
JSON |
| download |
home_page | None |
Summary | The core of the BSSD project |
upload_time | 2024-08-01 10:53:41 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | Copyright 2024 Institute of Automotive Engineering (FZD), Technical University of Darmstadt 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 |
bssd
osm
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# BSSD Core
# Install
## Using pip
```bash
pip install bssd-core
```
This will install the latest version of the bssd core library available in [PyPI](https://pypi.org/project/bssd/) to your environment.
## Manual installation from source
Install the package into your local python3 virtual environment:
- Clone the source code to a directory of your choice
```bash
git clone https://gitlab.com/tuda-fzd/scenery-representations-and-maps/bssd-core.git path/to/bssd-core-src/
```
If you are using virtual environments, make sure to activate the correct environment to install the library into e.g:
```bash
source /<path-to-my-project>/.venv/bin/activate
```
Install the library:
```bash
pip install -e path/to/bssd-core-src/
```
# Usage
The package is build as an extension of [pyosmium](https://docs.osmcode.org/pyosmium/latest/intro.html).
Following is a simple example on how to use the library. The referenced objects from the
handler are only temporary. If data is wished to be stored it must be copied out.
```python
import osmium
from bssd.core import BSSDHandler, Reservation
from bssd.core import mutable
class Handler(BSSDHandler):
def __init__(self):
super().__init__()
self.writer = osmium.SimpleWriter("out.osm")
# callback function for reservations
def reservation(self, r: Reservation):
# r is readonly, to change r it must be converted
r: mutable.Reservation = r.make_mutable()
r.bicycle = True
# write the changed reservation to the output file
self.writer.add_relation(r.get_osmium())
if __name__ == "__main__":
h = Handler()
h.apply_file("in.osm")
```
# BSSDHandler callback functions
These callback functions need to be implemented in the inheriting class to be used.
The function will receive the specified objects after calling apply_file().
The relation callback can be used to read non BSSD elements.
- behavior_space(core.BehaviorSpace)
- behavior(core.Behavior)
- boundary_lat(core.BoundaryLat)
- boundary_long(core.BoundaryLong)
- reservation(core.Reservation)
- relation(osm.Relation)
Raw data
{
"_id": null,
"home_page": null,
"name": "bssd-core",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Moritz Bergh\u00f6fer <moritz.berghoefer@web.de>",
"keywords": "bssd, osm",
"author": null,
"author_email": "Eric Kr\u00e4mer <eric.kraemer@stud.tu-darmstadt.de>",
"download_url": "https://files.pythonhosted.org/packages/6c/2d/113e05c05ba189816bae2e6bdca01f7337f64efd86c07fd0b8937ea1490f/bssd_core-0.1.2.tar.gz",
"platform": null,
"description": "# BSSD Core\n\n# Install\n## Using pip\n```bash\npip install bssd-core\n```\nThis will install the latest version of the bssd core library available in [PyPI](https://pypi.org/project/bssd/) to your environment.\n\n## Manual installation from source\n\nInstall the package into your local python3 virtual environment:\n- Clone the source code to a directory of your choice \n```bash\ngit clone https://gitlab.com/tuda-fzd/scenery-representations-and-maps/bssd-core.git path/to/bssd-core-src/\n```\nIf you are using virtual environments, make sure to activate the correct environment to install the library into e.g:\n```bash\nsource /<path-to-my-project>/.venv/bin/activate\n```\n\nInstall the library:\n```bash\npip install -e path/to/bssd-core-src/\n```\n\n# Usage\nThe package is build as an extension of [pyosmium](https://docs.osmcode.org/pyosmium/latest/intro.html).\nFollowing is a simple example on how to use the library. The referenced objects from the\nhandler are only temporary. If data is wished to be stored it must be copied out.\n\n```python\nimport osmium\nfrom bssd.core import BSSDHandler, Reservation\nfrom bssd.core import mutable\n\n\nclass Handler(BSSDHandler):\n def __init__(self):\n super().__init__()\n self.writer = osmium.SimpleWriter(\"out.osm\")\n\n # callback function for reservations\n def reservation(self, r: Reservation):\n # r is readonly, to change r it must be converted\n r: mutable.Reservation = r.make_mutable()\n r.bicycle = True\n # write the changed reservation to the output file\n self.writer.add_relation(r.get_osmium())\n\n\nif __name__ == \"__main__\":\n h = Handler()\n h.apply_file(\"in.osm\")\n```\n\n# BSSDHandler callback functions\nThese callback functions need to be implemented in the inheriting class to be used.\nThe function will receive the specified objects after calling apply_file().\nThe relation callback can be used to read non BSSD elements.\n- behavior_space(core.BehaviorSpace)\n- behavior(core.Behavior)\n- boundary_lat(core.BoundaryLat)\n- boundary_long(core.BoundaryLong)\n- reservation(core.Reservation)\n- relation(osm.Relation)\n",
"bugtrack_url": null,
"license": "Copyright 2024 Institute of Automotive Engineering (FZD), Technical University of Darmstadt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), 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 \u201cAS IS\u201d, 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": "The core of the BSSD project",
"version": "0.1.2",
"project_urls": null,
"split_keywords": [
"bssd",
" osm"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "97423ae0e49057ebed92405406538354d50b5bed512b578b00603c5a9ea6aeb6",
"md5": "637234a46f4962e29dadfcf50b4215a5",
"sha256": "bf7c75e0dda9acecb0e276f5e6c1cebaebf68bc57d1b245931381a1224eb30ff"
},
"downloads": -1,
"filename": "bssd_core-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "637234a46f4962e29dadfcf50b4215a5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 15698,
"upload_time": "2024-08-01T10:53:39",
"upload_time_iso_8601": "2024-08-01T10:53:39.205355Z",
"url": "https://files.pythonhosted.org/packages/97/42/3ae0e49057ebed92405406538354d50b5bed512b578b00603c5a9ea6aeb6/bssd_core-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6c2d113e05c05ba189816bae2e6bdca01f7337f64efd86c07fd0b8937ea1490f",
"md5": "ba4e4eebbe2ca1e542915343f6aec708",
"sha256": "f165ef13bdbe7c3ac16e3ba8c62ed566ea340616f258a032a64b3e62960cb9b3"
},
"downloads": -1,
"filename": "bssd_core-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "ba4e4eebbe2ca1e542915343f6aec708",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 11690,
"upload_time": "2024-08-01T10:53:41",
"upload_time_iso_8601": "2024-08-01T10:53:41.145642Z",
"url": "https://files.pythonhosted.org/packages/6c/2d/113e05c05ba189816bae2e6bdca01f7337f64efd86c07fd0b8937ea1490f/bssd_core-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-01 10:53:41",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "bssd-core"
}