Skip to content

Improve bus route handling - #47

Merged
nolanbconaway merged 6 commits into
mainfrom
nolan/anon-bus
Jan 21, 2026
Merged

Improve bus route handling#47
nolanbconaway merged 6 commits into
mainfrom
nolan/anon-bus

Conversation

@nolanbconaway

@nolanbconaway nolanbconaway commented Jan 16, 2026

Copy link
Copy Markdown
Owner

fixes #46

  • Removes a bunch of validation around having to have registered the route to a url in advance. In hindsight i think the decision to add that validation caused more problems than it solved; really we just want this library to be smart enough to map routes to urls. This library was basically my first adventure into pydantic and i was maybe overzealous with the validation.
  • Removes route remapping. Those routes are literally different, I do not know why I thought it was a good idea to merge them all....
  • Removes the manual assignment of bus lines to the feed, as it is no longer needed.
  • Adds an explicit handler in resolve_url for the bus url. either the bus url or BUS will be accepted.
  • Adds docs concerning bus support
  • python 3.14
  • version 2.0.0

@nolanbconaway

nolanbconaway commented Jan 16, 2026

Copy link
Copy Markdown
Owner Author

@WardBrian would you mind taking a look here? these changes are large enough that i'd like to have some eyes on it! Given your contribs, i'd be happy to add you as a contributor as well if you'd like.

@WardBrian

Copy link
Copy Markdown
Collaborator

I certainly can, though probably not until Tuesday. I’d also be happy to be added as a contributor :)

@nolanbconaway

Copy link
Copy Markdown
Owner Author

I certainly can, though probably not until Tuesday. I’d also be happy to be added as a contributor :)

No rush- whenever you have the time will be OK!

@WardBrian WardBrian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks good to me, I think it makes a lot of sense to treat buses like this.

One concern I do have is if the MTA one day decides to split up the bus feed like they have the trains, then this API would be a lot more cumbersome to implement. But, I suppose there's no reason to plan for something that might never happen, and if it did it could always just be a major version bump.

@nolanbconaway

Copy link
Copy Markdown
Owner Author

This looks good to me, I think it makes a lot of sense to treat buses like this.

One concern I do have is if the MTA one day decides to split up the bus feed like they have the trains, then this API would be a lot more cumbersome to implement. But, I suppose there's no reason to plan for something that might never happen, and if it did it could always just be a major version bump.

Yeah i think that's something we'll deal with if it happens!

@nolanbconaway
nolanbconaway merged commit 5afd4a5 into main Jan 21, 2026
6 checks passed
@nolanbconaway
nolanbconaway deleted the nolan/anon-bus branch January 21, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bus route validation may be a moving target

2 participants