semvec/pypi-packages huggingface dataset:
moreFunctions 1.0.2
A compilation of additional functions for use in varying purposes in Python
License: MIT
Keywords: functions

AVAILABLE FUNCTIONS:

replace_char_in_string(string: str, newChar: str, index: int) -> str
    - Replaces char in string(str) at position index(int) with newChar(str). Returns str.

list_to_string(changeList: list) -> str
    - Converts changeList(list) to str. Returns str.

to_list(to_list) -> list
    - Converts to_list to list. Works with both str and int. Returns list

list_to_2d_list(changeList: list) -> list
    - Converts changeList(list) to 2-dimensional list. Returns list

get_key(dictionary: dict, value)
    - Returns key of value in dictionary(dict)

is_vowel(string: str) -> bool
    - Returns True if all char in string(str) is a vowel. Returns False if not.

remove_char_in_string(string: str, index: int) -> str
    - Removes char in string(str) at index(int). Returns str

get_divisors(number: int) -> list
    - Returns list of divisors of number(int)

is_palindrome(toCheck) -> bool
    - Returns True if toCheck is palindrome. Returns False if not. Works on str and int.

is_even(number: int) -> bool
    - Returns True if number(int) is even. Returns False if not.

is_prime(number: int) -> bool
    - Returns True if number(int) is prime. Returns False if not.



Change Log
==========

1.0.1 (27/07/2020)
------------------
- Addition of type hints to functions
- Updated README

1.0.2 (27/07/2020)
------------------
- Fix README formatting
sipcounter 0.0.3
SIP message counter
License: MIT
Requires Python: >=2.7
Keywords: VoIP telephony SIP protocol message counter

# sipcounter
This module implements a simple, stateless SIP message counter with optional message flow direction, IP address, protocol and port tracking. When the IP address/protocol/port of the communicating hosts are supplied in addition to the SIP message body it counts the SIP requests and responses for each communication link separately. A link thus is comprised of the SIP UA server and client IP address, the server and client side ports and the transport protocol type (TLS, TCP, UDP) which can also be inferred from the SIP message body if not provided. It's 'data' dictionary holds the links as keys and a dictionary for each link as values which hold another layer of dictionaries, one for each direction and Counters as values that keep track of the number of SIP message types sent or received in that direction.
For quick visualization it comes with a 'tostring' convenience method and numerous other similar to those available for the Counter class from the collections module and more.

### Example ###
To count the number of INVITE and ReINVITE messages and any error responses (4xx, 5xx, 6xx) received in INVITE dialogs:

```
>>> from sipcounter import SIPCounter
>>> reader = sip_msg_reader()
>>> c = SIPCounter(name='SBC Cone-A', sip_filter=set(['INVITE', '4', '5', '6']))
>>> while True:
...     try:
...         # the 'reader' is SIP log parser generator
...         timestamp, sipmsg, msgdir, srcip, srcport, dstip, dstport = next(reader)
...         c.add(sipmsg, msgdir, srcip, srcport, dstip, dstport)
...     except:
...         print(c.tostring(title='2020-0101 01:01:00'))
...         break
KeyboardInterrupt

    2020-0101 01:01:00          INVITE   ReINVITE    503       600    TOTAL
    SBC Cone-A                ---> <--- ---> <--- ---> <--- ---> <---
    1.1.1.1-TCP-5060-2.2.2.1    13   10   40   40    0    0    0    0   103
    1.1.1.1-TLS-5061-2.2.2.1    13   10   36   42    1    0    1    0   103
    SUMMARY                     26   20   76   82    1    0    1    0   206
```
## Requirements

- Python 2.7-3.x

## License

MIT, see: LICENSE.txt

## Author

Szabolcs Szokoly <a href="mailto:sszokoly@pm.me">sszokoly@pm.me</a>