Skip to content

Commit b13571f

Browse files
committed
roundup before release 0.9.0
1 parent 23e415c commit b13571f

6 files changed

Lines changed: 23 additions & 7 deletions

File tree

HISTORY.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
## History / Changelog
22

33

4+
### 0.9.0
5+
6+
- hardening of filters and URL parses (#14)
7+
- normalize punicode to unicode
8+
- methods added to `UrlStore`: `get_crawl_delay()`, `print_unvisited_urls()`
9+
- `UrlStore` now triggers exit code 1 when interrupted
10+
- argument added to `extract_links()`: `no_filter`
11+
- code refactoring: simplifications
12+
13+
414
### 0.8.3
515

616
- fixed bug in domain name extraction

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ The ``UrlStore`` class allow for storing and retrieving domain-classified URLs,
254254
- ``add_urls(urls=[], appendleft=None, visited=False)``: Add a list of URLs to the (possibly) existing one. Optional: append certain URLs to the left, specify if the URLs have already been visited.
255255
- ``dump_urls()``: Return a list of all known URLs.
256256
- ``print_urls()``: Print all URLs in store (URL + TAB + visited or not).
257+
- ``print_unvisited_urls()``: Print all unvisited URLs in store.
257258
- ``get_known_domains()``: Return all known domains as a list.
258259
- ``total_url_number()``: Find number of all URLs in store.
259260
- ``is_known(url)``: Check if the given URL has already been stored.
@@ -265,6 +266,7 @@ The ``UrlStore`` class allow for storing and retrieving domain-classified URLs,
265266
- Crawling and downloads
266267
- ``get_url(domain)``: Retrieve a single URL and consider it to be visited (with corresponding timestamp).
267268
- ``get_rules(domain)``: Return the stored crawling rules for the given website.
269+
- ``get_crawl_delay()``: Return the delay as extracted from robots.txt, or a given default.
268270
- ``get_download_urls(timelimit=10)``: Get a list of immediately downloadable URLs according to the given time limit per domain.
269271
- ``establish_download_schedule(max_urls=100, time_limit=10)``: Get up to the specified number of URLs along with a suitable backoff schedule (in seconds).
270272
- ``download_threshold_reached(threshold)``: Find out if the download limit (in seconds) has been reached for one of the websites in store.

courlan/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
__title__ = "courlan"
88
__author__ = "Adrien Barbaresi"
99
__license__ = "GNU GPL v3+"
10-
__copyright__ = "Copyright 2020-2022, Adrien Barbaresi"
11-
__version__ = "0.8.3"
10+
__copyright__ = "Copyright 2020-2023, Adrien Barbaresi"
11+
__version__ = "0.9.0"
1212

1313

1414
# imports

courlan/clean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import re
1010

1111
from typing import Optional, Union
12-
from urllib.parse import parse_qs, urlencode, urlparse, ParseResult
12+
from urllib.parse import parse_qs, urlencode, ParseResult
1313

1414
from .filters import validate_url
1515
from .settings import ALLOWED_PARAMS, CONTROL_PARAMS, TARGET_LANG_DE, TARGET_LANG_EN

courlan/langinfo.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
Constants containing info about languages and countries.
33
"""
44

5+
from typing import Set
56

6-
LANGUAGE_CODES = {
7+
8+
LANGUAGE_CODES: Set[str] = {
79
"aa",
810
"ab",
911
"ae",
@@ -191,7 +193,7 @@
191193
}
192194

193195

194-
COUNTRY_CODES = {
196+
COUNTRY_CODES: Set[str] = {
195197
"aw",
196198
"af",
197199
"ao",

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
def get_version(package):
1414
"Return package version as listed in `__version__` in `init.py`"
15-
initfile = Path(package, '__init__.py').read_text() # Python >= 3.5
15+
initfile = Path(package, "__init__.py").read_text(encoding="utf-8")
1616
return re.search("__version__ = ['\"]([^'\"]+)['\"]", initfile)[1]
1717

1818

@@ -38,6 +38,7 @@ def get_long_description():
3838
"courlan/clean.py",
3939
"courlan/core.py",
4040
"courlan/filters.py",
41+
"courlan/langinfo.py",
4142
"courlan/settings.py",
4243
"courlan/urlstore.py",
4344
"courlan/urlutils.py",
@@ -105,7 +106,8 @@ def get_long_description():
105106
python_requires=">=3.6",
106107
install_requires=[
107108
"langcodes >= 3.3.0",
108-
"tld >= 0.12.6",
109+
"tld == 0.12.6; python_version < '3.7'",
110+
"tld >= 0.13; python_version >= '3.7'",
109111
"urllib3 >= 1.26, < 2",
110112
],
111113
# extras_require=extras,

0 commit comments

Comments
 (0)