Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Community ID flow hashing

Project description


This package provides a Python implementation of the open Community ID flow hashing standard.

It supports Python versions 2.7+ and 3+.


This package is available on PyPI, therefore:

pip install communityid

To install locally from a git clone, you can use also use pip, e.g. by saying

pip install -U .


The API breaks the computation into two steps: (1) creation of a flow tuple object, (2) computation of the Community ID string on this object. It supports various input types in order to accommodate network byte order representations of flow endpoints, high-level ASCII, and ipaddress objects.

Here's what it looks like:

import communityid

cid = communityid.CommunityID()
tpl = communityid.FlowTuple.make_tcp('', '', 1234, 80)


This will print "1:mgRgpIZSu0KHDp/QrtcWZpkJpMU=".

The package includes three sample applications:

  • community-id, which calculates the ID directly for given flow tuples. It supports a small but growing list of parsers. Example:

    $ community-id tcp 10 20
  • community-id-pcap, which iterates over a pcap via dpkt and renders Community ID values for each suitable packet in the trace. This exercices the package's "low-level" API, using flow tuple values as you'd encounter them in a typical network monitor.

  • community-id-tcpdump, which takes tcpdump output on stdin and augments it with Community ID values on stdout. This exercices the package's "high-level" API, using ASCII representations of tuple values.


The package includes a unittest testsuite in the tests directory that runs without installation of the module. You can invoke it as usual, e.g. via:

python -m unittest communityid_test


nose2 -C --coverage ../communityid --coverage-report term-missing communityid_test

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for communityid, version 1.2
Filename, size File type Python version Upload date Hashes
Filename, size communityid-1.2-py3-none-any.whl (15.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size communityid-1.2.tar.gz (12.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page