semvec/pypi-packages huggingface dataset:
iptoolkit 0.0.0
Tools needed to work with IPs
License: MIT
Keywords: iptoolkit



<div align="center">

# iptoolbox
### `iptoolbox` is a tool for purposefully creating IP, testing and scanning it

<br><br><br><br><br><br><br><br><br><br>

</div>





----

## Features {#features}
- `RandomIp4` class is for creating random IP

----

- ## class `RandomIp4(country_code: set = "ALL", random_seed=None)` 

    RandomIp4 class is for creating random IP
 
    - Parameters:
        - `country_code` (`set`, optional): - Enter the country code or you can enter `ALL` instead of the country code. In this case, the generated IP can be for any country . Defaults to `ALL`.
        - `random_seed` (`str` or `int`, optional): - used to initialize the random ip generator . Defaults to None.
    - Returns 
        - type: None


    - ### method `generate_ip()` </h4>  
    
        RandomIp4 class is for creating random IP


        * Returns:
            * `str`: ip v4




- ## Examples `RandomIp4` :


    - #### simple :
        ```
        import ip2kit
        r = ip2kit.RandomIp4()
        print(r.generate_ip())
        ```
        `139.81.25.43`


    - #### using with :
        ```
        import ip2kit
        with ip2kit.RandomIp4(country_code="IR") as r:
            print(r.generate_ip())
        ```
        `185.8.173.203`


    - #### using a for loop :
        ```
        import ip2kit
        with ip2kit.RandomIp4(country_code="US") as r:
            for _ in range(10): 
                r.generate_ip()
            print(r.ip_list)
        ```
        `['205.252.16.87', '50.0.53.6', '154.26.1.61', '149.14.14.36', '130.244.138.15', '151.139.41.225', '200.186.105.44', '220.158.255.80', '199.180.221.10', '69.172.213.166']`


    - #### using seed :
        ```
        import ip2kit
        with ip2kit.RandomIp4(country_code="US", random_seed=24) as r:
            for _ in range(10): 
                r.generate_ip()
            print(r.ip_list)
        ```
        `['204.246.205.39', '216.250.193.77', '63.218.150.66', '63.110.213.250', '63.146.54.87', '199.189.209.223', '204.98.216.96', '213.151.35.145', '206.71.103.208', '130.244.2.49']`



--------------------<=[ change log ]=>--------------------

0.0.1 (2022-08-26 / Friday - 2022 26 August )
- First Release