text stringlengths 81 112k |
|---|
Conditionally print txt
:param txt: text to print
:param hold: If true, hang on to the text until another print comes through
:param hold: If true, drop both print statements if another hasn't intervened
:return:
def print(self, txt: str, hold: bool=False) -> None:
""" Conditio... |
Reset the context preceeding an evaluation
def reset(self) -> None:
"""
Reset the context preceeding an evaluation
"""
self.evaluating = set()
self.assumptions = {}
self.known_results = {}
self.current_node = None
self.evaluate_stack = []
self.bno... |
Generate the schema_id_map
:param expr: root shape expression
def _gen_schema_xref(self, expr: Optional[Union[ShExJ.shapeExprLabel, ShExJ.shapeExpr]]) -> None:
"""
Generate the schema_id_map
:param expr: root shape expression
"""
if expr is not None and not isinstance_... |
Generate the triple expression map (te_id_map)
:param expr: root triple expression
def _gen_te_xref(self, expr: Union[ShExJ.tripleExpr, ShExJ.tripleExprLabel]) -> None:
"""
Generate the triple expression map (te_id_map)
:param expr: root triple expression
"""
if expr ... |
Return the triple expression that corresponds to id
def tripleExprFor(self, id_: ShExJ.tripleExprLabel) -> ShExJ.tripleExpr:
""" Return the triple expression that corresponds to id """
return self.te_id_map.get(id_) |
Return the shape expression that corresponds to id
def shapeExprFor(self, id_: Union[ShExJ.shapeExprLabel, START]) -> Optional[ShExJ.shapeExpr]:
""" Return the shape expression that corresponds to id """
rval = self.schema.start if id_ is START else self.schema_id_map.get(str(id_))
return rval |
Visit expr and all of its "descendant" shapes.
:param expr: root shape expression
:param f: visitor function
:param arg_cntxt: accompanying context for the visitor function
:param visit_center: Recursive visit context. (Not normally supplied on an external call)
:param follow_i... |
Visit a triple expression that was reached through a shape. This, in turn, is used to visit additional shapes
that are referenced by a TripleConstraint
:param te: Triple expression reached through a Shape.expression
:param visit_center: context used in shape visitor
def _visit_shape_te(self, te... |
Visit a shape expression that was reached through a triple expression. This, in turn, is used to visit
additional triple expressions that are referenced by the Shape
:param shape: Shape reached through triple expression traverse
:param visit_center: context used in shape visitor
def _visit_te... |
Indicate that we are beginning to evaluate n according to shape expression s.
If we are already in the process of evaluating (n,s), as indicated self.evaluating, we return our current
guess as to the result.
:param n: Node to be evaluated
:param s: expression for node evaluation
... |
Indicate that we have completed an actual evaluation of (n,s). This is only called when start_evaluating
has returned None as the assumed result
:param n: Node that was evaluated
:param s: expression for node evaluation
:param result: result of evaluation
:return: Tuple - first... |
Move the type identifiers to the end of the object for print purposes
def type_last(self, obj: JsonObj) -> JsonObj:
""" Move the type identifiers to the end of the object for print purposes """
def _tl_list(v: List) -> List:
return [self.type_last(e) if isinstance(e, JsonObj)
... |
`5.3 Shape Expressions <http://shex.io/shex-semantics/#node-constraint-semantics>`_
satisfies: The expression satisfies(n, se, G, m) indicates that a node n and graph G satisfy a shape
expression se with shapeMap m.
satisfies(n, se, G, m) is true if and only if:
... |
Se is a ShapeOr and there is some shape expression se2 in shapeExprs such that satisfies(n, se2, G, m).
def satisifesShapeOr(cntxt: Context, n: Node, se: ShExJ.ShapeOr, _: DebugContext) -> bool:
""" Se is a ShapeOr and there is some shape expression se2 in shapeExprs such that satisfies(n, se2, G, m). """
retu... |
Se is a ShapeAnd and for every shape expression se2 in shapeExprs, satisfies(n, se2, G, m)
def satisfiesShapeAnd(cntxt: Context, n: Node, se: ShExJ.ShapeAnd, _: DebugContext) -> bool:
""" Se is a ShapeAnd and for every shape expression se2 in shapeExprs, satisfies(n, se2, G, m) """
return all(satisfies(cntxt, ... |
Se is a ShapeNot and for the shape expression se2 at shapeExpr, notSatisfies(n, se2, G, m)
def satisfiesShapeNot(cntxt: Context, n: Node, se: ShExJ.ShapeNot, _: DebugContext) -> bool:
""" Se is a ShapeNot and for the shape expression se2 at shapeExpr, notSatisfies(n, se2, G, m) """
return not satisfies(cntxt, ... |
Se is a ShapeExternal and implementation-specific mechansims not defined in this specification indicate
success.
def satisfiesExternal(cntxt: Context, n: Node, se: ShExJ.ShapeExternal, c: DebugContext) -> bool:
""" Se is a ShapeExternal and implementation-specific mechansims not defined in this specification ... |
Se is a shapeExprRef and there exists in the schema a shape expression se2 with that id
and satisfies(n, se2, G, m).
def satisfiesShapeExprRef(cntxt: Context, n: Node, se: ShExJ.shapeExprLabel, c: DebugContext) -> bool:
""" Se is a shapeExprRef and there exists in the schema a shape expression se2 with that i... |
Cat proximity graph from http://xkcd.com/231/
def cat_proximity():
"""Cat proximity graph from http://xkcd.com/231/"""
chart = SimpleLineChart(int(settings.width * 1.5), settings.height)
chart.set_legend(['INTELLIGENCE', 'INSANITY OF STATEMENTS'])
# intelligence
data_index = chart.add_data([100. /... |
Return a URIRef for a str or URIRef
def normalize_uri(u: URI) -> URIRef:
""" Return a URIRef for a str or URIRef """
return u if isinstance(u, URIRef) else URIRef(str(u)) |
Return an optional list of URIRefs for p
def normalize_uriparm(p: URIPARM) -> List[URIRef]:
""" Return an optional list of URIRefs for p"""
return normalize_urilist(p) if isinstance(p, List) else \
normalize_urilist([p]) if isinstance(p, (str, URIRef)) else p |
Return the startspec for p
def normalize_startparm(p: STARTPARM) -> List[Union[type(START), START_TYPE, URIRef]]:
""" Return the startspec for p """
if not isinstance(p, list):
p = [p]
return [normalize_uri(e) if isinstance(e, str) and e is not START else e for e in p] |
Create a command line parser
:return: parser
def genargs(prog: Optional[str] = None) -> ArgumentParser:
"""
Create a command line parser
:return: parser
"""
parser = ArgumentParser(prog)
parser.add_argument("rdf", help="Input RDF file or SPARQL endpoint if slurper or sparql options")
pa... |
Set the RDF DataSet to be evaulated. If ``rdf`` is a string, the presence of a return is the
indicator that it is text instead of a location.
:param rdf: File name, URL, representation of rdflib Graph
def rdf(self, rdf: Optional[Union[str, Graph]]) -> None:
""" Set the RDF DataSet to be evaul... |
Set the schema to be used. Schema can either be a ShExC or ShExJ string or a pre-parsed schema.
:param shex: Schema
def schema(self, shex: Optional[Union[str, ShExJ.Schema]]) -> None:
""" Set the schema to be used. Schema can either be a ShExC or ShExJ string or a pre-parsed schema.
:param... |
Set the focus node(s). If no focus node is specified, the evaluation will occur for all non-BNode
graph subjects. Otherwise it can be a string, a URIRef or a list of string/URIRef combinations
:param focus: None if focus should be all URIRefs in the graph otherwise a URI or list of URI's
def focus(s... |
arcsOut(G, n) is the set of triples in a graph G with subject n.
def arcsOut(G: Graph, n: Node) -> RDFGraph:
""" arcsOut(G, n) is the set of triples in a graph G with subject n. """
return RDFGraph(G.triples((n, None, None))) |
predicatesOut(G, n) is the set of predicates in arcsOut(G, n).
def predicatesOut(G: Graph, n: Node) -> Set[TriplePredicate]:
""" predicatesOut(G, n) is the set of predicates in arcsOut(G, n). """
return {p for p, _ in G.predicate_objects(n)} |
arcsIn(G, n) is the set of triples in a graph G with object n.
def arcsIn(G: Graph, n: Node) -> RDFGraph:
""" arcsIn(G, n) is the set of triples in a graph G with object n. """
return RDFGraph(G.triples((None, None, n))) |
predicatesIn(G, n) is the set of predicates in arcsIn(G, n).
def predicatesIn(G: Graph, n: Node) -> Set[TriplePredicate]:
""" predicatesIn(G, n) is the set of predicates in arcsIn(G, n). """
return {p for _, p in G.subject_predicates(n)} |
neigh(G, n) is the neighbourhood of the node n in the graph G.
neigh(G, n) = arcsOut(G, n) ∪ arcsIn(G, n)
def neigh(G: Graph, n: Node) -> RDFGraph:
""" neigh(G, n) is the neighbourhood of the node n in the graph G.
neigh(G, n) = arcsOut(G, n) ∪ arcsIn(G, n)
"""
return arcsOut(G, n) | a... |
redicates(G, n) is the set of predicates in neigh(G, n).
predicates(G, n) = predicatesOut(G, n) ∪ predicatesIn(G, n)
def predicates(G: Graph, n: Node) -> Set[TriplePredicate]:
""" redicates(G, n) is the set of predicates in neigh(G, n).
predicates(G, n) = predicatesOut(G, n) ∪ predicatesIn(G, n)
... |
Convert path, which can be a URL or a file path into a base URI
:param path: file location or url
:return: file location or url sans actual name
def generate_base(path: str) -> str:
""" Convert path, which can be a URL or a file path into a base URI
:param path: file location or url
:return: file... |
Data from http://indexed.blogspot.com/2007/08/real-ultimate-power.html
def ultimate_power():
"""
Data from http://indexed.blogspot.com/2007/08/real-ultimate-power.html
"""
chart = VennChart(settings.width, settings.height)
chart.add_data([100, 100, 100, 20, 20, 20, 10])
chart.set_title('Ninjas ... |
Return (host, port) from server.
Port defaults to 11211.
>>> split_host_port('127.0.0.1:11211')
('127.0.0.1', 11211)
>>> split_host_port('127.0.0.1')
('127.0.0.1', 11211)
def split_host_port(cls, server):
"""
Return (host, port) from server.
Port defau... |
Reads data from socket.
:param size: Size in bytes to be read.
:return: Data from socket
def _read_socket(self, size):
"""
Reads data from socket.
:param size: Size in bytes to be read.
:return: Data from socket
"""
value = b''
while len(value) ... |
Get memcached response from socket.
:return: A tuple with binary values from memcached.
:rtype: tuple
def _get_response(self):
"""
Get memcached response from socket.
:return: A tuple with binary values from memcached.
:rtype: tuple
"""
try:
... |
Authenticate user on server.
:param username: Username used to be authenticated.
:type username: six.string_types
:param password: Password used to be authenticated.
:type password: six.string_types
:return: True if successful.
:raises: InvalidCredentials, Authentication... |
Serializes a value based on its type.
:param value: Something to be serialized
:type value: six.string_types, int, long, object
:param compress_level: How much to compress.
0 = no compression, 1 = fastest, 9 = slowest but best,
-1 = default compression level.
:ty... |
Deserialized values based on flags or just return it if it is not serialized.
:param value: Serialized or not value.
:type value: six.string_types, int
:param flags: Value flags
:type flags: int
:return: Deserialized value
:rtype: six.string_types|int
def deserialize(se... |
Get a key and its CAS value from server. If the value isn't cached, return
(None, None).
:param key: Key's name
:type key: six.string_types
:return: Returns (value, cas).
:rtype: object
def get(self, key):
"""
Get a key and its CAS value from server. If the va... |
Send a NOOP command
:return: Returns the status.
:rtype: int
def noop(self):
"""
Send a NOOP command
:return: Returns the status.
:rtype: int
"""
logger.debug('Sending NOOP')
data = struct.pack(self.HEADER_STRUCT +
sel... |
Get multiple keys from server.
Since keys are converted to b'' when six.PY3 the keys need to be decoded back
into string . e.g key='test' is read as b'test' and then decoded back to 'test'
This encode/decode does not work when key is already a six.binary_type hence
this function remembe... |
Function to set/add/replace commands.
:param key: Key's name
:type key: six.string_types
:param value: A value to be stored on server.
:type value: object
:param time: Time in seconds that your key will expire.
:type time: int
:param cas: The CAS value that must ... |
Set a value for a key on server.
:param key: Key's name
:type key: six.string_types
:param value: A value to be stored on server.
:type value: object
:param time: Time in seconds that your key will expire.
:type time: int
:param compress_level: How much to compre... |
Add a key/value to server ony if it does not exist.
:param key: Key's name
:type key: six.string_types
:param value: A value to be stored on server.
:type value: object
:param time: Time in seconds that your key will expire.
:type time: int
:param compress_level:... |
Add a key/value to server ony if it does not exist.
:param key: Key's name
:type key: six.string_types
:param value: A value to be stored on server.
:type value: object
:param time: Time in seconds that your key will expire.
:type time: int
:param compress_level:... |
Replace a key/value to server ony if it does exist.
:param key: Key's name
:type key: six.string_types
:param value: A value to be stored on server.
:type value: object
:param time: Time in seconds that your key will expire.
:type time: int
:param compress_level:... |
Set multiple keys with its values on server.
If a key is a (key, cas) tuple, insert as if cas(key, value, cas) had
been called.
:param mappings: A dict with keys/values
:type mappings: dict
:param time: Time in seconds that your key will expire.
:type time: int
... |
Function which increments and decrements.
:param key: Key's name
:type key: six.string_types
:param value: Number to be (de|in)cremented
:type value: int
:param default: Default value if key does not exist.
:type default: int
:param time: Time in seconds to expir... |
Increment a key, if it exists, returns its actual value, if it doesn't, return 0.
:param key: Key's name
:type key: six.string_types
:param value: Number to be incremented
:type value: int
:param default: Default value if key does not exist.
:type default: int
:p... |
Decrement a key, if it exists, returns its actual value, if it doesn't, return 0.
Minimum value of decrement return is 0.
:param key: Key's name
:type key: six.string_types
:param value: Number to be decremented
:type value: int
:param default: Default value if key does ... |
Delete a key/value from server. If key existed and was deleted, return True.
:param key: Key's name to be deleted
:type key: six.string_types
:param cas: If set, only delete the key if its CAS value matches.
:type cas: int
:return: True in case o success and False in case of fai... |
Delete multiple keys from server in one command.
:param keys: A list of keys to be deleted
:type keys: list
:return: True in case of success and False in case of failure.
:rtype: bool
def delete_multi(self, keys):
"""
Delete multiple keys from server in one command.
... |
Send a command to server flush|delete all keys.
:param time: Time to wait until flush in seconds.
:type time: int
:return: True in case of success, False in case of failure
:rtype: bool
def flush_all(self, time):
"""
Send a command to server flush|delete all keys.
... |
Return server stats.
:param key: Optional if you want status from a key.
:type key: six.string_types
:return: A dict with server stats
:rtype: dict
def stats(self, key=None):
"""
Return server stats.
:param key: Optional if you want status from a key.
:... |
Add a ShExC schema to the library
:param schema: ShExC schema text, URL or file name
:return: prefix library object
def add_shex(self, schema: str) -> "PrefixLibrary":
""" Add a ShExC schema to the library
:param schema: ShExC schema text, URL or file name
:return: prefix libr... |
Add bindings in the library to the graph
:param g: graph to add prefixes to
:return: PrefixLibrary object
def add_bindings(self, g: Graph) -> "PrefixLibrary":
""" Add bindings in the library to the graph
:param g: graph to add prefixes to
:return: PrefixLibrary object
... |
Add the bindings to the target object
:param target: target to add to
:param override: override existing bindings if they are of type Namespace
:return: number of items actually added
def add_to_object(self, target: object, override: bool = False) -> int:
"""
Add the bindings t... |
Return the 'ns:name' format of URI
:param uri: URI to transform
:return: nsname format of URI or straight URI if no mapping
def nsname(self, uri: Union[str, URIRef]) -> str:
"""
Return the 'ns:name' format of URI
:param uri: URI to transform
:return: nsname format of U... |
:param f: file object with spec data
spec file is a yaml document that specifies which modules
can be loaded.
modules - list of base modules that can be loaded
pths - list of .pth files to load
def open_spec(f):
"""
:param f: file object with spec data
spec file is a yaml document tha... |
Load a ShEx Schema from schema_location
:param schema_file: name or file-like object to deserialize
:param schema_location: URL or file name of schema. Used to create the base_location
:return: ShEx Schema represented by schema_location
def load(self, schema_file: Union[str, TextIO], schema_... |
Parse and return schema as a ShExJ Schema
:param schema_txt: ShExC or ShExJ representation of a ShEx Schema
:return: ShEx Schema representation of schema
def loads(self, schema_txt: str) -> ShExJ.Schema:
""" Parse and return schema as a ShExJ Schema
:param schema_txt: ShExC or ShExJ r... |
placeOrder(EClient self, OrderId id, Contract contract, Order order)
def placeOrder(self, id, contract, order):
"""placeOrder(EClient self, OrderId id, Contract contract, Order order)"""
return _swigibpy.EClient_placeOrder(self, id, contract, order) |
reqMktDepth(EClient self, TickerId id, Contract contract, int numRows, TagValueListSPtr const & mktDepthOptions)
def reqMktDepth(self, id, contract, numRows, mktDepthOptions):
"""reqMktDepth(EClient self, TickerId id, Contract contract, int numRows, TagValueListSPtr const & mktDepthOptions)"""
return _... |
exerciseOptions(EClient self, TickerId id, Contract contract, int exerciseAction, int exerciseQuantity, IBString const & account, int override)
def exerciseOptions(self, id, contract, exerciseAction, exerciseQuantity, account, override):
"""exerciseOptions(EClient self, TickerId id, Contract contract, int exer... |
reqScannerSubscription(EClient self, int tickerId, ScannerSubscription subscription, TagValueListSPtr const & scannerSubscriptionOptions)
def reqScannerSubscription(self, tickerId, subscription, scannerSubscriptionOptions):
"""reqScannerSubscription(EClient self, int tickerId, ScannerSubscription subscription,... |
reqFundamentalData(EClient self, TickerId reqId, Contract arg3, IBString const & reportType)
def reqFundamentalData(self, reqId, arg3, reportType):
"""reqFundamentalData(EClient self, TickerId reqId, Contract arg3, IBString const & reportType)"""
return _swigibpy.EClient_reqFundamentalData(self, reqId,... |
calculateImpliedVolatility(EClient self, TickerId reqId, Contract contract, double optionPrice, double underPrice)
def calculateImpliedVolatility(self, reqId, contract, optionPrice, underPrice):
"""calculateImpliedVolatility(EClient self, TickerId reqId, Contract contract, double optionPrice, double underPrice... |
calculateOptionPrice(EClient self, TickerId reqId, Contract contract, double volatility, double underPrice)
def calculateOptionPrice(self, reqId, contract, volatility, underPrice):
"""calculateOptionPrice(EClient self, TickerId reqId, Contract contract, double volatility, double underPrice)"""
return _... |
reqAccountSummary(EClient self, int reqId, IBString const & groupName, IBString const & tags)
def reqAccountSummary(self, reqId, groupName, tags):
"""reqAccountSummary(EClient self, int reqId, IBString const & groupName, IBString const & tags)"""
return _swigibpy.EClient_reqAccountSummary(self, reqId, ... |
eConnect(EClientSocketBase self, char const * host, unsigned int port, int clientId=0, bool extraAuth=False) -> bool
def eConnect(self, host, port, clientId=0, extraAuth=False):
"""eConnect(EClientSocketBase self, char const * host, unsigned int port, int clientId=0, bool extraAuth=False) -> bool"""
re... |
reqMktData(EClientSocketBase self, TickerId id, Contract contract, IBString const & genericTicks, bool snapshot, TagValueListSPtr const & mktDataOptions)
def reqMktData(self, id, contract, genericTicks, snapshot, mktDataOptions):
"""reqMktData(EClientSocketBase self, TickerId id, Contract contract, IBString co... |
placeOrder(EClientSocketBase self, OrderId id, Contract contract, Order order)
def placeOrder(self, id, contract, order):
"""placeOrder(EClientSocketBase self, OrderId id, Contract contract, Order order)"""
return _swigibpy.EClientSocketBase_placeOrder(self, id, contract, order) |
reqMktDepth(EClientSocketBase self, TickerId tickerId, Contract contract, int numRows, TagValueListSPtr const & mktDepthOptions)
def reqMktDepth(self, tickerId, contract, numRows, mktDepthOptions):
"""reqMktDepth(EClientSocketBase self, TickerId tickerId, Contract contract, int numRows, TagValueListSPtr const ... |
reqHistoricalData(EClientSocketBase self, TickerId id, Contract contract, IBString const & endDateTime, IBString const & durationStr, IBString const & barSizeSetting, IBString const & whatToShow, int useRTH, int formatDate, TagValueListSPtr const & chartOptions)
def reqHistoricalData(self, id, contract, endDateTime, d... |
exerciseOptions(EClientSocketBase self, TickerId tickerId, Contract contract, int exerciseAction, int exerciseQuantity, IBString const & account, int override)
def exerciseOptions(self, tickerId, contract, exerciseAction, exerciseQuantity, account, override):
"""exerciseOptions(EClientSocketBase self, TickerId... |
reqRealTimeBars(EClientSocketBase self, TickerId id, Contract contract, int barSize, IBString const & whatToShow, bool useRTH, TagValueListSPtr const & realTimeBarsOptions)
def reqRealTimeBars(self, id, contract, barSize, whatToShow, useRTH, realTimeBarsOptions):
"""reqRealTimeBars(EClientSocketBase self, Tick... |
reqScannerSubscription(EClientSocketBase self, int tickerId, ScannerSubscription subscription, TagValueListSPtr const & scannerSubscriptionOptions)
def reqScannerSubscription(self, tickerId, subscription, scannerSubscriptionOptions):
"""reqScannerSubscription(EClientSocketBase self, int tickerId, ScannerSubscr... |
reqFundamentalData(EClientSocketBase self, TickerId reqId, Contract arg3, IBString const & reportType)
def reqFundamentalData(self, reqId, arg3, reportType):
"""reqFundamentalData(EClientSocketBase self, TickerId reqId, Contract arg3, IBString const & reportType)"""
return _swigibpy.EClientSocketBase_r... |
calculateImpliedVolatility(EClientSocketBase self, TickerId reqId, Contract contract, double optionPrice, double underPrice)
def calculateImpliedVolatility(self, reqId, contract, optionPrice, underPrice):
"""calculateImpliedVolatility(EClientSocketBase self, TickerId reqId, Contract contract, double optionPric... |
calculateOptionPrice(EClientSocketBase self, TickerId reqId, Contract contract, double volatility, double underPrice)
def calculateOptionPrice(self, reqId, contract, volatility, underPrice):
"""calculateOptionPrice(EClientSocketBase self, TickerId reqId, Contract contract, double volatility, double underPrice)... |
reqAccountSummary(EClientSocketBase self, int reqId, IBString const & groupName, IBString const & tags)
def reqAccountSummary(self, reqId, groupName, tags):
"""reqAccountSummary(EClientSocketBase self, int reqId, IBString const & groupName, IBString const & tags)"""
return _swigibpy.EClientSocketBase_r... |
Continually poll TWS
def _run(self):
'''Continually poll TWS'''
stop = self._stop_evt
connected = self._connected_evt
tws = self._tws
fd = tws.fd()
pollfd = [fd]
while not stop.is_set():
while (not connected.is_set() or not tws.isConnected()) and no... |
tickPrice(EWrapper self, TickerId tickerId, TickType field, double price, int canAutoExecute)
def tickPrice(self, tickerId, field, price, canAutoExecute):
"""tickPrice(EWrapper self, TickerId tickerId, TickType field, double price, int canAutoExecute)"""
return _swigibpy.EWrapper_tickPrice(self, ticker... |
tickSize(EWrapper self, TickerId tickerId, TickType field, int size)
def tickSize(self, tickerId, field, size):
"""tickSize(EWrapper self, TickerId tickerId, TickType field, int size)"""
return _swigibpy.EWrapper_tickSize(self, tickerId, field, size) |
tickOptionComputation(EWrapper self, TickerId tickerId, TickType tickType, double impliedVol, double delta, double optPrice, double pvDividend, double gamma, double vega, double theta, double undPrice)
def tickOptionComputation(self, tickerId, tickType, impliedVol, delta, optPrice, pvDividend, gamma, vega, theta, undP... |
tickGeneric(EWrapper self, TickerId tickerId, TickType tickType, double value)
def tickGeneric(self, tickerId, tickType, value):
"""tickGeneric(EWrapper self, TickerId tickerId, TickType tickType, double value)"""
return _swigibpy.EWrapper_tickGeneric(self, tickerId, tickType, value) |
tickString(EWrapper self, TickerId tickerId, TickType tickType, IBString const & value)
def tickString(self, tickerId, tickType, value):
"""tickString(EWrapper self, TickerId tickerId, TickType tickType, IBString const & value)"""
return _swigibpy.EWrapper_tickString(self, tickerId, tickType, value) |
tickEFP(EWrapper self, TickerId tickerId, TickType tickType, double basisPoints, IBString const & formattedBasisPoints, double totalDividends, int holdDays, IBString const & futureExpiry, double dividendImpact, double dividendsToExpiry)
def tickEFP(self, tickerId, tickType, basisPoints, formattedBasisPoints, totalDivi... |
orderStatus(EWrapper self, OrderId orderId, IBString const & status, int filled, int remaining, double avgFillPrice, int permId, int parentId, double lastFillPrice, int clientId, IBString const & whyHeld)
def orderStatus(self, orderId, status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId,... |
openOrder(EWrapper self, OrderId orderId, Contract arg0, Order arg1, OrderState arg2)
def openOrder(self, orderId, arg0, arg1, arg2):
"""openOrder(EWrapper self, OrderId orderId, Contract arg0, Order arg1, OrderState arg2)"""
return _swigibpy.EWrapper_openOrder(self, orderId, arg0, arg1, arg2) |
updateAccountValue(EWrapper self, IBString const & key, IBString const & val, IBString const & currency, IBString const & accountName)
def updateAccountValue(self, key, val, currency, accountName):
"""updateAccountValue(EWrapper self, IBString const & key, IBString const & val, IBString const & currency, IBStr... |
updatePortfolio(EWrapper self, Contract contract, int position, double marketPrice, double marketValue, double averageCost, double unrealizedPNL, double realizedPNL, IBString const & accountName)
def updatePortfolio(self, contract, position, marketPrice, marketValue, averageCost, unrealizedPNL, realizedPNL, accountNam... |
execDetails(EWrapper self, int reqId, Contract contract, Execution execution)
def execDetails(self, reqId, contract, execution):
"""execDetails(EWrapper self, int reqId, Contract contract, Execution execution)"""
return _swigibpy.EWrapper_execDetails(self, reqId, contract, execution) |
Error during communication with TWS
def error(self, id, errorCode, errorString):
'''Error during communication with TWS'''
if errorCode == 165: # Historical data sevice message
sys.stderr.write("TWS INFO - %s: %s\n" % (errorCode, errorString))
elif errorCode >= 501 and errorCode < 6... |
updateMktDepth(EWrapper self, TickerId id, int position, int operation, int side, double price, int size)
def updateMktDepth(self, id, position, operation, side, price, size):
"""updateMktDepth(EWrapper self, TickerId id, int position, int operation, int side, double price, int size)"""
return _swigibp... |
updateMktDepthL2(EWrapper self, TickerId id, int position, IBString marketMaker, int operation, int side, double price, int size)
def updateMktDepthL2(self, id, position, marketMaker, operation, side, price, size):
"""updateMktDepthL2(EWrapper self, TickerId id, int position, IBString marketMaker, int operatio... |
updateNewsBulletin(EWrapper self, int msgId, int msgType, IBString const & newsMessage, IBString const & originExch)
def updateNewsBulletin(self, msgId, msgType, newsMessage, originExch):
"""updateNewsBulletin(EWrapper self, int msgId, int msgType, IBString const & newsMessage, IBString const & originExch)"""
... |
historicalData(EWrapper self, TickerId reqId, IBString const & date, double open, double high, double low, double close, int volume, int barCount, double WAP, int hasGaps)
def historicalData(self, reqId, date, open, high, low, close, volume, barCount, WAP, hasGaps):
"""historicalData(EWrapper self, TickerId re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.