Skip to content

Commit

Permalink
related to westonplatter#11. code clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
westonplatter committed Aug 25, 2018
1 parent a38cb20 commit b4f3f90
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 25 deletions.
12 changes: 10 additions & 2 deletions fast_arrow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# library util and client stuff
from fast_arrow.client import Client

from fast_arrow.exceptions import (
AuthenticationError,
NotImplementedError)

# options
from fast_arrow.resources.option_chain import OptionChain
from fast_arrow.resources.option_event import OptionEvent
from fast_arrow.resources.option_order import OptionOrder
from fast_arrow.resources.option_marketdata import OptionMarketdata
from fast_arrow.resources.option_position import OptionPosition
from fast_arrow.resources.option import Option

# stocks
from fast_arrow.resources.stock_order import StockOrder
from fast_arrow.resources.stock_marketdata import StockMarketdata
from fast_arrow.resources.stock_position import StockPosition
from fast_arrow.resources.stock import Stock

# user
from fast_arrow.resources.user import User

from fast_arrow.client import Client
1 change: 1 addition & 0 deletions fast_arrow/api_requestor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import requests



# def gen_headers(bearer):
# headers = {
# "Accept": "*/*",
Expand Down
2 changes: 0 additions & 2 deletions fast_arrow/fast_arrow_object.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# from __future__ import absolute_import, division, print_function

import datetime
import json

Expand Down
2 changes: 0 additions & 2 deletions fast_arrow/resources/option_chain.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# from fast_arrow.api_requestor import get

class OptionChain(object):

@classmethod
Expand Down
1 change: 0 additions & 1 deletion fast_arrow/resources/option_event.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# from fast_arrow.api_requestor import get
from fast_arrow import util
from fast_arrow.resources.option import Option

Expand Down
1 change: 0 additions & 1 deletion fast_arrow/resources/option_marketdata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# from fast_arrow.api_requestor import get
from fast_arrow.util import chunked_list


Expand Down
1 change: 0 additions & 1 deletion fast_arrow/resources/option_order.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# from fast_arrow.api_requestor import get
from fast_arrow import util
from fast_arrow.resources.option import Option

Expand Down
1 change: 0 additions & 1 deletion fast_arrow/resources/option_position.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# from fast_arrow.api_requestor import get
from fast_arrow import util
from fast_arrow.resources.option import Option
from fast_arrow.resources.option_marketdata import OptionMarketdata
Expand Down
3 changes: 0 additions & 3 deletions fast_arrow/resources/position.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# from fast_arrow.api_requestor import get


class Position(object):

@classmethod
Expand Down
3 changes: 0 additions & 3 deletions fast_arrow/resources/stock.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# from fast_arrow.api_requestor import get


class Stock(object):

@classmethod
Expand Down
1 change: 0 additions & 1 deletion fast_arrow/resources/stock_marketdata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# from fast_arrow.api_requestor import get
from fast_arrow.util import chunked_list


Expand Down
2 changes: 0 additions & 2 deletions fast_arrow/resources/stock_order.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# from fast_arrow.api_requestor import get


class StockOrder(object):

Expand Down
2 changes: 0 additions & 2 deletions fast_arrow/resources/stock_position.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# from fast_arrow.api_requestor import get


class StockPosition(object):

Expand Down
2 changes: 0 additions & 2 deletions fast_arrow/resources/user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# from fast_arrow.api_requestor import get

class User(object):

@classmethod
Expand Down
6 changes: 4 additions & 2 deletions fast_arrow/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def get_last_path(url_string):
return list(filter(None, paths))[-1]


def chunked_list(_list, _chunk_size):
"""Yield successive n-sized chunks from l."""
def chunked_list(_list, _chunk_size=50):
"""
Break lists into small lists for processing:w
"""
for i in range(0, len(_list), _chunk_size):
yield _list[i:i + _chunk_size]

0 comments on commit b4f3f90

Please sign in to comment.