| xmlToDict. Àº JSONÀ¸·Î ÀÏÇÏ´Â °Íó·³ XML ´À³¦À¸·Î ÀÛ¾÷ÇÕ´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
xmlToDict. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- MIT/X Consortium Lic...
- °Ô½ÃÀÚ À̸§:
- Martin Blech
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://code.google.com/u/martinblech/
xmlToDict. ű×
xmlToDict. ¼³¸í
XMLToDict´ÂÀÌ "spec"¿¡¼¿Í °°ÀÌ JSONÀ¸·Î ÀÛ¾÷ÇÏ´Â °Íó·³ XML ´À³¦À» °®Ãá Python ¸ðµâÀÔ´Ï´Ù. ºôµå »óÅ >>> doc = xmltodict.parse ( "" "... ... ... ¿ä¼Ò ... ´õ ¸¹Àº ¿ä¼Ò ... ... .. . ¿ä¼Òµµ ... ... ... "" ") >>>>>> doc u'an ¼Ó¼º '>> > Doc >>> Doc u 'Complex'>>> Doc u' # text´Â ¸Å¿ì ºü¸£°Ô (Expat ±â¹Ý)À̸ç ÀÛÀº ¸Þ¸ð¸® Dz ÇÁ¸°Æ®°¡ÀÖ´Â ½ºÆ®¸®¹Ö ¸ðµå¸¦ °¡Áö°í ÀÖ½À´Ï´Ù. Å« XML Disgs ¶Ç´Â Wikipedia¿Í °°Àº ´ýÇÁ : >>> def handle_artist (_, ¾ÆƼ½ºÆ®) : ... Àμ⠾ÆƼ½ºÆ® >>> >>> XMLToDict.parse (gzipfile ( 'discogs_artists.xml.gz'), ... item_depth = 2, item_callback = handle_artist) ¿Ïº®ÇÑ ¼Å¬ Ƽ Âê ¸¶½ºÅ· Crimsonchris Potter ... ¸í·É ÁÙ¿¡¼ºÎÅÍ °°Àº ½ºÅ©¸³Æ®¿¡ °´Ã¼¸¦ ÆÄÀÌÇÁ·Î »ç¿ëÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ÀÌ : °¡Á® ¿À±â sys, marshalwhile true : _, ±â»ç = marshal.load (sys.stdin) Àμ⠱â»ç cat enwiki-pages-article.xml.bz2 | Bunzip2 | xmltodict.py 2 | MyScript.PyAccessibleComputingAnarchismafganistanhistoryAfghanistangeAffghanistanistanistanistanistanPeoplefghanistancommicationsautism ... ¶Ç´Â ±×³É Å« XML ÆÄÀÏÀ» ´Ù½Ã ±¸¹® ºÐ¼® ÇÒ ÇÊ¿ä°¡ ¾øÀ¸¹Ç·Î ¾ÇÀǸ¦ ij½ÃÇϽʽÿÀ. ´ç½ÅÀº ÇÑ ¹ø¸¸ ÀÌ·¸°ÔÇÕ´Ï´Ù : cat enwiki-pages-articles.xml.bz2 | Bunzip2 | xmltodict.py 2 | gzip> enwiki.dicts.gzand ´ç½ÅÀº ÇÊ¿äÇÑ ¸ðµç ½ºÅ©¸³Æ®·Î dicts¸¦ Àç»ç¿ëÇÕ´Ï´Ù : cat enwiki.dicts.gz | Gunzip | script1.py cat enwiki.dicts.gz | Gunzip | script2.py ... ÁÁ¾Æ, ¾î¶»°Ô ¾òÀ» ¼ö ÀÖ´Ï? xmltodict Á¦Ç°ÀÇ È¨ÆäÀÌÁö¸¦ ¼³Ä¡ÇؾßÇÕ´Ï´Ù.
xmlToDict. °ü·Ã ¼ÒÇÁÆ®¿þ¾î