https://github.com/fantomas42/veliberator
Veliberator provides a Python API for getting informations about the stations of the Velib' network.
https://github.com/fantomas42/veliberator
Last synced: 10 months ago
JSON representation
Veliberator provides a Python API for getting informations about the stations of the Velib' network.
- Host: GitHub
- URL: https://github.com/fantomas42/veliberator
- Owner: Fantomas42
- License: bsd-3-clause
- Created: 2009-07-16T18:52:43.000Z (about 17 years ago)
- Default Branch: develop
- Last Pushed: 2023-04-14T17:19:58.000Z (over 3 years ago)
- Last Synced: 2025-09-14T04:03:15.851Z (10 months ago)
- Language: Python
- Homepage: http://veliberator.com
- Size: 232 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
Veliberator
===========
**Veliberator** is a Python module who provides an API for getting the
informations related to the stations of the Velib' bike renting network.
.. contents::
API Usage
---------
To retrieve the informations of a station you only have to have the ID of
the station and a database synchronized with all the available stations.
Then in your Python interpreter you can play with the API:
::
>>> from veliberator.station import Station
>>> station = Station(42008)
>>> station.informations.address
u'128 AVENUE DANIEL CASANOVA'
The informations attributes contains many data such as:
* ``address``
* ``postal_code``
* ``city``
* ``lat`` *(the latitude of the GPS coordonates)*
* ``lng`` *(the longitude of the GPS coordonates)*
* ``opened`` *(True if the station is open)*
* ``bonus`` *(True if the station is a bonus station)*
You could retrieve the live status of the station easily:
::
>>> station.status.available
24
>>> station.status.free
1
>>> station.status.total
25
>>> station.status.closed
0
More useful, you can retrieve the closest stations sorted by distance:
::
>>> station.stations_around
[, , ...]
The **veliberator** script
--------------------------
Write an API for developers is a nice idea, but write an useful script
who uses the API for the end-user is a much nicer idea.
So the package provide a script named ``veliberator``.
For exemple if I need to know the status of the Velib' station with the ID:
*42008*, I simply need to run this command:
::
$ veliberator 42008
This command will display the status of the station and find other stations
around if no parking place are available.
The ``veliberator`` script can also find the Velib' stations around an
address, by simply launching the script.
Note that at the first run of the script a database will be created for
registering all the available stations.
For update or create the database you can run this command:
::
$ veliberator --synchronize
Run this command for more informations:
::
$ veliberator -h
Settings
--------
The veliberator module can be configured by a configuration file.
Take a look on the file ``etc/veliberator-sample.cfg`` for having a example
of the options availables.
The module is going to look in your home directory if a file named
``.veliberator.cfg`` is present and in ``etc/veliberator.cfg`` from your
current working directory.