Closed aparharsh closed 3 years ago
I checked with couple of use cases, somehow the dictionary values are cached and doesn't change even though I saved the excel sheet with new values.
I tried with delimeters of space and comma but it's not detecting
i=input('Enter the name of file:\n')
wb = openpyxl.load_workbook(i)
@aparharsh It's a great start, can you solve these edge cases as well for this script. Ask any questions you might have :)
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?
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.
I have made the required changes. Can you review it?
@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!
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.) ?
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!
@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'}
No, it would be just a single slash '/' only
Pull & Fetch to refresh excel files to get the latest updates
If you have not enough knowledge of networks we can leave validation part for now but if you interested check http://jodies.de/ipcalc A subnet i.e 6.208.46.246/23 would contain
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 👯♂️
@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?
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.
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)
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 👍
@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.
@achoudh5 Just made the changes. Can you check them?
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.