straph.parser package¶
Submodules¶
straph.parser.parser module¶
-
straph.parser.parser.
approximate_events
(W, E, delta)[source]¶ Approximation method reducing the number of distinct event times while preserving connectivity properties of the original dataset.
- Parameters
-
W –
E –
delta –
- Returns
-
straph.parser.parser.
inet_to_str
(inet)[source]¶ Convert inet object to a string
- Parameters
inet – inet network address
- Returns
str: Printable/readable IP address
-
straph.parser.parser.
parse_csv
(input_file, entry_format, **kwargs)[source]¶ Reader for .csv files
- Parameters
-
input_file –
entry_format –
kwargs –
- Returns
-
straph.parser.parser.
parse_json
(input_file, entry_format, **kwargs)[source]¶ A Stream Graph reader for JSON dataset.
- Parameters
-
input_file –
entry_format –
kwargs –
- Returns
-
straph.parser.parser.
parse_link_stream
(input_file)[source]¶ Parse link stream format: alpha t0 omega t1 b e u v . . . b e v w
- Parameters
input_file –
- Returns
-
straph.parser.parser.
parse_net
(input_file, output_file_nodes, output_file_links, link_duration=1)[source]¶ A Stream Graph reader for dataset issued by Pajek
Format of interactions : .net :param input_file: :param output_file_nodes: :param output_file_links: :param link_duration: :return:
-
straph.parser.parser.
parser
(input_file, input_format, entry_format, output_file=None, simplify_presence=False, output_format='sg', **kwargs)[source]¶ Straph’s tunable parser. Compatible with several data formats: CSV, TSV, JSon and PCAP.
- Parameters
-
simplify_presence –
input_file – Input FILE (name only)
input_format – Format d’entrée acceptés : JSON, CSV, PCAP
entry_format – Format of each line to be readed (t,u,v) = (line[x],line[y],line[w])
output_file – Output FILE (name only)
output_format – Format de sortie : SG,SGF,json
- Returns