Skip to main content

lgpdXml

1 - pip Install

pip install lgpdXml

2 - example find value of tag

#library
from lgpdXml import find, replace

#text
xml = '''<CNPJ>012.345.678/0001-01</CNPJ>
<NOMERAZAO>CLAUDIO TORRES ARBE</NOMERAZAO>
<CNPJ>001.001.001/0001-01</CNPJ>'''

#find using tag
nome = find(xml,'<NOMERAZAO>','</NOMERAZAO>')

#result
print(nome)

#all results of tag
cnpj = find(xml,'<CNPJ>','</CNPJ>')

#results
print(cnpj)

#specifying the index
cnpj = find(xml,'<CNPJ>','</CNPJ>')[1]

#result
print(cnpj)

#looking for tag that doesn't exist
email = find(xml,'<EMAIL>','</EMAIL>')

#result
print(email)

3 - example replace value

#library
from lgpdXml import find, replace

#text
xml = '''<CNPJ>012.345.678/0001-01</CNPJ>
<NOMERAZAO>CLAUDIO TORRES ARBE</NOMERAZAO>
<CNPJ>001.001.001/0001-01</CNPJ>'''

#find using tag
nome = find(xml,'<NOMERAZAO>','</NOMERAZAO>')[0]

#all results of tag
cnpj = find(xml,'<CNPJ>','</CNPJ>')[1]

#replace tag
xml = replace(xml,'****','<NOMERAZAO>',nome,'</NOMERAZAO>')

#replace tag
xml = replace(xml,'****','<CNPJ>',cnpj,'</CNPJ>')

#result
print(xml)

Release files for lgpdXml 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lgpdXml 0.0.3
File Size Uploaded
lgpdXml-0.0.3.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lgpdXml 0.0.3
File Interpreter ABI Platform
lgpdXml-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 5.3 kB

Release files / lgpdXml-0.0.3.tar.gz

Download URL lgpdXml-0.0.3.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b8bfab0e6566b8782c89ec81686bc756f09a006ad8c2d3a7307477a5433f36ec
BLAKE2b-256 checksum
How to use checksums
9761e20d28271f4aa03eac3c0eee45bff6d967e3f749592799f2a17e9cead47e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.0

Release files / lgpdXml-0.0.3-py3-none-any.whl

Download URL lgpdXml-0.0.3-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12fd3807853a5f6847e9e5f2ca15df4eeeef88c5e6ca1db048e2c4fd83bc6836
BLAKE2b-256 checksum
How to use checksums
ae1a26eb8f6db7a0fcf829abe3b9ee5ae25608f3ac3f8a82a1b5d5809ac319c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page