Saravanan666/pypi-org huggingface dataset:
Package: xmldsig
A XML Signature (XMLDSig) is a syntax to provide digital signatures of an XML file. Support for these signatures is provided by, for instance, the libxmlsec C library. A Python wrapper for this library is available as pyXMLSec. However, this wrapper only provides access to the low-level API functions and does not achieve a Pythonic API.This xmldsig module is a convenience wrapper for pyXMLSec. It has been built initially to be used for signing and validating messages from the Dutch iDEAL payment processing system, but has been extended for general use. The module is inspired by the code examples of pyXMLSec and the module made by Philippe Lagadec. However, his module lacks the ability to specify the key format, which is required to load certificates as named keys. This module has been made to mimic large parts of Lagadec’s API to ensure an easy transition.See the documentation athttps://github.com/AntagonistHQ/xmldsigfor more information.
Package: xmldt
xmldt - a Python module to process XML/HTML files in natural waySynopsispydt file.xml > proc.py

from xmldt import XmlDtpydt scriptpydtis used to bootstrap the processing taskxmldtvariables and functionsclass proc(XmlDt):     # or HtmlDt for HTML


proc(strip=True,                       # _flags dictionary
     empty=False       # keep spaces
     ns_strip= ???

proc(filename="x.xml")__defaul__(s,ele)__pcdata__(s,text)__comment__(s,txt)__end__(s,result)__join__(s,ele)@XmlDt.dt_tag("id-id")\ndef id_id(s, e):....toxml functiontoxml("foo", {})                     == "<foo/>"
    toxml("foo", {"a": "b"})             == "<foo a=\"b\"/>"
    toxml("foo", {}, "bar")              == "<foo>bar</foo>"
    toxml("foo", {}, {"a": "b", "c": "d"}) == "<foo><a>b</a><c>d</c></foo>"
    toxml("foo", {}, ["a", "b"])         == "<foo>a</foo><foo>b</foo>"
    toxml("foo", {"a": "b"}, ["a", "b"]) == "<foo a=\"b\">a</foo><foo a=\"b\">b</foo>"
    toxml("foo", {}, ["a", "b"], ["c"])  == "<foo><item>a</item><item>b</item><item>c</item></foo>"Function Class Elementele = Element("tag", {}, "contents")
   ele.xml                      "<tag>contents</tag>"
   ele.toxml(v={"a":"b"})       "<tag a='b'>contents</tag>"
   ele.tag        ele.tag="val"            or ele.q
   ele.contents   ele.c = """.... """      or ele.c
   ele["att"]   : value or None            ele.attrs or ele.velement functions and methodsele.parent  : element or Noneele.parent.tag : tag-nameele["root"]ele["gparent"]ele.in_context("tag1")ele._dt(DT)self functions and methodss._pathor s.dt_paths._parentor s.dt_parent     = s._path[-1]s._gparentor s.dt_gparent    = s._path[-2]s._rootor s.dt_root       = s._path[0]types_types = { 'table' : 'list', 'tr' : 'list', 'td' : 'list' }Valid types arezerolistmapmmap
Package: xml-encoder
XML EncoderExamplesEncoding a fileimportxml_encoderpath_in='/foo/bar.xml'path_out='/foo/bar.exml'xml_encoder.encode(path_in,path_out)Decoding a fileimportxml_encoderpath_in='/foo/bar.exml'path_out='/foo/bar.xml'xml_encoder.decode(path_in,path_out)ContactIf you have any questions or concerns, please reach out to me (John Carter) atjfcarter2358@gmail.com
Package: xmlexicon
Package for transforming a .csv file containing a Ancient Greek - Old Church Slavonic-Latin dictionary into TEI XML. At this moment this package works for that particular .csv file.As a bonus there is a visualization tool: you can see the average count of old church slavonic equivalents and look into part of speech distribution.Made as a part of an international project "Epifanii Slavinetskii’s Greek–Slavonic–Latin Lexicon in the East Slavic and European Language Space of the 16th–early 18th Century".
Package: xml-from-seq
xml_from_seqGenerate XML from a Python data structure.ExamplesTheXML()function renders a Python list or tuple to an XML element. The first item is the
element name, the second item – if it's a dict – is the attributes, and the rest of the items
are either text or nested elements.fromxml_from_seqimportXMLitem=['item',{'attr1':123,'attr2':'other value'},'This is the content of the item.']assertXML(item)=='<item attr1="123" attr2="other value">This is the content of the item.</item>'item=['item','This is some content of the item.'['sub','This is the content of a subelement.']]print(XML(item))<item>Thisissomecontentoftheitem.<sub>Thisisthecontentofasubelement.</sub></item>If an element is False or None it will be omitted. If a element's name isNoneits contents will
appear in its place. If an attribute's value isNoneit will be omitted.If an element's name is a list or tuple, it will be inserted into the XML as-is – so you can
include already-rendered XML by double-bracketing it:print(XML([['<foo>123</foo>']]))<foo>123</foo>If an element's tag name isxml_from_seq.CDATA, that element's content will be rendered unescaped
in a<![CDATA[...]]>section.Indentation and line breaksIf the first item in an element (not counting an attribute dict) isxml_from_seq.INLINE, that
element's contents won't be indented on separate lines from the element's start and end tags.fromxml_from_seqimportINLINE,XMLitem=['item','This is some content of the item.'['sub',INLINE,'This is the content of a subelement.']]print(XML(item))<item>Thisissomecontentoftheitem.<sub>Thisisthecontentofasubelement.</sub></item>You can pass an integerindentparameter to theXML()function to indent the output XML by
that many tabs.
Package: xmlfuse
xmlfuseGiven two XML documents having the same text, fuses the markup together to create the output XML document.Installationpip install xmlfuseBuilding and testing:If you prefer to build from sources, follow these steps:make venv
makeAPIimportlxml.etreeasetfromxmlfuse.fuseimportfusexml1=et.fromstring('<span>Hello, <i>world!</i></span>')xml2=et.fromstring('<span><b>Hello</b>, world!</span>')xml=fuze(xml1,xml2)assertet.tostring(xml)==b'<span><b>Hello</b>, <i>world!</i></span>'Input documents must have exactly the same textError is raised if text differs. Whitespace does matter!Example:xml1=et.fromstring('<span>Hello</span>')xml2=et.fromstring('<span>Good bye</span>')xml=fuze(xml1,xml2)# expect RuntimeError raisedConflicting markupConflicting markup. Sometimes it is not possible to merge two markups, because tags intersect. In such a case one has a choice:a. Raise an exception and let caller handle the problem
b. Resolve by segmenting one of the markupsWe treat first document asmaster, and second asslave. Master markup is never segmented. If there is a
conflict between master and slave markups (and ifauto_segmentflag isTrue),fuse()will segment slave to make markup consistent.Example:xml1=et.fromstring('<span>Hel<i>lo, world!</i></span>')xml2=et.fromstring('<span><b>Hello</b>, world!</span>')xml=fuze(xml1,xml2)assertet.tostring(xml)==b'<span><b>Hel<i>lo</i></b></i>, <i>world!</i></span>'Setauto_segmentflag toFalseto prevent segmentation. Error will be raised instead, if conflict detected.AmbiguitiesWhen master ans slave markups wrap the same text, there is a nesting ambuguity - which tag should be inner?We resolve this by consistently trying to putslavemarkup inside themaster. This behavior can be changed
by setting the flagprefer_slave_innerto false.Example:xml1=et.fromstring('<span><i>Hello</i>, world!</span>')xml2=et.fromstring('<span><b>Hello</b>, world!</span>')xml=fuze(xml1,xml2,prefer_slave_inner=True)assertet.tostring(xml)==b'<span><b><i>Hello</i></b>, world!</span>'xml=fuze(xml1,xml2,prefer_slave_inner=False)assertet.tostring(xml)==b'<span><i><b>Hello</b></i>, world!</span>'Slave top-level tag is droppedNote that top-level tag from slave is not merged. It is just dropped. If you want it to be merged into the output,
setstrip_slave_top_tag=False.fuse() signaturefuse(xml1,xml2,*,prefer_slave_inner=True,auto_segment=True,strip_slave_top_tag=True)Where:xml1is the master XML document (LXML Element object, seehttp://lxml.de)xml2is the slave XML documentprefer_slave_innercontrols ambigiuty resolutionauto_segmentallows slave smarkup segmentation in case of conflicting markupstrip_slave_top_tagallowsfuseto ignore top-level tag from the slave XMLReturns fused XML document
Package: xml-generator-seobaeksol
XML GeneratorComprehensive XML generator for PythonTable of ContentsInstallationUsageContributingLicenseInstallationpipinstallxml-generator-seobaeksolUsageImportfromxml_generator.typesimportXmlNodeComprehensive parsingParse Comprehensive format into an XmlNode object.node=XmlNode.parse({"name":"node","attributes":{"attr1":"value1","attr2":"value2"},"body":[{"name":"child1","attributes":{"attr1":"value1"}},{"name":"child2","attributes":{"attr2":"value2"}},],})Create a XmlNode with a querynode=XmlNode.from_query('node@attr1="value1"@attr2="value2"')Create a XmlNode with a extended queryextend_query={"root":["NoValueNode",{"SHORT-NAME":"node",},{"ELEMENTS@type=string":["element@hint=id","element@unit=m",{"element@unit=m@min=0@max=100@init=50":"100"},],},]}Searching a specific nodeReturn the first XmlNode with the given query. Query can be a name with attributes.parent=node.find("node")child1=node.find("child1@attr1")child2=node.find("child2")SerializationUsing theto_xml()function that return the XmlNode as an XML string.withopen('sample.xml','w',encoding='utf-8')asf:f.write(node.to_xml())Using theto_extend_query()function that return the extended query object as an XML string.extended_query_obj=root.to_extended_query()DeserializationUseXmlParserclass for reading a xml file that returnXmlNodebyclose()method.
It is sub-class ofxml.etree.ElementTree.XMLParserbuilt-in python class.fromxml_generator.typesimportXmlParserparser=XmlParser()withopen(file="xml_generator/tests/samples/complex.xml",mode="r",encoding="utf-8")asf:original_xml=f.read()parser.feed(original_xml)root=parser.close()xml_string=root.to_xml(declaration=True,declaration_tag='<?xml version="1.0" encoding="UTF-8"?>\n')ContributingComing soon.Testingpython-munittestdiscover-sxml_generator/tests-p"test*.py"Buildingpython.\setup.pysdistbdist_wheelDeploymenttwineuploaddist/*LicenseLicense :: OSI Approved :: MIT License
Package: xmlib-to-git
XML Rollbasase To GITApp that changes an XML Rollbase application into a git repository.Featuresxml conversiongit history relative to the creation date of the XML filegit pushbranch creation for each customer when-cparameter is setRequiresseerequirement.txtInstallationpip install xmlib-to-gitUsage$xmlib-to-git\-f<xml-file>\-o<local-repo>\[-g<remote-repo]\[-c<customer-id]\[-v]
Package: xmlightning
xmlightningxmlightning is a simple,Flask-like way of creating XML parsersInstallationTo install xmlightning through pippip install xmlightningGetting StartedFor a basic hello world, take the following two fileshello_world.xml<root>
      <foo>Hello World</foo>
  </root>hello_world.pyfrom xmlightning import Lightning


 parser = Lightning()

 @parser.route("./foo")
 def hello_world(element):
     print("hello_world")

 parser.parse("test.xml")BreakdownAfter the Lightning class gets imported in your project, to use it you must instantiate it.After the Lightning class was instantiated, the example uses the decorator, "route".Route DecoratorThe route decorator takes in one argument, path, which is a string.
Path refers to any valid XPATH string.Note that the route decorator requires the function it is used on to take in one argument: element.The type of element can be imported through the followingThrough xmlfrom xml.etree.ElementTree import ElementOr through xmlightningfrom xmlightning import ElementNext, the hello_world.xml file is parsed.
Whenever the parser encounters a path that matches a route, the function of that route is executed.Finally, the string from the function is printed to the screenhello_world
Package: xmlist
xmlistxmlistis a module for generating XML, which it represents by lists and tuples.using xmlistxml = xmlist.serialize(['html',
    ('xmlns', 'http://www.w3.org/1999/xhtml'),
    ['head', ['title', 'Hello, world!']],
    ['body',
        ['h1', 'Hello, world!'],
        ['p', 'xmlist is a module for generating XML']]])hacking on xmlist[assuming the setup_requires and test_requires are already installed withpip --user]virtualenv --python=python2.7 --system-site-packages env27 ;
env27/bin/pip2 install --editable .testing xmlistenv27/bin/python -B setup.py -q test
Package: xmlJoiner
xmlJoinerJoin two or more PARC Telemetry files downloaded from ESA EDDS.InstallationTo install the reader you can use the command:$python3-mpipinstallxmlJoinerUsageTo join all the XML filesmyxml_01.xmlrandmyxml_02.xmlin a single file calledmyxml.xmlyou can use the command:$xmlJoinmyxml01.xmlmyxml_02.xml-omyxml.xmlYou can join also directly all the files in a folder:$xmlJoin-fmyfolder-omyfolder.xmlN.B.:be careful the file are sorted alphabetically. if they are numered the file #10 is befre the file #2. Please check the order using the command$xmlJoin-fmyfolder--show-listand change the file names if it is necessary.You can use it also as library:fromxmlJoinerimportxmlJoinxmlJoin(fileList,"joined.xml",verbose=True)
Package: xml-json-yaml-convert
BRANCHSTATUSmaindevelopxml_json_yaml_convertBase level XML, JSON, YAML conversion toolWritten By: Benjamin P. TrachtenbergContact Information:e_ben_75-python@yahoo.comIf you have any questions e-mail meLinkedIn:Ben TrachtenbergDocker Hub:Docker HubPyPi Page forxml_json_yaml_convertRequirementsrequirementsrequirements-devInstallationFrom source "setup.py install"From pip "pip install xml-json-yaml-convert"LanguagesPythonAboutThis is a library for a simple conversion between XML, YAML, and JSON
Package: xml_marshaller
IntroductionThis module allows one to marshal simple Python data types into a
custom XML format.  The Marshaller and Unmarshaller classes can be
subclassed in order to implement marshalling into a different XML DTD.
Original Authors are XML-SIG (xml-sig@python.org).Fully compatible with PyXML implementation, enables namespace support
for XML Input/Output.Implemented with lxmlInstallationpython setup.py installTestingpython setup.py testUsageFor simple serialisation and unserialisation:>>> from xml_marshaller import xml_marshaller
>>> xml_marshaller.dumps(['item1', {'key1': 1, 'key2': 'string'}])
'<marshal><list id="i2"><string>item1</string><dictionary id="i3"><string>key1</string><int>1</int><string>key2</string><string>string</string></dictionary></list></marshal>'
>>> xml_marshaller.loads(xml_marshaller.dumps(['item1', {'key1': 1, 'key2': 'string'}]))
['item1', {'key2': 'string', 'key1': 1}]Can works with file like objects:>>> from xml_marshaller import xml_marshaller
>>> from StringIO import StringIO
>>> file_like_object = StringIO()
>>> xml_marshaller.dump('Hello World !', file_like_object)
>>> file_like_object.seek(0)
>>> file_like_object.read()
'<marshal><string>Hello World !</string></marshal>'
>>> file_like_object.seek(0)
>>> xml_marshaller.load(file_like_object)
'Hello World !'xml_marshaller can also output xml with qualified names:>>> from xml_marshaller import xml_marshaller
>>> xml_marshaller.dumps_ns('Hello World !')
'<marshal:marshal xmlns:marshal="http://www.erp5.org/namespaces/marshaller"><marshal:string>Hello World !</marshal:string></marshal:marshal>'You can also use your own URI:>>> from xml_marshaller.xml_marshaller import Marshaller
>>> marshaller = Marshaller(namespace_uri='http://my-custom-namespace-uri/namespace')
>>> marshaller.dumps('Hello World !')
'<marshal:marshal xmlns:marshal="http://my-custom-namespace-uri/namespace"><marshal:string>Hello World !</marshal:string></marshal:marshal>'History1.0.2 (2019-02-25)Python 2 fixups.1.0.1 (2018-11-12)Fix changelog.1.0 (2018-11-12)Stop distinguish unicode and bytes and always return ‘str’0.10 (2018-09-12)Add support for Python 30.9.7 (2010-10-30)Enhance egg folder structure
[nicolas Delaby]Improve tests
[nicolas Delaby]add XSD Schema
[nicolas Delaby]0.9.6 (2010-10-12)[fix] Support boolean transformation
[Nicolas Delaby]0.9.5 (2010-09-01)[fix] Formatting of documentation
[Lukasz Nowak]0.9.4 (2010-09-01)[fix] Instances are now correctly unmarshalled.
[Cedric de Saint Martin]
Package: xmlmerge
xmlmergeXMLMerge is simple tool to merge multiple xml files.How to InstallpipinstallxmlmergeUsage$xmlmergefile1.xmlfile2.xml>file3.xml$xmlmergetests/*.xml>combine.xmlHow end file looks like<products><productid="9999"><a>1234</a><b>1234</b></product><productid="5678"><a>1234</a><b>1234</b></product></products>ContactContact Kiran Kumar Kotarikirankotari@live.comwith any suggestions or comments. If you find any bugs please fix them and send me a pull request.
Package: xml_models
Django REST Model was written in a Test Driven Development style.  For example usages
please refer to xml_models_test.pyFor XPath processing, the py-dom-xpath library is included, but this is a fairly slow
pure python library.  While it works perfectly well, Django REST Model was written
originally to work with LXML, which is a much faster library, and provides better
namespace support.  If Django REST Model appears slow, try switching to LXML and
hopefully you’ll experience significant speed improvements.
Package: xml_models2
[![Build Status](https://travis-ci.org/alephnullplex/xml_models2.svg?branch=master)](https://travis-ci.org/alephnullplex/xml_models2)[![Coverage Status](https://coveralls.io/repos/alephnullplex/xml_models2/badge.svg?branch=master)](https://coveralls.io/r/alephnullplex/xml_models2?branch=master)[Read The Docs](http://xml-models2.readthedocs.org/en/latest/)# XmlModels2XmlModels allows you to define Models similar in nature to Django models that are backed by XML endpoints rather than adatabase.   Using a familiar declarative definition, the fields map to values in the XML document by means of XPathexpressions. With support for querying external REST APIs using a django-esque approach, we have strived to makewriting and using xml backed models as close to django database models as we can, within the limitations of theavailable API calls.# InstallationThe simplest approach is to to use `pip install xml_models2`# A simple exampleJust to get started, this is an example of taking an XML representation of an Address that might be returned from aGET request to an external REST api.<Address id="2"><number>22</number><street>Acacia Avenue</street><city>Maiden</city><country>England</country><postcode>IM6 66B</postcode></Address>class Address(xml_models.Model):id=xml_models.IntField(xpath="/Address/@id")number = xml_models.IntField(xpath="/Address/number")street = xml_models.CharField(xpath="/Address/street")city = xml_models.CharField(xpath="/Address/city")country = xml_models.CharField(xpath="/Address/country")postcode = xml_models.CharField(xpath="/Address/postcode")finders = {(id,): 'http://adresses/%s'}This example would be used as follows:->>> address = Address.objects.get(id=2)>>> print "address is %s, %s" % (address.number, address.street)"22, Acacia Avenue"# HeritageThis project is a fork of [Django REST Models](http://djangorestmodel.sourceforge.net/)
Package: xml-models-redux
Django REST Model was written in a Test Driven Development style.  For example usages
please refer to xml_models_test.pyFor XPath processing, the py-dom-xpath library is included, but this is a fairly slow
pure python library.  While it works perfectly well, Django REST Model was written
originally to work with LXML, which is a much faster library, and provides better
namespace support.  If Django REST Model appears slow, try switching to LXML and
hopefully you’ll experience significant speed improvements.
Package: xmlobj
Descriptionxmlobj is simple utility to map xml file to python objectxmlobj also allows you to add functionality to mapped object by adding mixin classA Simple Examplefrom pathlib import Path

from PIL import Image, ImageDraw

from xmlobj import get_xml_obj


class DrawBoxesMixin:
    def draw_box(self, image) -> Image.Image:
        p1 = (self.object.bndbox.xmin, self.object.bndbox.ymin)
        p2 = (self.object.bndbox.xmax, self.object.bndbox.ymax)
        img_draw = ImageDraw.Draw(image)
        img_draw.text(p1, self.object.name, align="left")
        img_draw.rectangle([p1, p2])
        return image


if __name__ == "__main__":
    pascal_annotation = Path("samples/000027.xml")
    img_file = "samples/000027.jpg"
    img = Image.open(img_file)
    obj = get_xml_obj(pascal_annotation, mixin_clsasses=[DrawBoxesMixin])
    rendered_img = obj.draw_box(img.copy())
    rendered_img.show()Save xmlimport xml.etree.cElementTree as ET

from xmlobj import get_xml_obj

if __name__ == "__main__":
    obj = get_xml_obj("samples/books.xml")
    root = obj.to_xml()
    tree = ET.ElementTree(root)
    ET.indent(tree, space="\t", level=0)
    tree.write("my_xml_books.xml")LimitationsTag lowercaseOriginal:<CD>
    <TITLE>Empire Burlesque</TITLE>
    <ARTIST>Bob Dylan</ARTIST>
    <COUNTRY>USA</COUNTRY>
  </CD>Output:<cd>
    <TITLE>Empire Burlesque</TITLE>
    <ARTIST>Bob Dylan</ARTIST>
    <COUNTRY>USA</COUNTRY>
</cd>Attribute propertiesOriginal:<book id="bk101">
        <author>Gambardella, Matthew</author>
        <title>XML Developer's Guide</title>
        <genre>Computer</genre>
        <price>44.95</price>
        <publish_date>2000-10-01</publish_date>
        <description>An in-depth look at creating applications
            with XML.
        </description>
    </book>Output:<book>
    <id>bk101</id>
    <author>Gambardella, Matthew</author>
    <title>XML Developer's Guide</title>
    <genre>Computer</genre>
    <price>44.95</price>
    <publish_date>2000-10-01</publish_date>
    <description>An in-depth look at creating applications
        with XML.</description>
</book>Installationpip install xmlobj
Package: xml-objects
Makes managing XML a lot easier by making an XML document look like nested Python objects.## InstallingInstall via `pip`:pip install xml-objects## UsageSee [sample.xml](sample.xml) for the structure used in these examples.  Taken unashamedly from Microsoft's [Sample XML](https://msdn.microsoft.com/en-us/library/ms762271.aspx).  The results of the code below can be seen by running [`xml_node.py`](xml_node.py) directly.```pythonxml = XMLNode.from_file('sample.xml')print(xml.book.price)for book in xml.book:print(f"{book.title.value}, {book.author.value}, {book.price.value}")```Which will output:```PS [34] master -> python .\xml_node.py['44.95', '5.95', '5.95', '5.95', '5.95', '4.95', '4.95', '4.95', '6.95', '36.95', '36.95', '49.95']XML Developer's Guide, Gambardella, Matthew, 44.95Midnight Rain, Ralls, Kim, 5.95Maeve Ascendant, Corets, Eva, 5.95Oberon's Legacy, Corets, Eva, 5.95The Sundered Grail, Corets, Eva, 5.95Lover Birds, Randall, Cynthia, 4.95Splish Splash, Thurman, Paula, 4.95Creepy Crawlies, Knorr, Stefan, 4.95Paradox Lost, Kress, Peter, 6.95Microsoft .NET: The Programming Bible, O'Brien, Tim, 36.95MSXML3: A Comprehensive Guide, O'Brien, Tim, 36.95Visual Studio 7: A Comprehensive Guide, Galos, Mike, 49.95```## Future Ideas- Script to drop into a shell with the functionality of XMLNode.  Optionally, with an argument to pre-load an XML file.- The `__str__` method should probably print out available child-nodes for ease of exploration.- Open from URL?## ContributingI'd love to have people contribute.  Feel free to open a pull request and we'll talk about it!## Code of ConductSee the [Code of Conduct](CODE_OF_CONDUCT.md).Keywords: data xml interface update modify investigatePlatform: UNKNOWNClassifier: Development Status :: 3 - AlphaClassifier: Intended Audience :: DevelopersClassifier: Topic :: Text Processing :: Markup :: XMLClassifier: License :: OSI Approved :: MIT LicenseClassifier: Programming Language :: Python :: 3Classifier: Programming Language :: Python :: 3.6Description-Content-Type: text/markdown