-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathexample.py
35 lines (27 loc) · 814 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
import time
import logging
import stomp
import sqlite3
import pandas as pd
from topicmapping import TopicMapping
from datafeeder import RailDataFeeder
pd.options.display.max_columns = None
# Set up the personal information for the data feeds
USERNAME = 'XXXXXX'
PASSWORD = 'XXXXXX'
# four topics to choose from - 1. MVT 2. PPM 3. VSTP 4. TD
TOPIC = "MVT"
train_rdf = RailDataFeeder(
db_name=TopicMapping[TOPIC][2],
channel=TopicMapping[TOPIC][1],
topic=TOPIC,
schema=TopicMapping[TOPIC][0],
username=USERNAME,
password=PASSWORD,
drop_if_exists=True,
view=False
)
train_rdf.download_feed()
# convert to dataframe
train_rdf.to_pandas()