File tree 6 files changed +11
-10
lines changed
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)
130
130
```
131
131
132
132
## 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
+
1
3
from scrapingant_client .client import ScrapingAntClient
2
4
from scrapingant_client .cookie import Cookie
3
5
from scrapingant_client .errors import (
Original file line number Diff line number Diff line change 1
- import os
2
1
import platform
3
2
import sys
4
3
from typing import List , Optional
5
4
6
5
import requests
7
6
7
+ import scrapingant_client
8
8
from scrapingant_client .constants import SCRAPINGANT_API_BASE_URL
9
9
from scrapingant_client .cookie import Cookie , cookies_list_to_string , cookies_list_from_string
10
10
from scrapingant_client .errors import (
@@ -20,8 +20,7 @@ class ScrapingAntClient:
20
20
def __init__ (self , token : str ):
21
21
self .token = token
22
22
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__
25
24
user_agent = f'ScrapingAnt Client/{ version } ({ sys .platform } ; Python/{ platform .python_version ()} );'
26
25
self .requests_session .headers .update ({
27
26
'x-api-key' : self .token ,
Original file line number Diff line number Diff line change 1
1
import os
2
+ import pathlib
3
+ import re
2
4
3
5
import setuptools
4
6
5
7
with open ("README.md" , "r" , encoding = "utf-8" ) as fh :
6
8
long_description = fh .read ()
7
9
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 ]
10
13
11
14
setuptools .setup (
12
15
name = "scrapingant-client" ,
40
43
'responses>=0,<1'
41
44
]
42
45
},
43
- include_package_data = True ,
44
46
)
You can’t perform that action at this time.
0 commit comments