Module Expr Str Import alias alias alias Import alias identifier ImportFrom alias Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore TupleLoad Str Str Str Str Assign NameStore TupleLoad Str Str Str Str Str Assign NameStore TupleLoad Str Str Str Str Assign NameStore TupleLoad Str Str Str Str ClassDef bases AttributeLoad NameLoad attr body Assign NameStore Str decorator_list Assign AttributeStore NameLoad attr Call NameLoad ClassDef bases body Expr Str Assign NameStore NameLoad Assign NameStore Dict Str Str Str Str Str Str Str Str Str NameLoad Str NameLoad Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str BinOpMod Str NameLoad Assign NameStore Dict FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpAnd SubscriptLoad AttributeLoad NameLoad attr Index Str CompareNotIn Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad body Raise Call NameLoad Str If BoolOpAnd SubscriptLoad AttributeLoad NameLoad attr Index Str CompareNotIn Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad body Raise Call NameLoad Str If BoolOpAnd SubscriptLoad AttributeLoad NameLoad attr Index Str CompareNotIn Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad body Raise Call NameLoad Str If BoolOpAnd SubscriptLoad AttributeLoad NameLoad attr Index Str UnaryOpNot Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad body If CompareNotIn Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad body Raise Call NameLoad Str If BoolOpAnd SubscriptLoad AttributeLoad NameLoad attr Index Str UnaryOpNot Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad body If CompareNotIn Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad body Raise Call NameLoad Str If BoolOpAnd SubscriptLoad AttributeLoad NameLoad attr Index Str UnaryOpNot Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad body If CompareNotIn Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad body Raise Call NameLoad Str If BoolOpAnd SubscriptLoad AttributeLoad NameLoad attr Index Str UnaryOpNot Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad body If CompareNotIn Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad body Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index Str NameLoad orelse If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index Str NameLoad orelse If NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Import alias ImportFrom alias Assign NameStore BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Str For NameStore Call NameLoad Num body Assign NameStore BinOpAdd NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Import alias Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str NameLoad body If UnaryOpNot BoolOpAnd NameLoad Call NameLoad Call AttributeLoad NameLoad attr body Return NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad If NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad keyword Str keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Import alias TryExcept body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num handlers ExceptHandler body Raise Call NameLoad BinOpMod Str NameLoad If CompareEq NameLoad Str body Assign NameStore Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body Assign NameStore Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr orelse Raise Call NameLoad Str Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad decorator_list decorator_list ClassDef bases body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad handlers ExceptHandler body Raise Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str SubscriptLoad AttributeLoad NameLoad attr Index Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Dict For NameStore Call AttributeLoad NameLoad attr body For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If BoolOpAnd Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad ListLoad Delete SubscriptDel NameLoad Index Str Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot Call NameLoad NameLoad Str body Return NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Print BinOpMod Str SubscriptLoad NameLoad Index Str If Call AttributeLoad NameLoad attr Str body Print BinOpMod Str SubscriptLoad NameLoad Index Str If Call AttributeLoad NameLoad attr Str body Print BinOpMod Str SubscriptLoad NameLoad Index Str Print BinOpMod Str SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Str Print Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Print BinOpMod Str TupleLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot Call NameLoad NameLoad Str body Return NameLoad For NameStore AttributeLoad NameLoad attr body Print BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot Call NameLoad NameLoad Str body Return NameLoad For NameStore AttributeLoad NameLoad attr body Print SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot Call NameLoad NameLoad Str body Return NameLoad For NameStore AttributeLoad NameLoad attr body Print SubscriptLoad NameLoad Index Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr Str body If Call NameLoad NameLoad NameLoad body Print BinOpMod Str TupleLoad NameLoad NameLoad orelse If BoolOpAnd Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr Str body Print BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index Str decorator_list decorator_list
N/A N/A 
python-calais v.1.4 -- Python interface to the OpenCalais API
Author: Jordan Dimov (jdimov@mlke.net)
Last-Update: 01/12/2009

1.5 updated by Corey Oordt 8/3/2011
 N/A httplib urllib re N/A simplejson json StringIO StringIO N/A PARAMS_XML 
