Coder Social home page Coder Social logo

congressxml's Introduction

CongressXML

XML-to-HTML converter for HouseXML and CatoXML.

Installation

Usage

import congressxml

html_tree = congressxml.convert_xml("bill.xml")

congressxml.write_html(html_tree, "bill.html")

congressxml's People

Contributors

gphemsley avatar joshdata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

govtrack cw-git

congressxml's Issues

Make anchor point IDs human-readable

The fix for #7 used existing IDs that are just a long string of alphanumeric characters that seem to be some sort of hash. These IDs are by no means human-readable, nor are they related to the sections they identify in any transparent way.

Eventually, sections should have IDs that are similar to the forms that are used by citations, so as to keep things obviously uniform and uniformly obvious.

Error in s1466-105

File "/home/govtrack/web/bill/billtext.py", line 294, in load_bill_text
"text_html": lxml.html.tostring(congressxml.convert_xml(dat["xml_file"])),

File "/home/govtrack/web/lib/congressxml/init.py", line 352, in convert_xml
return etree.ElementTree(build_html_tree(xml_tree.getroot(), url_fn))

File "/home/govtrack/web/lib/congressxml/init.py", line 338, in build_html_tree
html_tree = convert_element(node, url_fn)

File "/home/govtrack/web/lib/congressxml/init.py", line 200, in convert_element
xml_tag = xml_element.tag

AttributeError: 'NoneType' object has no attribute 'tag'

Special segment error in s1243-113

I don't have which bill version from the stack trace unfortunately, but it'll be the most recent version.

File "/home/govtrack/web/lib/congressxml/init.py", line 126, in create_link_url
citation = citations.deepbills_citation_for(entity_type, entity_value, xml_element.text, entity_proposed)

File "/home/govtrack/web/lib/congressxml/citations/init.py", line 101, in deepbills_citation_for
citation = build_citation(entity_value_segments, entity_value_segment_names[entity_subtype])

File "/home/govtrack/web/lib/congressxml/citations/init.py", line 60, in build_citation
add_special_segment(citation, entity_value_segment)

File "/home/govtrack/web/lib/congressxml/citations/init.py", line 10, in add_special_segment
raise ValueError("Special segment already defined in citation")

ValueError: Special segment already defined in citation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.