Skip to main content

An unofficial python wrapper for UPSRTC internal API

Reason this release was yanked:

Package naming went wrong

Project description

UPSRTC Bus Tracker

Unofficial python wrapper around UPSRTC internal API for planning bus journey.

Prerequisites

  • python > 3.9
  • requests

Usage

Install library

  • Install using pip. pip install python-upsrtc

Generate UPSRTC object

To generate a UPSRTC object, you can use the following code:

from python-upsrtc import UPSRTC as UP
u = UP()

Get Bus Stops Data

To get bus Stops data, use the following code:

u.get_bus_stop()
# raises NOJourneyFoundError if no bus are found
# raises InvalidSearchSettingsError if search settings are not filled correctly or are empty.
print(u.bus_stops)
# List(BusStop)

It fetches a list of BusStop object stored in bus_stops attribute
See BusStop for its related methods and attributes.

Find Buses between stations.

from datetime import datetime 
#set start station
u.set_start_station("7381") # get station code from bus stops data
u.set_end_station("8778")
u.set_start_date( datetime.now() ) # Set the start date (requires a datetime object as date )
u.find_buses()
print( u.journey )
# List( Ticket )

It fetches a list of Ticket attributes stored in journey attribute.
See Ticket for its related methods and attributes.

TODO

  • Implement custom rotating proxy
  • Automatic proxy fetching.
  • Include Fare distribution in Ticket object.

Documentation

Checkout the documentation here

Authors

Notice

NOTE : I am not affiliated or endorsed with UPSRTC. This is just an API wrapper around their already existing internal, and i am not responsible for any knd of damage that might cause using this code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-upsrtc-0.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

python_upsrtc-0.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file python-upsrtc-0.0.1.tar.gz.

File metadata

  • Download URL: python-upsrtc-0.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for python-upsrtc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f9c0db3fa3ead588936204dbb033bcabcf69cc6cc442ee3f9411fa2dbc19d7f1
MD5 164b9f24302b6c4d9dbe95d6d5bc4f9d
BLAKE2b-256 060e8aed03cb75c67da20e6771bfeb4eeaa9ff637cc6cd8f85c37ec371b9afb1

See more details on using hashes here.

File details

Details for the file python_upsrtc-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_upsrtc-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff77174a2365bf7034eb536ef0256ff5c10b4b3bb562847725da9b4e54cceea5
MD5 00298d03be3e43af1f3d8ed86c4e71c3
BLAKE2b-256 f8ad33f33da92504b0e6d8dff17cb6e6dca7c6006e6f2c2554e5b52bcab5bdd6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page