semvec/pypi-packages huggingface dataset:
ovsportranges 0.1.2
OVS bitwise port/mask ranges
License: MIT
Requires Python: >2.7
Keywords: openflow port ranges ovs ofctl

# ovsportranges

### Description
Openflow requires port ranges to be defined as bitwise matches. This module 
provides an easy way to the port/mask ranges for a specified port range.

As described in the [ovs-ofctl](http://www.openvswitch.org/support/dist-docs-2.5/ovs-ofctl.8.txt) documentation:
> Bitwise  match  on  TCP  (or  UDP or SCTP) source or destination
> port.  The port and mask are 16-bit numbers written  in  decimal
> or  in  hexadecimal prefixed by 0x.  Each 1-bit in mask requires
> that the corresponding bit in port must match.   Each  0-bit  in
> mask causes the corresponding bit to be ignored.

It is recommended to only use this for large ranges that would require a large number of flows.

### Installation
`pip install ovsportranges`

### Basic Usage
``` python
from ovsportrange import OvsPorts

if __name__ == "__main__":
    ovsports = OvsPorts()
    ranges = ovsports.get_port_ranges(1000, 1999)
    for r in ranges:
        print("Port: {}, Bitmask: {}".format(r.port, r.bitmask))
```

### Output
```text
Port: 1000, Bitmask: 65528
Port: 1008, Bitmask: 65520
Port: 1024, Bitmask: 65024
Port: 1536, Bitmask: 65280
Port: 1792, Bitmask: 65408
Port: 1920, Bitmask: 65472
Port: 1984, Bitmask: 65520
```
pycmds 1.0.4
Wrapper around Click python library
License: MIT

PyCmds
======

A wrapper around the `Click <http://click.pocoo.org/5/>`_
library for Python. PyCmds makes it easier to use Click's command execution
framework independently of the command line (i.e. executing Click
``Command``\s in an existing Python instance.)

To accompany this, PyCmds adds a ``CmdCompleter`` class which implements the
``Completer`` interface from the
`python-prompt-toolkit <https://github.com/jonathanslenders/python-prompt-toolkit>`_.
Using this class, one may create a python-prompt-toolkit interface with
intelligent (see below) autocompletion for Click ``Command``\s and ``Option``\s.

Also, PyCmds adds an ``AliasGroup`` class to allow the assignment of aliases
to Click ``Command``\s.

``CmdCompleter`` Features
-------------------------

- Only displays completion menu when the completer is certain of what
  options or subcommands are valid. (E.g. no naive option or subcommand
  suggestions when Click is expecting a value for a previous option.)
- Considers ``click.Option.is_flag`` and ``click.Parameter.nargs`` to
  decide how many values a option should consume.
- Considers ``click.Option.count`` and ``click.Option.multiple`` to decide
  if more than one instance of the same option should be permitted.
- Smart autocompletion for grouped short flags with or without a value
  clustered on the end.

Important Notes About ``CmdCompleter``
--------------------------------------

- Designed primarily for POSIX-style options.
- Only context settings specified on the root/top-level ``Command`` will
  be considered (by necessity).
- Incompatible with ``click.Context.allow_interspersed_args``.
- Incompatible with ``click.Context.ignore_unknown_opts``.
- Incompatible with ``click.MultiCommand.chain``.
- The split character for parameters with nargs > 1 is expected to be a
  space.