itsmarta / marta-python Goto Github PK
View Code? Open in Web Editor NEWPython library for accessing MARTA real-time API
Python library for accessing MARTA real-time API
It states that you can filter by destination by passing in the station.
Currently, In the README.md file it says
# Get trains by destination
trains = get_trains(station='Doraville')
It should actually say
# Get trains by destination
trains = get_trains(destination='Doraville')
Hello,
I have created marta-csharp that pretty much does the same thing as marta-python.
https://github.com/Justbeingjustin/marta-csharp
Let's move my repository into your organization. I'd love to be part of the itsmarta github organization. Let me know what you think!
In vehicles.py for initializing the Bus and Train classes, the directive %I should be used for parsing the hour field rather than %H. The directive %H is for 24-hour clock while %I is for 12-hour clock (which is what Marta's API uses).
Per the python documentation, the %p for AM/PM specification only has an effect if using %I. Current time parsing has a bug that will cause afternoon timestamps to appear as morning (i.e. 2PM appears as a 2AM datetime object)
https://docs.python.org/3.8/library/time.html#time.strftime
When used with the strptime() function, the %p directive only affects the output hour field if the %I directive is used to parse the hour.
https://www.itsmarta.com/app-developer-resources.aspx doesn't include directions of the buses. I am not too sure how stops work. Does one stop account for both ways? If so we kinda need an indicator for directions.
Background
I'm using a t2 ec2 instance on AWS with their RedHat ami distro.
I am using this library to query Marta for my capstone research project.
Previously I was using a raspberry pi to collect the data and send it to a mounted google drive for storage, but with internet issues corrupting my mount, I decided to switch to AWS.
Problem
I am able to run tox which runs successfully excluding errors from not having the API key set, however when I try to run setup.py it gives me the following error :
error: can't create or remove files in install directory
sudo python3 setup.py install
running install
running bdist_egg
running egg_info
writing marta.egg-info/PKG-INFO
writing dependency_links to marta.egg-info/dependency_links.txt
writing requirements to marta.egg-info/requires.txt
writing top-level names to marta.egg-info/top_level.txt
reading manifest file 'marta.egg-info/SOURCES.txt'
writing manifest file 'marta.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying marta.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying marta.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying marta.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying marta.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying marta.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
File "setup.py", line 11, in <module>
'requests-cache'
File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/usr/lib64/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 218, in run
os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 269, in zip_safe
return analyze_egg(self.bdist_dir, self.stubs)
File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 379, in analyze_egg
safe = scan_module(egg_dir, base, name, stubs) and safe
File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 416, in scan_module
code = marshal.load(f)
ValueError: bad marshal data (unknown type code)
Before this, it gave me a directory doesn't exist error because my python is default installed globally in /lib/python3.7
I took the python3.7 directory and copied it into a new directory based on the path the setup.py wanted. /user/local/lib/python3.7/site-packages
, and the above error is what I got. I have played with this for days googling multiple things. I thought from https://cets.seas.upenn.edu/answers/install-python-module.html that using --prefix=
might solve my problems it did not. I tried following a link I got from the setup.py error https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations which leads to a blank page. I'm a bit lost on how to fix this.
My end goal is to take live data from MARTA buses every 5 minutes from an AWS ec2 instance and put them into a dynamo DB for analysis and for website presentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.