achoudh5 / Manipulating_Excel_Sheet

Real world application of Manipulating Excel Sheet using python.
Apache License 2.0
8 stars 14 forks source link

Added valid_ip.py file to iterate over the rows and validate IP addresses #4

Closed aparharsh closed 3 years ago

aparharsh commented 3 years ago

Completed the Issue #1 . Reads an excel sheet. Takes a list of column indices as input, which needs to be checked. Process the cell values to make a valid IP address string. Validate the processed string. Append in a list of dictionary. At last, printing the output.

achoudh5 commented 3 years ago

@aparharsh It's a great start, can you solve these edge cases as well for this script. Ask any questions you might have :)

aparharsh commented 3 years ago

Apologies, but I am not able to understand these edge cases.

Can you add these in the input excel sheet and commit them, so that I can pull the changes and work through it?

achoudh5 commented 3 years ago

Apologies, but I am not able to understand these edge cases.

Can you add these in the input excel sheet and commit them, so that I can pull the changes and work through it?

Added new input sheet with cases.

aparharsh commented 3 years ago

I have made the required changes. Can you review it?

achoudh5 commented 3 years ago

@aparharsh Looks perfect for first iteration input file. What if the cell value is a network? Ex. rather than 1.2.3.4 it can be 1.2.3.0/24 This script is not taking networks into account, do you think you can do it ? I can merge this file since your initial task is working great!

aparharsh commented 3 years ago

Thanks You! Yes, you can merge. I do not have knowledge about networks. If you can update the excel sheet with new cases, regarding these networks, and can tell me the output. I'll do that too.

Update: As much I have understood, I just need to remove the "/24" from the addresses and validate. Am I right? Also, can you give some more examples of networks (eg., if they can consists of multiple slashes "/", etc.) ?

achoudh5 commented 3 years ago

Thanks You! Yes, you can merge. I do not have knowledge about networks. If you can update the excel sheet with new cases, regarding these networks, and can tell me the output. I'll do that too.

I added a new case, check it out! Meanwhile I will merge this one :) Thank you for your contribution, checkout a new issue to clean zip.py as well!

achoudh5 commented 3 years ago

@aparharsh in Hacktoberfest_Inputt I have /23, I expect you to tweak code for valid_ip.py a bit where the mapping output should be like:-

{'Source': '6.214.16.167', 'Destination': '6.208.46.246/23, 6.208.48.81, 6.208.48.48'}

After using cal you will get these:- (it's just a checker) Address: 6.208.46.246
Netmask: 255.255.254.0 = 23
Wildcard: 0.0.1.255
=> Network: 6.208.46.0/23
Broadcast: 6.208.47.255
HostMin: 6.208.46.1
HostMax: 6.208.47.254

basically it means 6.208.46.0/23 contains ip 6.208.46.1 to 6.208.47.254 . If it's tedius , leave it and grab the zip.py issue 👯‍♂️

tanya3007 commented 3 years ago

@achoudh5 I went through the code, and have some thoughts on the changes needed to be done for handling the network cases. I also have experience with Python.

Can I make a PR and make the changes?

aparharsh commented 3 years ago

Hey @achoudh5 , Since, I have completed my PR. It would be better if further changes are done by @tanya3007 . So that she can also contribute.

achoudh5 commented 3 years ago

Hi @tanya3007

I would love to see those edge cases which can bolster this script, I would recommend to checkout zip.py file because I will be using some part of valid_ip.py in that script. I am updating the zip.py (I am removing the org details, I have most part working but if you have understanding of networking I would urge ou to look and improve that script)

achoudh5 commented 3 years ago

Hey @achoudh5 , Since, I have completed my PR. It would be better if further changes are done by @tanya3007 . So that she can also contribute.

Thank you @aparharsh for your contribution! Best of luck for your future 👍

tanya3007 commented 3 years ago

@achoudh5 I will make a PR to this valid_ip.py script, which would include the code for these edge test cases. I do not have knowledge regards networking as I have not worked in this field. But, I'll have a look to check if something can be done.

tanya3007 commented 3 years ago

@achoudh5 Just made the changes. Can you check them?