Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tools/build_config/setup-sumolib.py
169674 views
1
#!/usr/bin/env python
2
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
# Copyright (C) 2017-2025 German Aerospace Center (DLR) and others.
4
# This program and the accompanying materials are made available under the
5
# terms of the Eclipse Public License 2.0 which is available at
6
# https://www.eclipse.org/legal/epl-2.0/
7
# This Source Code may also be made available under the following Secondary
8
# Licenses when the conditions for such availability set forth in the Eclipse
9
# Public License 2.0 are satisfied: GNU General Public License, version 2
10
# or later which is available at
11
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
14
# @file setup-sumolib.py
15
# @author Dominik Buse
16
# @author Michael Behrisch
17
# @date 2017-01-26
18
19
20
from setuptools import setup, find_packages
21
import version
22
23
SUMO_VERSION = version.get_pep440_version()
24
25
setup(
26
name='sumolib',
27
version=SUMO_VERSION,
28
url='https://sumo.dlr.de/docs/Tools/Sumolib.html',
29
download_url='https://sumo.dlr.de/download',
30
author='DLR and contributors',
31
author_email='[email protected]',
32
license='EPL-2.0',
33
description=('Python helper modules to read networks, parse output data and ' +
34
'do other useful stuff related to the traffic simulation Eclipse SUMO'),
35
long_description='''# sumolib
36
37
sumolib is a set of python modules for working with SUMO networks, simulation output and other simulation artifacts.
38
39
## Installation
40
41
Install sumolib by simply executing:
42
```pip install sumolib```
43
44
A [daily version](https://test.pypi.org/project/sumolib/) is also available in TestPyPI:
45
```pip install -i https://test.pypi.org/simple/ sumolib```
46
47
## Getting Started
48
49
To use sumolib in your Python code, import the `sumolib` module. The following code snippet shows a basic example
50
of how to load a network file and retrieve the coordinate of a node:
51
52
```python
53
import sumolib
54
55
# Parse the network
56
net = sumolib.net.readNet("myNet.net.xml")
57
58
# Retrieve the coordinate of a node based on its ID
59
print(net.getNode("myNodeID").getCoord())
60
```
61
62
## Documentation
63
64
The sumolib documentation is available online at
65
[https://sumo.dlr.de/docs/Tools/Sumolib.html](https://sumo.dlr.de/docs/Tools/Sumolib.html). For a list of available
66
functions take a look at the [pydoc generated documentation](http://sumo.dlr.de/pydoc/sumolib.html)
67
or simply browse the [source code here](https://github.com/eclipse-sumo/sumo/tree/main/tools/sumolib).
68
69
70
## Contributing
71
72
If you find a bug in sumolib or have a suggestion for a new feature, please report it on the SUMO issue tracker at
73
[https://github.com/eclipse-sumo/sumo/issues](https://github.com/eclipse-sumo/sumo/issues).
74
If you would like to contribute code to sumolib, please submit a pull request to the SUMO repository at
75
[https://github.com/eclipse-sumo/sumo](https://github.com/eclipse-sumo/sumo).
76
77
## License
78
79
sumolib is released under the Eclipse Public License 2.0 (EPL-2.0).''',
80
long_description_content_type='text/markdown',
81
82
classifiers=[
83
'Development Status :: 5 - Production/Stable',
84
'Intended Audience :: Developers',
85
'Intended Audience :: Science/Research',
86
'Programming Language :: Python :: 2',
87
'Programming Language :: Python :: 3',
88
],
89
keywords='traffic simulation traci sumo',
90
91
packages=find_packages(include=["sumolib", "sumolib.*"]),
92
93
# TODO: add extra dependencies for testing
94
extras_require={
95
'visualization': ['matplotlib'],
96
}
97
)
98
99