<c:params xmlns:c="http://s.opencalais.com/1/pred/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <c:processingDirectives %s> </c:processingDirectives> <c:userDirectives %s> </c:userDirectives> <c:externalMetadata %s> </c:externalMetadata> </c:params>
 N/A STRIP_RE N/A N/A re compile <script.*?</script>|<noscript.*?</noscript>|<style.*?</style> N/A re IGNORECASE N/A __version__ 1.5 N/A VALID_CONTENT_TYPES N/A text/xml text/html text/raw text/htmlraw N/A VALID_OUTPUT_TYPES N/A xml/rdf text/simple text/microformats application/json text/n3 N/A VALID_BOOLEANS N/A true false t f N/A VALID_METADATA_TYPES N/A GenericRelations SocialTags GenericRelations,SocialTags SocialTags,GenericRelations AppURLopener N/A N/A urllib FancyURLopener N/A N/A version Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.5) Gecko/2008121623 Ubuntu/8.10 (intrepid)Firefox/3.0.5 N/A N/A N/A urllib _urlopener N/A AppURLopener Calais N/A N/A N/A 
    Python class that knows how to talk to the OpenCalais API.  Use the analyze() and analyze_url() methods, which return CalaisResponse objects.  
     N/A api_key None N/A processing_directives N/A contentType outputFormat reltagBaseURL calculateRelevanceScore enableMetadataType docRDFaccessible TEXT/RAW application/json True True N/A user_directives N/A allowDistribution allowSearch externalID submitter False False N/A python-calais client v.%s __version__ N/A external_metadata N/A __init__ N/A N/A self api_key submitter N/A None N/A N/A N/A self api_key api_key N/A submitter N/A N/A N/A N/A self user_directives N/A submitter submitter N/A _validate_directives N/A N/A self N/A N/A N/A 
        Validate that the directives are valid and have valid values
         N/A N/A N/A N/A self processing_directives N/A contentType N/A N/A N/A N/A N/A self processing_directives N/A contentType lower VALID_CONTENT_TYPES N/A N/A N/A TypeError %s is not a valid content type. N/A N/A N/A N/A self processing_directives N/A outputFormat N/A N/A N/A N/A N/A self processing_directives N/A outputFormat lower VALID_OUTPUT_TYPES N/A N/A N/A TypeError %s is not a valid output type. N/A N/A N/A N/A self processing_directives N/A enableMetadataType N/A N/A N/A N/A N/A self processing_directives N/A enableMetadataType lower VALID_METADATA_TYPES N/A N/A N/A TypeError %s is not a valid metadata type. N/A N/A N/A N/A self processing_directives N/A calculateRelevanceScore N/A N/A isinstance N/A N/A self processing_directives N/A calculateRelevanceScore bool N/A N/A N/A N/A N/A N/A N/A self processing_directives N/A calculateRelevanceScore lower VALID_BOOLEAN_TYPES N/A N/A N/A TypeError %s is not a valid boolean type. N/A N/A N/A N/A self processing_directives N/A docRDFaccessible N/A N/A isinstance N/A N/A self processing_directives N/A docRDFaccessible bool N/A N/A N/A N/A N/A N/A N/A self processing_directives N/A docRDFaccessible lower VALID_BOOLEAN_TYPES N/A N/A N/A TypeError %s is not a valid boolean type. N/A N/A N/A N/A self user_directives N/A allowDistribution N/A N/A isinstance N/A N/A self user_directives N/A allowDistribution bool N/A N/A N/A N/A N/A N/A N/A self user_directives N/A allowDistribution lower VALID_BOOLEAN_TYPES N/A N/A N/A TypeError %s is not a valid boolean type. N/A N/A N/A N/A self user_directives N/A allowSearch N/A N/A isinstance N/A N/A self user_directives N/A allowSearch bool N/A N/A N/A N/A N/A N/A N/A self user_directives N/A allowSearch lower VALID_BOOLEAN_TYPES N/A N/A N/A TypeError %s is not a valid boolean type. N/A _get_param_headers N/A N/A self N/A N/A N/A headers N/A N/A N/A key val N/A N/A N/A self processing_directives items N/A N/A N/A key contentType N/A N/A N/A headers N/A Content-Type val N/A N/A N/A key outputFormat N/A N/A N/A headers N/A Accept val N/A N/A val N/A N/A N/A headers N/A key val N/A N/A key val N/A N/A N/A self user_directives items N/A N/A val N/A N/A N/A headers N/A key val N/A N/A key val N/A N/A N/A self external_metadata items N/A N/A val N/A N/A N/A headers N/A key val N/A headers N/A rest_POST N/A N/A self content N/A N/A N/A headers N/A x-calais-licenseID N/A self api_key N/A N/A N/A headers update N/A N/A self _get_param_headers N/A conn N/A N/A httplib HTTPConnection api.opencalais.com:80 N/A N/A N/A conn request POST /tag/rs/enrich N/A N/A content encode utf8 headers N/A response N/A N/A conn getresponse N/A data N/A N/A response read N/A N/A N/A conn close N/A data N/A get_random_id N/A N/A self N/A N/A N/A 
        Creates a random 10-character ID for your submission.  
         N/A string random choice N/A chars N/A N/A string letters N/A string digits N/A np N/A i N/A range 10 N/A N/A np N/A np N/A choice chars N/A np N/A get_content_id N/A N/A self text N/A N/A N/A 
        Creates a SHA1 hash of the text of your submission.  
         N/A hashlib N/A h N/A N/A hashlib sha1 N/A N/A N/A h update text N/A N/A N/A h hexdigest N/A preprocess_html N/A N/A self html N/A N/A N/A html N/A N/A html replace N/A html N/A N/A STRIP_RE sub html N/A html N/A analyze N/A N/A self content content_type external_id N/A TEXT/RAW None N/A N/A N/A N/A content N/A len N/A N/A content strip N/A N/A None N/A N/A N/A self processing_directives N/A contentType content_type N/A external_id N/A N/A N/A N/A self user_directives N/A externalID external_id N/A N/A CalaisResponse N/A N/A self rest_POST content N/A analyze_url N/A N/A self url N/A N/A N/A f N/A N/A urllib urlopen url N/A html N/A N/A self preprocess_html N/A N/A f read N/A N/A N/A self analyze html content_type TEXT/HTML external_id url N/A analyze_file N/A N/A self fn N/A N/A N/A mimetypes N/A N/A N/A filetype N/A N/A N/A mimetypes guess_type fn N/A 0 N/A N/A N/A N/A N/A ValueError N/A Can not determine file type for '%s' fn N/A N/A filetype text/plain N/A N/A content_type TEXT/RAW N/A f N/A open fn N/A content N/A N/A f read N/A N/A N/A f close N/A N/A N/A filetype text/html N/A N/A content_type TEXT/HTML N/A f N/A open fn N/A content N/A N/A self preprocess_html N/A N/A f read N/A N/A N/A f close N/A N/A N/A ValueError Only plaintext and HTML files are currently supported.   N/A N/A N/A self analyze content content_type content_type external_id fn N/A N/A CalaisResponse N/A N/A N/A 
    Encapsulates a parsed Calais response and provides easy pythonic access to the data.
     N/A raw_response None N/A simplified_response None __init__ N/A N/A self raw_result N/A N/A N/A N/A N/A N/A self raw_response N/A N/A json load N/A StringIO raw_result N/A N/A N/A N/A N/A ValueError raw_result N/A N/A self simplified_response N/A N/A self _simplify_json N/A self raw_response N/A N/A N/A self __dict__ N/A doc N/A N/A self raw_response N/A doc N/A N/A k v N/A N/A N/A self simplified_response items N/A N/A N/A N/A self __dict__ N/A k v N/A _simplify_json N/A N/A self json N/A N/A N/A result N/A N/A element N/A N/A json values N/A N/A N/A k v N/A N/A element items N/A N/A N/A N/A isinstance v unicode N/A N/A v startswith http:// N/A N/A json has_key v N/A N/A N/A element N/A k N/A json N/A v N/A N/A k v N/A N/A json items N/A N/A N/A N/A v has_key _typeGroup N/A N/A group N/A v N/A _typeGroup N/A N/A N/A N/A result has_key group N/A N/A N/A result N/A group N/A N/A N/A v N/A _typeGroup N/A N/A v N/A __reference k N/A N/A N/A N/A result N/A group append v N/A result N/A print_summary N/A N/A self N/A N/A N/A N/A N/A hasattr self doc N/A N/A None N/A info N/A N/A self doc N/A info N/A N/A Calais Request ID: %s N/A info N/A calaisRequestID N/A N/A N/A info has_key externalID N/A N/A N/A External ID: %s N/A info N/A externalID N/A N/A N/A info has_key docTitle N/A N/A N/A Title: %s  N/A info N/A docTitle N/A N/A Language: %s N/A N/A N/A self doc N/A meta N/A language N/A Extractions:  N/A N/A k v N/A N/A N/A self simplified_response items N/A N/A N/A 	%d %s N/A N/A len v k N/A print_entities N/A N/A self N/A N/A N/A N/A N/A hasattr self entities N/A N/A None N/A item N/A self entities N/A N/A N/A %s: %s (%.2f) N/A N/A item N/A _type N/A item N/A name N/A item N/A relevance N/A print_topics N/A N/A self N/A N/A N/A N/A N/A hasattr self topics N/A N/A None N/A topic N/A self topics N/A N/A N/A topic N/A categoryName N/A print_relations N/A N/A self N/A N/A N/A N/A N/A hasattr self relations N/A N/A None N/A relation N/A self relations N/A N/A N/A relation N/A _type N/A N/A k v N/A N/A relation items N/A N/A N/A N/A N/A k startswith _ N/A N/A N/A isinstance v unicode N/A N/A N/A 	%s:%s N/A k v N/A N/A N/A N/A isinstance v dict N/A N/A v has_key name N/A N/A N/A 	%s:%s N/A k N/A v N/A name N/A N/A