Skip to content

Document how to add entities #27

@laidig

Description

@laidig

I need to add entities (specifically, a feed_info where one is not present in the original feed) to my feed. I've figured out how to do this, but it's not documented and may be a little convoluted:

if 'feed_info' not in gtfs_feed.by_id:
    gtfs_feed.by_id['feed_info'] = {}
    cls = gtfs_feed.FACTORIES['feed_info']
    info = cls.from_row({
        'feed_publisher_name' : agency_id,
        'feed_publisher_url' : url ,
        'feed_lang' : feed_lang,
        'feed_id' : agency_id
        })
    gtfs_feed.by_id['feed_info']['a'] = info

Is there a better way? If this is acceptable I will submit a PR explaining the process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions