scrapy / scrapy
1
"""
2
Scrapy - a web crawling and web scraping framework written for Python
3
"""
4

5 7
import pkgutil
6 7
import sys
7 7
import warnings
8

9 7
from twisted import version as _txv
10

11
# Declare top-level shortcuts
12 7
from scrapy.spiders import Spider
13 7
from scrapy.http import Request, FormRequest
14 7
from scrapy.selector import Selector
15 7
from scrapy.item import Item, Field
16

17

18 7
__all__ = [
19
    '__version__', 'version_info', 'twisted_version', 'Spider',
20
    'Request', 'FormRequest', 'Selector', 'Item', 'Field',
21
]
22

23

24
# Scrapy and Twisted versions
25 7
__version__ = (pkgutil.get_data(__package__, "VERSION") or b"").decode("ascii").strip()
26 7
version_info = tuple(int(v) if v.isdigit() else v for v in __version__.split('.'))
27 7
twisted_version = (_txv.major, _txv.minor, _txv.micro)
28

29

30
# Check minimum required Python version
31 7
if sys.version_info < (3, 6):
32 0
    print("Scrapy %s requires Python 3.6+" % __version__)
33 0
    sys.exit(1)
34

35

36
# Ignore noisy twisted deprecation warnings
37 7
warnings.filterwarnings('ignore', category=DeprecationWarning, module='twisted')
38

39

40 7
del pkgutil
41 7
del sys
42 7
del warnings

Read our documentation on viewing source code .

Loading