mohammedazmy / pixel Goto Github PK
View Code? Open in Web Editor NEWAnother python XML library which uses SAX and your custom defined entities
License: GNU General Public License v3.0
Another python XML library which uses SAX and your custom defined entities
License: GNU General Public License v3.0
Pixel Pixel is another XML framework used to integrate XML into your projects it drops the need to load your XML structure into DOM objects and then populate your real entities. The framework was designed with ease of use in mind so you can get started as fast as possible. It's also designed to validate the loaded data to match your defined schema (as defined in your structures) using attribute, element and/or collection *NOTE: Please refer to the main.py file for more up to date example. Usually your structure will look like something like that: from pixel.xmlelement import XmlElement, element, collection, attribute import pixel.loader class Header(XmlElement): key = attribute(str) value = attribute(str) class Body(XmlElement): title = element(str, True) #optional element text = element(str) class Message(XmlElement): source = attribute(str) destination = attribute(str) id = attribute(int, True) #optional attribute. headers = collection(Header) body = element(Body) def send(self): print "Sendig message to %s" % self.destination def main(): message = Message() message.source = '[email protected]' message.destination = '[email protected]' message.id = 100 message.body.text = 'Message body goes here' message.body.title = 'Message title' header1 = Header() header1.key = 'server-ip' header1.value = '127.0.0.1' header2 = Header() header2.key = 'priority' header2.value = 'HIGH' message.headers.append(header1) message.headers.append(header2) xml = str(message) print "--- The orignial message object xml ---" print xml #load message from xml loader = pixel.loader.PixelLoader(Message) loaded_message = loader.load(xml) print "--- The loaded message object xml ---" print str(loaded_message) print "--- doing some actions ---" loaded_message.send() if __name__ == "__main__": main()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.