Skip to content

Commit 029ae59

Browse files
committed
master: first release
1 parent ada51f3 commit 029ae59

File tree

5 files changed

+42
-17
lines changed

5 files changed

+42
-17
lines changed

.github/workflows/publish.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ jobs:
3030
- name: Publish distribution 📦 to PyPI
3131
uses: pypa/gh-action-pypi-publish@master
3232
with:
33-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
34-
repository_url: https://test.pypi.org/legacy/
33+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ dist
33
.DS_Store
44
poetry.lock
55
*/__pycache__/
6-
*.egg-info/
6+
*.egg-info/

README.md

+34-12
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ Python applications. It provides useful features like parameters encoding to im
66

77
- [Quick Start](#quick-start)
88
- [API key](#api-key)
9-
- [Retries with exponential backoff](#retries-with-exponential-backoff)
109
- [API Reference](#api-reference)
1110
- [Examples](#examples)
1211

1312
<!-- tocstop -->
1413

1514
## Quick Start
1615
```python3
17-
from scrapingant_client.client import ScrapingAntClient
16+
from scrapingant_client import ScrapingAntClient
1817

1918
client = ScrapingAntClient(token='<YOUR-SCRAPINGANT-API-TOKEN>')
2019
# Scrape the example.com site.
@@ -35,35 +34,58 @@ All public classes, methods and their parameters can be inspected in this API re
3534

3635
| Param | Type | Default |
3736
| --- | --- | --- |
38-
| [token] | <code>string</code> | |
39-
37+
| token | <code>string</code> | |
4038

4139

4240
* * *
4341

4442
<a name="ScrapingAntClient+scrape"></a>
4543

46-
#### [](#ScrapingAntClient+scrape) `ScrapingAntClient.general_request(url, cookies, js_snippet, proxy_country, return_text)`[<code>ScrapingAnt API response</code>](https://docs.scrapingant.com/request-response-format#response-structure)
44+
### [](#ScrapingAntClient+scrape) `ScrapingAntClient.general_request(url, cookies, js_snippet, proxy_country, return_text)`Response
4745

4846
https://docs.scrapingant.com/request-response-format#available-parameters
4947

5048
| Param | Type | Default |
5149
| --- | --- | --- |
5250
| url | <code>string</code> | |
53-
| cookies | <code>string</code> | None |
51+
| cookies | <code>List[Cookie]</code> | None |
5452
| js_snippet | <code>string</code> | None |
55-
| proxy_country | <code>string</code> | None |
53+
| proxy_country | <code>ProxyCountry</code> | None |
5654
| return_text | <code>boolean</code> | False |
5755

5856
**IMPORTANT NOTE:** <code>js_snippet</code> will be encoded to Base64 automatically by the ScrapingAnt client library.
5957

6058
* * *
6159

62-
<a name="ScrapingAntApiError"></a>
60+
### [](#Cookie) Cookie
61+
Class defining cookie. Curently supports only name and value
62+
63+
| Param | Type |
64+
| --- | --- |
65+
| name | <code>string</code> |
66+
| value | <code>string</code> |
67+
68+
* * *
69+
70+
### [](#ProxyCountry) ProxyCountry
71+
72+
Enum containing all available proxy countries
73+
74+
* * *
75+
76+
### [](#Response) Response
77+
Class defining cookie. Curently supports only name and value
78+
79+
| Param | Type |
80+
| --- | --- |
81+
| content | <code>string</code> |
82+
| cookies | <code>List[Cookie]</code> |
83+
84+
* * *
6385

6486
### [](#ScrapingantClientException) ScrapingantClientException
6587

66-
`ScrapingantClientException` is base Exception class, used for all errors
88+
`ScrapingantClientException` is base Exception class, used for all errors.
6789

6890
* * *
6991

@@ -72,8 +94,8 @@ https://docs.scrapingant.com/request-response-format#available-parameters
7294
### Sending custom cookies
7395

7496
```python3
75-
from scrapingant_client.client import ScrapingAntClient
76-
from scrapingant_client.cookie import Cookie
97+
from scrapingant_client import ScrapingAntClient
98+
from scrapingant_client import Cookie
7799

78100
client = ScrapingAntClient(token='<YOUR-SCRAPINGANT-API-TOKEN>')
79101

@@ -93,7 +115,7 @@ response_cookies = result.cookies
93115
### Executing custom JS snippet
94116

95117
```python
96-
from scrapingant_client.client import ScrapingAntClient
118+
from scrapingant_client import ScrapingAntClient
97119
client = ScrapingAntClient(token='<YOUR-SCRAPINGANT-API-TOKEN>')
98120

99121
customJsSnippet = """

scrapingant_client/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
__version__ = '0.1.0'
1+
from client import ScrapingAntClient
2+
from constants import ProxyCountry
3+
from cookie import Cookie
4+
from errors import ScrapingantClientException
5+
from response import Response

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="scrapingant-client",
8-
version="0.1.1",
8+
version="0.1.0",
99
author="andrii.kovalenko",
1010
author_email="[email protected]",
1111
license='Apache-2.0',

0 commit comments

Comments
 (0)