netzschleuder
list_netzschleuder_records
¶
Read a list of data sets available at the netzschleuder repository.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url |
str
|
Base URL of netzschleuder repository |
'https://networks.skewed.de'
|
**kwargs |
typing.Any
|
Keyword arguments that will be passed to the netzschleuder repository as HTTP GET parameters. For supported parameters see https://networks.skewed.de/api |
{}
|
Examples:
Return a list of all data sets
>>> import pathpy as pp
>>> pp.io.graphtool.list_netzschleuder_records()
['karate', 'reality_mining', 'sp_hypertext', ...]
Return a list of all data sets with a given tag
>>> pp.io.graphtool.list_netzschleuder_records(tags='temporal')
['reality_mining', 'sp_hypertext', ...]
Return a dictionary containing all data set names (keys) as well as all network attributes
>>> pp.io.graphtool.list_netzschleuder_records(full=True)
{ 'reality_mining': [...], 'karate': [...] }
Returns:
Type | Description |
---|---|
typing.Union[list, dict]
|
Either a list of data set names or a dictionary containing all data set names and network attributes. |
Source code in src/pathpyG/io/netzschleuder.py
parse_graphtool_format
¶
Decodes data in graphtool binary format and returns a Graph
. For a documentation of
hte graphtool binary format, see see doc at https://graph-tool.skewed.de/static/doc/gt_format.html
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
bytes
|
Array of bys to be decoded |
required |
ignore_temporal |
If False, this function will return a static or temporal network depending on whether edges contain a time attribute. If True, pathpy will not interpret time attributes and thus always return a static network. |
required |
Returns:
Type | Description |
---|---|
pathpyG.core.Graph.Graph
|
Network or TemporalNetwork: a static or temporal network object |
Source code in src/pathpyG/io/netzschleuder.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
|
read_graphtool
¶
Read a file in graphtool binary format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file |
str
|
Path to graphtool file to be read |
required |
Source code in src/pathpyG/io/netzschleuder.py
read_netzschleuder_network
¶
Read a pathpy network record from the netzschleuder repository.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the network data sets to read from |
required |
net |
typing.Optional[str]
|
Identifier of the network within the data set to read. For data sets containing a single network only, this can be set to None. |
None
|
ignore_temporal |
bool
|
If False, this function will return a static or temporal network depending on whether edges contain a time attribute. If True, pathpy will not interpret time attributes and thus always return a static network. |
False
|
base_url |
str
|
Base URL of netzschleuder repository |
'https://networks.skewed.de'
|
Examples:
Read network '77' from karate club data set
>>> import pathpy as pp
>>> n = pp.io.graphtool.read_netzschleuder_network('karate', '77')
>>> print(type(n))
>>> pp.plot(n)
pp.Network
Read a temporal network from a data set containing a single network only (i.e. net can be omitted):
>>> n = pp.io.graphtool.read_netzschleuder_network('reality_mining')
>>> print(type(n))
>>> pp.plot(n)
pp.TemporalNetwork
Read temporal network but ignore time attribute of edges:
>>> n = pp.io.graphtool.read_netzschleuder_network('reality_mining', ignore_temporal=True)
>>> print(type(n))
>>> pp.plot(n)
pp.Network
Returns:
Type | Description |
---|---|
typing.Union[pathpyG.core.Graph.Graph, pathpyG.core.TemporalGraph.TemporalGraph]
|
Depending on whether the network data set contains an edge attribute |
typing.Union[pathpyG.core.Graph.Graph, pathpyG.core.TemporalGraph.TemporalGraph]
|
|
typing.Union[pathpyG.core.Graph.Graph, pathpyG.core.TemporalGraph.TemporalGraph]
|
returns an instance of Network or TemporalNetwork |
Source code in src/pathpyG/io/netzschleuder.py
read_netzschleuder_record
¶
Read metadata of a single data record with given name from the netzschleuder repository
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the data set for which to retrieve the metadata |
required |
base_url |
str
|
Base URL of netzschleuder repository |
'https://networks.skewed.de'
|
Examples:
Retrieve metadata of karate club network
>>> import pathpy as pp
>>> metdata = pp.io.graphtool.read_netzschleuder_record('karate')
>>> print(metadata)
{
'analyses': {'77': {'average_degree': 4.52... } }
}
Returns:
Type | Description |
---|---|
dict
|
Dictionary containing key-value pairs of metadata |