• Stars
    star
    375
  • Rank 114,096 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 10 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

北京实时公交 for Python

[不再维护] 代码已经很久没有更新,调用的 api 接口可能已经改变。有兴趣的朋友可以提 PR

北京实时公交

该项目是北京实时公交查询接口的Python绑定,接口逆向自其安卓客户端

警告

此项目通过调用非公开接口获取数据,use at your own risk.

Quick Start

  • pip install -r requirements.txt 安装依赖
  • python manage.py build_cache 获取离线数据,建立本地缓存

项目自带了一个终端中的查询工具作为例子,运行: python manage.py cli

Examples

>>> from beijing_bus import BeijingBus
>>> lines = BeijingBus.get_all_lines()
>>> lines
[<Line: 运通122(农业展览馆-华纺易城公交场站)>, <Line: 运通101(广顺南大街北口-蓝龙家园)>, ...]
>>> lines = BeijingBus.search_lines('847')
>>> lines
[<Line: 847(马甸桥西-雷庄村)>, <Line: 847(雷庄村-马甸桥西)>]
>>> line = lines[0]
>>> print line.id, line.name
541 847(马甸桥西-雷庄村)
>>> line.stations
[<Station 马甸桥西>, <Station 马甸桥东>, <Station 安华桥西>, ...]
>>> station = line.stations[0]
>>> print station.name, station.lat, station.lon
马甸桥西 39.967721 116.372921
>>> line.get_realtime_data(1) # 参数为站点的序号,从1开始
[
    {
        'id': 公交车id,
        'lat': 公交车的位置,
        'lon': 公交车位置,
        'next_station_name': 下一站的名字,
        'next_station_num': 下一站的序号,
        'next_station_distance': 离下一站的距离,
        'next_station_arriving_time': 预计到达下一站的时间,
        'station_distance': 离本站的距离,
        'station_arriving_time': 预计到达本站的时间,
    },
    ...
]

Roadmap

  • 实现 beijing_bus 模块,提供需要的Python接口
  • 终端中的查询工具
  • 微信公众号,扫描二维码关注:

公众号二维码

More Repositories

1

chatgpt-google-extension

This project is deprecated. Check my new project ChatHub:
TypeScript
13,259
star
2

xiaohuangji

人人网小黄鸡 (deprecated)
Python
530
star
3

lovegift

Love Gift
JavaScript
164
star
4

chatgpt-plugins

Collection of ChatGPT plugins
103
star
5

first-commit

(deprecated) a service to find the first commit of a repo, built with koa.js
HTML
68
star
6

doora

Just another file sharing service
HTML
46
star
7

ifttj

(deprecated) IFTTJ = IFTTT + 即刻
HTML
40
star
8

browser-firewall

Block any extension or website from accessing network
TypeScript
31
star
9

yan.js

颜.js
JavaScript
30
star
10

pmm

PyPi Mirror Manager
Python
29
star
11

pyrenren

RenRen Python Library
Python
28
star
12

memobird.py

unofficial Python SDK for memobird 咕咕机
Python
17
star
13

GrassMudTrojan

病毒课作业,一个简单的木马程序:草泥木马。
Python
16
star
14

kflow

cross platform GUI for k2pdfopt, built with electron
JavaScript
13
star
15

SnowClone

clone of google's "let it snow
JavaScript
10
star
16

PyOthello

An othello game with AI
Python
9
star
17

open163-feed

TypeScript
8
star
18

douban2xiami-chrome

同步豆瓣红心到虾米的Chrome扩展 - 糙!快!猛!
JavaScript
7
star
19

userscripts

some of my userscripts
JavaScript
7
star
20

FTP4Chrome

FTP Client in Chrome
JavaScript
6
star
21

sse-inspector

JavaScript
6
star
22

HUST-Cryptography-Project

密码学课设
C
6
star
23

zhan2weibo

人人小站到新浪微博同步程序
Python
6
star
24

serve-scripts

serve server scripts in browser
JavaScript
6
star
25

HUST-Access-Control-Project

访问控制作业
Python
5
star
26

alipay-qr.com

#WIP
JavaScript
4
star
27

doubanfm.me

未完成
JavaScript
4
star
28

better-extension-manager

管理Chrome扩展的扩展
JavaScript
4
star
29

larus

Larus is a simplified Gunicorn clone
Python
4
star
30

renren-auto-group

人人好友自动分组(k means 聚类)
CoffeeScript
4
star
31

loudness.info

JavaScript
3
star
32

weixin-jssdk-flask

简单的微信 jssdk 服务器端实现 with Flask
Python
3
star
33

atom-flake8

Atom package for flake8
CoffeeScript
3
star
34

rrtm

人人弹幕
JavaScript
3
star
35

next-live

2
star
36

nft-api

TypeScript
2
star
37

approved.gg

TypeScript
2
star
38

chathub

2
star
39

dev-in-china

一些开发工具的配置方法,以便在国内愉悦的使用
2
star
40

request-panel

Chrome extension to add a request panel for Chrome Developer Tools
2
star
41

world-cup-2014-open-data

open data for world cup 2014
2
star
42

batchexecute

TypeScript package to ease interactions with Google's batchexecute batch RPC system
TypeScript
2
star
43

you-are-deleted

Chrome扩展你被删了
JavaScript
2
star
44

is0801

班级通讯录
JavaScript
2
star
45

mfers-wallpaper

TypeScript
2
star
46

hardhat-fork-contract

JavaScript
2
star
47

Save2Weibo

收藏到微博服务
JavaScript
2
star
48

rerss

TypeScript
2
star
49

learngit

test to learn git
1
star
50

wong2

1
star
51

renren-visit-shot

人人网来访截图
Python
1
star
52

ipache

计算机网络作业,简单的Web服务器
C
1
star
53

banzheng-guide

办证指南
1
star
54

placeholder_fixer

Placeholder fallback for browsers don't support it
JavaScript
1
star
55

meowatch

watch fs changes and meow
JavaScript
1
star
56

standby

1
star
57

gen-art-scripts

JavaScript
1
star
58

vimrc

new vimrc file with vundle
Vim Script
1
star
59

hardhat-ui

TypeScript
1
star
60

doc-editor

学习backbone.js
JavaScript
1
star
61

wong2.github.io

https://wong2.me
1
star
62

electron-fetch-via-main

Simple cross origin requests in Electron
TypeScript
1
star