Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions pybikes/batumvelo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2025, Martín González Gómez <m@martingonzalez.net>
# Distributed under the AGPL license, see LICENSE.txt

import json
from pybikes import BikeShareSystem, BikeShareStation, PyBikesScraper

FEED_URL = 'https://batumvelo.ge/api/client/public/parking'

class Batumvelo(BikeShareSystem):
sync = True

def update(self, scraper = None):
scraper = scraper or PyBikesScraper()

stations = []
data = json.loads(scraper.request(FEED_URL,headers={'Accept': 'application/json'}))
for item in data:
station = BatumveloStation(item)
stations.append(station)

self.stations = stations

class BatumveloStation(BikeShareStation):
def __init__(self, item):
super(BatumveloStation, self).__init__()

self.name = item['name']
self.longitude = item['lng']
self.latitude = item['lat']

self.bikes = 0
self.free = 0
Comment on lines +32 to +33
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see availability data. Worth merging?


self.extra = {
'online': item['type'] == 'ALLOW',
}
19 changes: 19 additions & 0 deletions pybikes/data/batumvelo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"instances": [
{
"tag": "batumvelo",
"meta": {
"latitude": 41.6478,
"city": "Batumi",
"name": "Batumvelo",
"longitude": 41.6355,
"country": "GE",
"company": [
"BatumVelo"
]
}
}
],
"system": "batumvelo",
"class": "Batumvelo"
}