# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['traffictoll']

package_data = \
{'': ['*']}

install_requires = \
['loguru>=0.4.1,<0.5.0', 'psutil>=5.6.7,<6.0.0', 'ruamel.yamL>=0.16.6,<0.17.0']

entry_points = \
{'console_scripts': ['tt = traffictoll.__main__:main']}

setup_kwargs = {
    'name': 'traffictoll',
    'version': '1.4.0',
    'description': 'NetLimiter-like bandwidth limiting and QoS for Linux',
    'long_description': '# TrafficToll\nNetLimiter-like bandwidth limiting and QoS for Linux\n\n# Description\nTrafficToll allows you to limit download and upload bandwidth globally (per interface)\nand per process, even during the process\' runtime. Additionally it also allows you to\nmake use of QoS traffic prioritization for different processes.\n\nThe configuration can be easily adjusted and new limits and priorities applied at any\npoint, as opposed to similar tools which either can only apply fixed global limits to\nthe interface, certain ports, or require you to start the process through them (and thus\nrestart the target process to change the limits).\n\n# Usage\n`# tt device config`\n\nWhere `device` is the interface you want to limit (usually the one you\nconnect to the internet with). For example:\n\n* `# tt enp3s0 night.yaml --delay 0.5` (regular interface, check every\nhalf second for change in networked processes)\n* `# tt tun0 day.yaml --logging-level DEBUG` (VPN interface, adjust\nlogging level to DEBUG)\n\nCurrently TrafficToll works based on a YAML configuration file. The configuration file\nis best explained by example:\n\n```YAML\n# The rate limits for the specified interface. Specifying these values is useful for two\n# things: 1) you want to limit the used bandwidth for the entire interface or 2) you\n# want to make use of traffic prioritization.\n\n# If you want to 1) limit the used bandwidth for the entire interface, simply specify\n# values below your actual speed: the traffic will be shaped in such a way, that it does\n# not exceed the specified numbers.\n\n# If you want to 2) make use of the traffic prioritization feature, these values must be\n# as close as possible to your real speed: if they are too low, traffic prioritization\n# will work, but you are losing part of your bandwidth; if they are too high, traffic\n# prioritization won\'t work as well as it could. I recommend you use some internet speed\n# test you can find online to get an approximation for the correct values.\n\n# If you don\'t want to do 1) or 2), you can omit these values. Bandwidth limiting per\n# application will still work, just traffic prioritization won\'t work as well or\n# entirely.\ndownload: 5mbps\nupload: 1mbps\n\n# Guaranteed download and upload rates for all global traffic that is not shaped as part\n# of a matched process by TrafficToll. The idea here is to leave enough "guaranteed"\n# bandwidth to all applications not defined in "processes", so that they are not starved\n# to a bandwidth, by processes with higher priority, that would cause the other IP to\n# drop the connection. These are the default values, if omitted. Keep in mind that this\n# doesn\'t reserve the bandwidth -- if this traffic is not made use of, it\'s available\n# to processes with higher priority.\ndownload-minimum: 100kbps\nupload-minimum: 10kbps\n\n# A list of processes you want to match and their respective settings\nprocesses:\n  # You can name the process what you want, it is only used to identify it on the CLI\n  # output\n  "Path of Exile":\n    # Adjust the traffic priority to 0 (highest possible, higher integers mean _lower_\n    # priority) to prevent lag and high pings in the game even when we create heavy\n    # traffic otherwise. If these priorities are omitted, they will default to 0: the\n    # same priority for all the traffic on the interface. As soon as you explicitly\n    # specify a priority for a process, the other traffic on the interface will get a\n    # lower priority, so will other processes where you did not explicitly specify\n    # another priority. In this case "Path of Exile" traffic will have a priority of 0,\n    # the highest, and the interface traffic and other processes will have a priority of\n    # 1.\n    download-priority: 0\n    upload-priority: 0\n\n    # Download and upload rate limits can be entirely omitted if you don\'t want to apply\n    # any, in this case traffic will only be prioritized like specified.\n    #download:\n    #upload:\n\n    # The match section. A process is selected when all predicates in the match section\n    # match. Every attribute psutil.Process\n    # (https://psutil.readthedocs.io/en/latest/index.html#psutil.Process) provides on\n    # Linux can be matched on, using regular expressions. Integer attributes will be\n    # treated as strings and list attributes will be joined using a space before\n    # matching. If you want to, you can also specify a regular expression with an OR\n    # operator and match many processes which will all share the specified bandwidth\n    # limit or traffic priority.\n    # If you do not see a line starting with "Shaping traffic for..." with your process\n    # name in it, while it is clearly causing traffic, your match section is failing.\n    # Please make sure it works correctly.\n    match:\n      - name: "PathOfExile_x64"\n\n  Vivaldi:\n    # Additionally specify fixed bandwidth limits for the browser. Setting bandwidth\n    # limits higher than the interface limits will not work. Different processes\n    # borrow available traffic from the interface limits using their specified priority.\n    download: 2500kbps\n    upload: 500kbps\n\n    # Explicitly set a lower download and upload priority to Path of Exile so our\n    # browsing does not cause the game\'s ping to spike. This would have happened\n    # automatically if we omitted it, because we specified a priority for "Path of\n    # Exile" -- we are just doing it here for clarity.\n    download-priority: 1\n    upload-priority: 1\n    match:\n      - exe: /opt/vivaldi/vivaldi-bin\n\n  Discord:\n    # Set Discord\'s traffic priority to the lowest: this means if we create traffic via\n    # either "Path of Exile" or "Vivaldi" it will get priority and Discord\'s latency and\n    # traffic will slow down accordingly\n    download-priority: 2\n    upload-priority: 2\n\n    # Additionally specify fixed bandwidth limits for Discord. Please note that just\n    # because we specified 50% of the interface bandwidth for "Vivaldi" and "Discord"\n    # each, does not mean "Path of Exile" or other processes will be starved for\n    # traffic: Because we omitted download and upload limits for "Path of Exile" 100% of\n    # the interface rate is automatically assumed for that process, in this case\n    # 5mbps/1mbps. Additionally, because "Path of Exile" has a higher priority than\n    # either of the two, in the extreme case that Vivaldi and Discord utilize their\n    # bandwidth limits fully (and thus the entire interface\'s speed), "Path of Exile"\n    # traffic will get priority and traffic for Vivaldi and Discord will be\n    # appropriately reduced.\n    download: 2500kbps\n    upload: 500kbps\n\n    match:\n      - exe: /opt/discord/Discord\n\n  Riot:\n    download-priority: 2\n    upload-priority: 2\n\n    # The process that actually creates network traffic for electron-based applications\n    # is not uniquely identifiable. Instead we match a uniquely identifiable parent\n    # process, in this case "riot-desktop", and set recursive to True. This instructs\n    # TrafficToll to traffic shape the connections of the matched process and all its\n    # descendants\n    recursive: True\n    match:\n      - name: riot-desktop\n\n  JDownloader 2:\n    download: 300kbps\n    # The download-priority and upload-priority if omitted while another process\n    # explicitly specifies them will automatically be the lowest: in this case 2, the\n    # same as "Discord", our lowest priority process.\n\n    # Since the download and upload priority of this process is the lowest, make sure\n    # that its connections don\'t starve when processes with higher priority use up all\n    # the available bandwidth. These are the default values for each process and will be\n    # applied if omitted.\n    download-minimum: 10kbps\n    upload-minimum: 1kbps\n\n    # JDownloader 2 obviously has its own bandwidth limiting, this is just here as an\n    # example to show that matching on something else than the executable\'s name and\n    # path is possible\n    match:\n      - cmdline: .* JDownloader.jar\n```\n\nUnits can be specified in all formats that `tc` supports, namely: bit (with and without\nsuffix), kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps. To specify in IEC units,\nreplace the SI prefix (k-, m-, g-, t-) with IEC prefix (ki-, mi-, gi- and ti-)\nrespectively.\n\nAll limits and priorities can be omitted, in which case obviously no traffic shaping\nwill be applied. A process is selected when all predicates in the match section match.\nEvery attribute\n[`psutil.Process`](https://psutil.readthedocs.io/en/latest/index.html#psutil.Process)\nprovides on Linux can be matched on, using regular expressions.\n\nWhen you terminate `tt` using Ctrl+C all changes to the traffic scheduling will be\nreverted, allowing you to easily update the config and apply new limits.\n\n# Installation\n`$ pip install traffictoll`\n\n`tt` has to be run as root.\n\n# Screenshots\nBecause a picture is always nice, even for CLI applications:\n\n![](https://i.imgur.com/a3U5Zdt.png)\n',
    'author': 'Chris Braun',
    'author_email': 'cryzed@googlemail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/cryzed/TrafficToll',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.6,<4.0',
}


setup(**setup_kwargs)
