Python pandas.io.common.file_path_to_url() Examples

The following are 14 code examples of pandas.io.common.file_path_to_url(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pandas.io.common , or try the search function .
Example #1
Source File: test_html.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_file_url(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(os.path.abspath(url)),
                             'First',
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame) 
Example #2
Source File: test_html.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_regex_idempotency(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(os.path.abspath(url)),
                             match=re.compile(re.compile('Florida')),
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame) 
Example #3
Source File: test_html.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_file_url(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(os.path.abspath(url)),
                             'First',
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame) 
Example #4
Source File: test_html.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_regex_idempotency(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(os.path.abspath(url)),
                             match=re.compile(re.compile('Florida')),
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame) 
Example #5
Source File: test_html.py    From Computable with MIT License 5 votes vote down vote up
def test_file_url(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(url), 'First', attrs={'id': 'table'})
        tm.assert_isinstance(dfs, list)
        for df in dfs:
            tm.assert_isinstance(df, DataFrame) 
Example #6
Source File: test_html.py    From Computable with MIT License 5 votes vote down vote up
def test_regex_idempotency(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(url),
                                 match=re.compile(re.compile('Florida')),
                                 attrs={'id': 'table'})
        tm.assert_isinstance(dfs, list)
        for df in dfs:
            tm.assert_isinstance(df, DataFrame) 
Example #7
Source File: test_html.py    From Computable with MIT License 5 votes vote down vote up
def get_elements_from_file(url, element='table'):
    _skip_if_none_of(('bs4', 'html5lib'))
    url = file_path_to_url(url)
    from bs4 import BeautifulSoup
    with urlopen(url) as f:
        soup = BeautifulSoup(f, features='html5lib')
    return soup.find_all(element) 
Example #8
Source File: test_html.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_file_url(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(os.path.abspath(url)),
                             'First',
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame) 
Example #9
Source File: test_html.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_regex_idempotency(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(os.path.abspath(url)),
                             match=re.compile(re.compile('Florida')),
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame) 
Example #10
Source File: test_html.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def test_file_url(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(url), 'First',
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame) 
Example #11
Source File: test_html.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def test_regex_idempotency(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(url),
                             match=re.compile(re.compile('Florida')),
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame) 
Example #12
Source File: test_html.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def get_elements_from_file(url, element='table'):
    _skip_if_none_of(('bs4', 'html5lib'))
    url = file_path_to_url(url)
    from bs4 import BeautifulSoup
    with urlopen(url) as f:
        soup = BeautifulSoup(f, features='html5lib')
    return soup.find_all(element) 
Example #13
Source File: test_html.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_file_url(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(os.path.abspath(url)),
                             'First',
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame) 
Example #14
Source File: test_html.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_regex_idempotency(self):
        url = self.banklist_data
        dfs = self.read_html(file_path_to_url(os.path.abspath(url)),
                             match=re.compile(re.compile('Florida')),
                             attrs={'id': 'table'})
        assert isinstance(dfs, list)
        for df in dfs:
            assert isinstance(df, DataFrame)