Within the project scope, feed ID is used to locate the implementation python file under src/scraper/feeds and metadata json file in config/feeds.
- Every ID should be unique.
- It must not contain underscore
_
. Use-
instead - Suggested to match the ID in mobilitydatabase if your feed is defined in their database already.
Metadata file must be named as {FEED-ID}.json
and placed under config/feeds.
While there is no constraints to fields in the json file, it is suggested to follow mobilitydatabase's schema. If your feed exists in their database, their api endpoint will return the json file which you can just copy and paste.
Implementation python file must be named as {FEED-ID}.py
and placed under src/scraper/feeds.
You must define a class with following specification
- inherit src/scraper/feeds
- class name must be same as the feed ID, in capitalized letter and underscore
_
instead of-
. - implement
def __init__(self):
- implement
def scrape(self):
which return the scraped binary result