pyFaup - Python bindings for the Faup library
Faup is a URL parser, this is the Python library.
Examples
Example 1: Parse a URL
from pyfaup.faup import Faup
f = Faup()
f.decode("https://pypi.org/project/pyfaup")
print("TLD:" + f.get_tld())
This will extract all the TLDs. Replace get_tld() with get() to grab all the parsed items.
Example 2: Multithreading
Reading from a file one url per line in multiple threads (example contributed by Sebastien Larinier):
from pyfaup.faup import Faup
import threading
NUM_THREADS=5
URLS_TO_READ="your_urls_file.txt"
class ThreadFaup(threading.Thread):
def __init__(self,list_url,f):
self.list_url=list_url
threading.Thread.__init__(self)
self.f=f
def run(self):
for url in self.list_url:
self.f.decode(url)
print self.f.get()
with open(URLS_TO_READ,'r') as fd:
for line in fd:
line=line.replace('\r\n','')
list_url.append(line)
f=Faup()
for i in range(0,NUM_THREADS):
t=ThreadFaup(list_url,f)
t.start()
Metadata
Release files for pyfaup 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyfaup-1.2.tar.gz | 329.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyfaup-1.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 661.4 kB
Release files / pyfaup-1.2.tar.gz
| Download URL | pyfaup-1.2.tar.gz |
|---|---|
| Size | 329.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5648bc3ebd80239aec927aedfc218c3a6ff36de636cc53822bfeb70b0869b1e7
|
|
BLAKE2b-256 checksum How to use checksums |
7706189a3ddb3ec0fe02ca8dcc4e54b7183a281dc9777f3692a8f755c3b7121f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.7
|
Release files / pyfaup-1.2-py2.py3-none-any.whl
| Download URL | pyfaup-1.2-py2.py3-none-any.whl |
|---|---|
| Size | 331.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
75f96f7da86ffb5402d3fcc2dbf98a511e792cf9100c159e34cdba8996ddc7f9
|
|
BLAKE2b-256 checksum How to use checksums |
3fe75d2537be0c758ab18ec24ea303ad1a76808908e4b8a489ebafbd476c0b6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.7
|