File tree Expand file tree Collapse file tree 6 files changed +11
-10
lines changed Expand file tree Collapse file tree 6 files changed +11
-10
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -130,5 +130,5 @@ print(result.content)
130130```
131131
132132## Useful links
133- - [ Scrapingant Api doumentation] ( https://docs.scrapingant.com )
134- - [ Scrapingant Js Client] ( https://github.com/scrapingant/scrapingant-client-js )
133+ - [ Scrapingant API doumentation] ( https://docs.scrapingant.com )
134+ - [ Scrapingant JS Client] ( https://github.com/scrapingant/scrapingant-client-js )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ __version__ = "0.3.3"
2+
13from scrapingant_client .client import ScrapingAntClient
24from scrapingant_client .cookie import Cookie
35from scrapingant_client .errors import (
Original file line number Diff line number Diff line change 1- import os
21import platform
32import sys
43from typing import List , Optional
54
65import requests
76
7+ import scrapingant_client
88from scrapingant_client .constants import SCRAPINGANT_API_BASE_URL
99from scrapingant_client .cookie import Cookie , cookies_list_to_string , cookies_list_from_string
1010from scrapingant_client .errors import (
@@ -20,8 +20,7 @@ class ScrapingAntClient:
2020 def __init__ (self , token : str ):
2121 self .token = token
2222 self .requests_session = requests .Session ()
23- version_file = open (os .path .join ('scrapingant_client' , 'VERSION' ))
24- version = version_file .read ().strip ()
23+ version = scrapingant_client .__version__
2524 user_agent = f'ScrapingAnt Client/{ version } ({ sys .platform } ; Python/{ platform .python_version ()} );'
2625 self .requests_session .headers .update ({
2726 'x-api-key' : self .token ,
Original file line number Diff line number Diff line change 11import os
2+ import pathlib
3+ import re
24
35import setuptools
46
57with open ("README.md" , "r" , encoding = "utf-8" ) as fh :
68 long_description = fh .read ()
79
8- version_file = open (os .path .join ('scrapingant_client' , 'VERSION' ))
9- version = version_file .read ().strip ()
10+ HERE = pathlib .Path (__file__ ).parent
11+ txt = (HERE / "scrapingant_client" / "__init__.py" ).read_text ("utf-8" )
12+ version = re .findall (r'^__version__ = "([^"]+)"\r?$' , txt , re .M )[0 ]
1013
1114setuptools .setup (
1215 name = "scrapingant-client" ,
4043 'responses>=0,<1'
4144 ]
4245 },
43- include_package_data = True ,
4446)
You can’t perform that action at this time.
0 commit comments