Giter Site home page Giter Site logo

marta-python's People

Contributors

justbeingjustin avatar landonreed avatar nwithan8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

marta-python's Issues

get_trains documentation fix

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')

strptime should use %I for parsing hour

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.

AWS RedHat AMI setup.py pathing issues

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.