.. _l-functions: Functions ========= .. contents:: :local: :depth: 1 Summary +++++++ +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | function | class parent | truncated documentation | +==============================================================================================================================+==============+===============================================================================================================================+ | :func:`_iteration_values ` | | Iterators on all possible tuple of values taken into a list. Let's assume you have two rows: | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`_setup_hook ` | | does nothing | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`compile_rss_blogs ` | | Compiles multiple blogs in one single blog. Uses :epkg:`RSS` files. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`enumerate_post_from_rss ` | | Parses a :epkg:`RSS` stream. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`enumerate_rss_merge ` | | Merges many :epkg:`rss` file or url. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`escape ` | | | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`extract_bing_result ` | | extract the first results from a search page assuming it coms from `Bing `_ | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_binary_file ` | | Returns the content of a binary filename. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_js ` | | Serves static files. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_path_javascript ` | | *pyrsslocal* contains some javascript script, it adds the paths to the paths where content will be looked for. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_resource ` | | Serves static files. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_text_file ` | | Returns the content of a text filename. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_url_content_timeout ` | | Downloads a file from internet (it assumes it is text information, otherwise, encoding should be None). | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`html_escape ` | | Escapes any French character with an accent. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`html_unescape ` | | Removes :epkg:`HTML` or :epkg:`XML` character references and entities from a text string. keep ``&``, ``>``, ... | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`internal_error ` | | Intercepts an error. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`iterate_on_json ` | | Iterates on every field contains in the :epkg:`JSON` structure. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`load_page ` | | Loads the content of a file. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`main ` | | Implements ``python -m pyrsslocal ``. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`main_page ` | | Serves the main page. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`not_found ` | | Intercepts an error. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`query_bing ` | | Returns the search page from `Bing `_ for a specific query. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`root_dir ` | | Returns this directory. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`rss_download_post_to_database ` | | Downloads all posts from a list of blogs stored in a database by function :func:`rss_from_xml_to_database`. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`rss_from_xml_to_database ` | | Parses a list of blogs stored in a :epkg:`XML` file using Google Reader format, stores the results in a :epkg:`SQLite` ... | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`rss_run_server ` | | Starts a server and open a browser on a page reading blog posts. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`rss_update_run_server ` | | Creates a database if it does not exists, add a table for blogs and posts, update the database, starts a server ... | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`run_python_script ` | | Executes a script python as a string. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`run_server ` | | Runs the server. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`table_extraction_from_xml_files ` | | Goes through a :epkg:`XML` file, extracts values and put them into a flat file. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`table_extraction_from_xml_files_iterator ` | | Goes through a XML file, extracts values and put them into an iterator. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`to_html ` | | Produces a :epkg:`HTML`. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`to_rss ` | | Converts something into :epkg:`RSS`. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`url_logging ` | | Serves static files. | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`write_subscriptions_example ` | | returns an example of a subscriptions file | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`xml_filter ` | | Goes through a :epkg:`XML` file, returns :epkg:`XML` content if a condition is verified, the result is put into a stream. ... | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+ | :func:`xml_filter_iterator ` | | Goes through a :epkg:`XML` file, returns :epkg:`XML` content if a condition is verified, the result is an iterator. ... | +------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------+