https://github.com/nullhypothesis/zoossh
Parsing library for Tor-specific data formats.
https://github.com/nullhypothesis/zoossh
go parser tor tor-network
Last synced: 6 months ago
JSON representation
Parsing library for Tor-specific data formats.
- Host: GitHub
- URL: https://github.com/nullhypothesis/zoossh
- Owner: NullHypothesis
- License: bsd-2-clause
- Created: 2014-12-01T13:41:26.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-09-15T13:16:05.000Z (over 2 years ago)
- Last Synced: 2024-06-19T23:23:47.622Z (over 1 year ago)
- Topics: go, parser, tor, tor-network
- Language: Go
- Homepage: https://nymity.ch/sybilhunting/
- Size: 1.66 MB
- Stars: 44
- Watchers: 5
- Forks: 20
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

=================================================================
[](https://travis-ci.org/NullHypothesis/zoossh)
Overview
--------
Zoossh is a Go parsing library for Tor-specific data formats. It can parse
consensuses and server descriptors. I originally wrote zoossh as a speedy
fundament for [sybilhunter](https://github.com/NullHypothesis/sybilhunter), a
tool to find Sybils in the Tor network. I have no need for other file types, so
if zoossh doesn't provide what you need, check out the libraries below.
Supported file formats
----------------------
Zoossh partially supports the following two file formats:
* Server descriptors (`@type server-descriptor 1.0`)
* Network status consensuses (`@type network-status-consensus-3 1.0`)
For more information about file formats, have a look at
[CollecTor](https://metrics.torproject.org/collector.html#data-formats).
Examples
--------
Here's how you can parse a network status document and iterate over all relay
statuses:
consensus, err := zoossh.ParseConsensusFile(fileName)
if err != nil {
// Handle error.
}
for status := range consensus.Iterate(nil) {
fmt.Println(status)
}
Similarly, here's how you can parse a file containing server descriptors:
descriptors, err := zoossh.ParseDescriptorFile(fileName)
if err != nil {
// Handle error.
}
for desc := range descriptors.Iterate(nil) {
fmt.Println(desc)
}
For more details, have a look at zoossh's
[GoDoc page](https://godoc.org/github.com/NullHypothesis/zoossh).
Alternatives
------------
Check out the Python library [Stem](https://stem.torproject.org) or the Java
library [metrics-lib](https://gitweb.torproject.org/metrics-lib.git). Both
have more comprehensive support for data formats. There is also a
[comparison available online](https://stem.torproject.org/tutorials/mirror_mirror_on_the_wall.html#are-there-any-other-parsing-libraries)
between Stem, metrics-lib, and zoossh.
Contact
-------
Contact: Philipp Winter
OpenPGP fingerprint: `B369 E7A2 18FE CEAD EB96 8C73 CF70 89E3 D7FD C0D0`