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.datetime_to_timestamp(s)[source]
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

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.parse_pcap(file_input, entry_format, **options)[source]
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

straph.parser.parser.pcap_to_csv(file_input, destination, protocol=None)[source]

Transform a pcap file to a csv

Parameters
  • file_input

  • destination

  • protocol

Returns

straph.parser.parser.sort_csv(input_file, entry_format, output=None, **kwargs)[source]

Module contents