Created
April 19, 2018 18:04
-
-
Save tiagocordeiro/5102029271bbb1ec644ea2f2506c7ba5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xmltodict | |
import csv | |
with open('nfe_entrada_mock.xml') as fd: | |
nfe = xmltodict.parse(fd.read()) | |
nfe_id = nfe['nfeProc']['NFe']['infNFe']['@Id'] # infNFe Id | |
itens = nfe['nfeProc']['NFe']['infNFe']['det'] | |
print("NFe: ", nfe_id) | |
print("NCM | Equipamento") | |
for item in itens: | |
print(item['prod']['NCM'], "|", item['prod']['xProd']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment