bas-http 1.0.3__tar.gz → 1.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bas_http-1.0.3 → bas_http-1.0.4}/PKG-INFO +60 -30
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/README.md +59 -29
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/__init__.py +1 -1
- {bas_http-1.0.3 → bas_http-1.0.4}/bas_http.egg-info/PKG-INFO +60 -30
- {bas_http-1.0.3 → bas_http-1.0.4}/pyproject.toml +1 -1
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/_curl.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/async_session.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/cookies.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/curl_parser.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/impersonate.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/models.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/session.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/simple_session.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/tests/__init__.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/tests/test_cookies.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/tests/test_curl_parser.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/tests/test_real_request.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas/tests/test_spaceshooter.py +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas_http.egg-info/SOURCES.txt +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas_http.egg-info/dependency_links.txt +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/bas_http.egg-info/top_level.txt +0 -0
- {bas_http-1.0.3 → bas_http-1.0.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bas-http
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Copy-paste your browser's request, bas handles the rest. No impersonation needed. Zero dependencies.
|
|
5
5
|
Author: bas
|
|
6
6
|
License-Expression: MIT
|
|
@@ -27,18 +27,22 @@ Description-Content-Type: text/markdown
|
|
|
27
27
|
|
|
28
28
|
Copy-paste your browser's request, bas handles the rest.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Zero dependencies. Pure Python. Just grab your headers + cookies from DevTools and go.
|
|
31
31
|
|
|
32
32
|
## Why bas?
|
|
33
33
|
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
34
|
+
| Feature | bas | requests | pycurl | curl_cffi |
|
|
35
|
+
|---------|-----|----------|--------|----------|
|
|
36
|
+
| Zero dependencies | ✅ | ❌ (urllib3) | ❌ (libcurl) | ❌ (curl-impersonate) |
|
|
37
|
+
| Paste curl from DevTools | ✅ | ❌ | ❌ | ❌ |
|
|
38
|
+
| Auto Cookie injection | ✅ | ✅ | ❌ | ⚠️ |
|
|
39
|
+
| Cookie jar (RFC 6265) | ✅ | ✅ | ❌ | ⚠️ |
|
|
40
|
+
| No compilation needed | ✅ | ✅ | ❌ | ❌ |
|
|
41
|
+
| Bring your own headers | ✅ | ❌ (generates) | ❌ | ❌ (impersonation) |
|
|
42
|
+
| Works on all platforms | ✅ | ✅ | ⚠️ | ⚠️ |
|
|
43
|
+
| Session persistence | ✅ | ✅ | ❌ | ✅ |
|
|
44
|
+
| Follow redirects | ✅ | ✅ | Manual | ✅ |
|
|
45
|
+
| JSON support | ✅ | ✅ | ❌ | ✅ |
|
|
42
46
|
|
|
43
47
|
## Installation
|
|
44
48
|
|
|
@@ -427,41 +431,67 @@ r = s.post("https://example.com/login", data={
|
|
|
427
431
|
print(r.status_code)
|
|
428
432
|
```
|
|
429
433
|
|
|
430
|
-
## Comparison with
|
|
434
|
+
## Comparison with Other Libraries
|
|
431
435
|
|
|
432
|
-
###
|
|
436
|
+
### requests
|
|
437
|
+
|
|
438
|
+
```python
|
|
439
|
+
import requests
|
|
440
|
+
|
|
441
|
+
# Manual header/cookie setup
|
|
442
|
+
s = requests.Session()
|
|
443
|
+
s.headers["User-Agent"] = "Mozilla/5.0 ..."
|
|
444
|
+
s.cookies.set("session", "abc", domain="example.com")
|
|
445
|
+
|
|
446
|
+
r = s.get("https://example.com")
|
|
447
|
+
# Works, but no curl copy-paste support
|
|
448
|
+
# Generates its own fingerprint (detectable)
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### pycurl
|
|
452
|
+
|
|
453
|
+
```python
|
|
454
|
+
import pycurl
|
|
455
|
+
from io import BytesIO
|
|
456
|
+
|
|
457
|
+
# Low-level, verbose setup
|
|
458
|
+
c = pycurl.Curl()
|
|
459
|
+
c.setopt(c.URL, "https://example.com")
|
|
460
|
+
c.setopt(c.HTTPHEADER, ["User-Agent: Mozilla/5.0 ...", "Cookie: session=abc"])
|
|
461
|
+
buffer = BytesIO()
|
|
462
|
+
c.setopt(c.WRITEDATA, buffer)
|
|
463
|
+
c.perform()
|
|
464
|
+
c.close()
|
|
465
|
+
|
|
466
|
+
# No built-in cookie jar, no redirect handling
|
|
467
|
+
# Requires libcurl installed on the system
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
### curl_cffi
|
|
433
471
|
|
|
434
472
|
```python
|
|
435
473
|
from curl_cffi.requests import Session
|
|
436
474
|
|
|
475
|
+
# Requires curl-impersonate installed
|
|
437
476
|
s = Session(impersonate="chrome131")
|
|
477
|
+
r = s.get("https://example.com")
|
|
438
478
|
|
|
439
|
-
#
|
|
440
|
-
|
|
441
|
-
# r1 is missing cookies from Set-Cookie headers!
|
|
442
|
-
|
|
443
|
-
# Cookies not accumulating!
|
|
444
|
-
r2 = s.get("https://example.com/page")
|
|
445
|
-
# r2 has LOST cookies from r1!
|
|
479
|
+
# Impersonation fingerprint can become outdated
|
|
480
|
+
# Cookie handling has known issues
|
|
446
481
|
```
|
|
447
482
|
|
|
448
|
-
### bas
|
|
483
|
+
### bas
|
|
449
484
|
|
|
450
485
|
```python
|
|
451
486
|
import bas
|
|
452
487
|
|
|
488
|
+
# Paste curl from DevTools — done
|
|
453
489
|
s = bas.from_curl(r'''curl "https://example.com" -b "session=abc"''')
|
|
454
490
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
#
|
|
458
|
-
|
|
459
|
-
# Cookies accumulate!
|
|
460
|
-
r2 = s.get("https://example.com/dashboard")
|
|
461
|
-
# r2 has ALL cookies from r1 + new ones
|
|
462
|
-
|
|
463
|
-
# No manual Cookie header needed!
|
|
464
|
-
# bas auto-injects cookies from the jar
|
|
491
|
+
r = s.get("https://example.com")
|
|
492
|
+
# All headers auto-applied
|
|
493
|
+
# Cookies auto-injected
|
|
494
|
+
# Zero setup, zero dependencies
|
|
465
495
|
```
|
|
466
496
|
|
|
467
497
|
## API Reference
|
|
@@ -2,18 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Copy-paste your browser's request, bas handles the rest.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Zero dependencies. Pure Python. Just grab your headers + cookies from DevTools and go.
|
|
6
6
|
|
|
7
7
|
## Why bas?
|
|
8
8
|
|
|
9
|
-
|
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
9
|
+
| Feature | bas | requests | pycurl | curl_cffi |
|
|
10
|
+
|---------|-----|----------|--------|----------|
|
|
11
|
+
| Zero dependencies | ✅ | ❌ (urllib3) | ❌ (libcurl) | ❌ (curl-impersonate) |
|
|
12
|
+
| Paste curl from DevTools | ✅ | ❌ | ❌ | ❌ |
|
|
13
|
+
| Auto Cookie injection | ✅ | ✅ | ❌ | ⚠️ |
|
|
14
|
+
| Cookie jar (RFC 6265) | ✅ | ✅ | ❌ | ⚠️ |
|
|
15
|
+
| No compilation needed | ✅ | ✅ | ❌ | ❌ |
|
|
16
|
+
| Bring your own headers | ✅ | ❌ (generates) | ❌ | ❌ (impersonation) |
|
|
17
|
+
| Works on all platforms | ✅ | ✅ | ⚠️ | ⚠️ |
|
|
18
|
+
| Session persistence | ✅ | ✅ | ❌ | ✅ |
|
|
19
|
+
| Follow redirects | ✅ | ✅ | Manual | ✅ |
|
|
20
|
+
| JSON support | ✅ | ✅ | ❌ | ✅ |
|
|
17
21
|
|
|
18
22
|
## Installation
|
|
19
23
|
|
|
@@ -402,41 +406,67 @@ r = s.post("https://example.com/login", data={
|
|
|
402
406
|
print(r.status_code)
|
|
403
407
|
```
|
|
404
408
|
|
|
405
|
-
## Comparison with
|
|
409
|
+
## Comparison with Other Libraries
|
|
406
410
|
|
|
407
|
-
###
|
|
411
|
+
### requests
|
|
412
|
+
|
|
413
|
+
```python
|
|
414
|
+
import requests
|
|
415
|
+
|
|
416
|
+
# Manual header/cookie setup
|
|
417
|
+
s = requests.Session()
|
|
418
|
+
s.headers["User-Agent"] = "Mozilla/5.0 ..."
|
|
419
|
+
s.cookies.set("session", "abc", domain="example.com")
|
|
420
|
+
|
|
421
|
+
r = s.get("https://example.com")
|
|
422
|
+
# Works, but no curl copy-paste support
|
|
423
|
+
# Generates its own fingerprint (detectable)
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### pycurl
|
|
427
|
+
|
|
428
|
+
```python
|
|
429
|
+
import pycurl
|
|
430
|
+
from io import BytesIO
|
|
431
|
+
|
|
432
|
+
# Low-level, verbose setup
|
|
433
|
+
c = pycurl.Curl()
|
|
434
|
+
c.setopt(c.URL, "https://example.com")
|
|
435
|
+
c.setopt(c.HTTPHEADER, ["User-Agent: Mozilla/5.0 ...", "Cookie: session=abc"])
|
|
436
|
+
buffer = BytesIO()
|
|
437
|
+
c.setopt(c.WRITEDATA, buffer)
|
|
438
|
+
c.perform()
|
|
439
|
+
c.close()
|
|
440
|
+
|
|
441
|
+
# No built-in cookie jar, no redirect handling
|
|
442
|
+
# Requires libcurl installed on the system
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### curl_cffi
|
|
408
446
|
|
|
409
447
|
```python
|
|
410
448
|
from curl_cffi.requests import Session
|
|
411
449
|
|
|
450
|
+
# Requires curl-impersonate installed
|
|
412
451
|
s = Session(impersonate="chrome131")
|
|
452
|
+
r = s.get("https://example.com")
|
|
413
453
|
|
|
414
|
-
#
|
|
415
|
-
|
|
416
|
-
# r1 is missing cookies from Set-Cookie headers!
|
|
417
|
-
|
|
418
|
-
# Cookies not accumulating!
|
|
419
|
-
r2 = s.get("https://example.com/page")
|
|
420
|
-
# r2 has LOST cookies from r1!
|
|
454
|
+
# Impersonation fingerprint can become outdated
|
|
455
|
+
# Cookie handling has known issues
|
|
421
456
|
```
|
|
422
457
|
|
|
423
|
-
### bas
|
|
458
|
+
### bas
|
|
424
459
|
|
|
425
460
|
```python
|
|
426
461
|
import bas
|
|
427
462
|
|
|
463
|
+
# Paste curl from DevTools — done
|
|
428
464
|
s = bas.from_curl(r'''curl "https://example.com" -b "session=abc"''')
|
|
429
465
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
#
|
|
433
|
-
|
|
434
|
-
# Cookies accumulate!
|
|
435
|
-
r2 = s.get("https://example.com/dashboard")
|
|
436
|
-
# r2 has ALL cookies from r1 + new ones
|
|
437
|
-
|
|
438
|
-
# No manual Cookie header needed!
|
|
439
|
-
# bas auto-injects cookies from the jar
|
|
466
|
+
r = s.get("https://example.com")
|
|
467
|
+
# All headers auto-applied
|
|
468
|
+
# Cookies auto-injected
|
|
469
|
+
# Zero setup, zero dependencies
|
|
440
470
|
```
|
|
441
471
|
|
|
442
472
|
## API Reference
|
|
@@ -28,7 +28,7 @@ from .curl_parser import parse_curl, curl_to_session, print_curl_summary
|
|
|
28
28
|
from .cookies import Cookie, CookieJar
|
|
29
29
|
from .models import Headers, PreparedRequest, Response, HTTPError
|
|
30
30
|
|
|
31
|
-
__version__ = "1.0.
|
|
31
|
+
__version__ = "1.0.4"
|
|
32
32
|
__author__ = "bas"
|
|
33
33
|
|
|
34
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bas-http
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: Copy-paste your browser's request, bas handles the rest. No impersonation needed. Zero dependencies.
|
|
5
5
|
Author: bas
|
|
6
6
|
License-Expression: MIT
|
|
@@ -27,18 +27,22 @@ Description-Content-Type: text/markdown
|
|
|
27
27
|
|
|
28
28
|
Copy-paste your browser's request, bas handles the rest.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Zero dependencies. Pure Python. Just grab your headers + cookies from DevTools and go.
|
|
31
31
|
|
|
32
32
|
## Why bas?
|
|
33
33
|
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
34
|
+
| Feature | bas | requests | pycurl | curl_cffi |
|
|
35
|
+
|---------|-----|----------|--------|----------|
|
|
36
|
+
| Zero dependencies | ✅ | ❌ (urllib3) | ❌ (libcurl) | ❌ (curl-impersonate) |
|
|
37
|
+
| Paste curl from DevTools | ✅ | ❌ | ❌ | ❌ |
|
|
38
|
+
| Auto Cookie injection | ✅ | ✅ | ❌ | ⚠️ |
|
|
39
|
+
| Cookie jar (RFC 6265) | ✅ | ✅ | ❌ | ⚠️ |
|
|
40
|
+
| No compilation needed | ✅ | ✅ | ❌ | ❌ |
|
|
41
|
+
| Bring your own headers | ✅ | ❌ (generates) | ❌ | ❌ (impersonation) |
|
|
42
|
+
| Works on all platforms | ✅ | ✅ | ⚠️ | ⚠️ |
|
|
43
|
+
| Session persistence | ✅ | ✅ | ❌ | ✅ |
|
|
44
|
+
| Follow redirects | ✅ | ✅ | Manual | ✅ |
|
|
45
|
+
| JSON support | ✅ | ✅ | ❌ | ✅ |
|
|
42
46
|
|
|
43
47
|
## Installation
|
|
44
48
|
|
|
@@ -427,41 +431,67 @@ r = s.post("https://example.com/login", data={
|
|
|
427
431
|
print(r.status_code)
|
|
428
432
|
```
|
|
429
433
|
|
|
430
|
-
## Comparison with
|
|
434
|
+
## Comparison with Other Libraries
|
|
431
435
|
|
|
432
|
-
###
|
|
436
|
+
### requests
|
|
437
|
+
|
|
438
|
+
```python
|
|
439
|
+
import requests
|
|
440
|
+
|
|
441
|
+
# Manual header/cookie setup
|
|
442
|
+
s = requests.Session()
|
|
443
|
+
s.headers["User-Agent"] = "Mozilla/5.0 ..."
|
|
444
|
+
s.cookies.set("session", "abc", domain="example.com")
|
|
445
|
+
|
|
446
|
+
r = s.get("https://example.com")
|
|
447
|
+
# Works, but no curl copy-paste support
|
|
448
|
+
# Generates its own fingerprint (detectable)
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### pycurl
|
|
452
|
+
|
|
453
|
+
```python
|
|
454
|
+
import pycurl
|
|
455
|
+
from io import BytesIO
|
|
456
|
+
|
|
457
|
+
# Low-level, verbose setup
|
|
458
|
+
c = pycurl.Curl()
|
|
459
|
+
c.setopt(c.URL, "https://example.com")
|
|
460
|
+
c.setopt(c.HTTPHEADER, ["User-Agent: Mozilla/5.0 ...", "Cookie: session=abc"])
|
|
461
|
+
buffer = BytesIO()
|
|
462
|
+
c.setopt(c.WRITEDATA, buffer)
|
|
463
|
+
c.perform()
|
|
464
|
+
c.close()
|
|
465
|
+
|
|
466
|
+
# No built-in cookie jar, no redirect handling
|
|
467
|
+
# Requires libcurl installed on the system
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
### curl_cffi
|
|
433
471
|
|
|
434
472
|
```python
|
|
435
473
|
from curl_cffi.requests import Session
|
|
436
474
|
|
|
475
|
+
# Requires curl-impersonate installed
|
|
437
476
|
s = Session(impersonate="chrome131")
|
|
477
|
+
r = s.get("https://example.com")
|
|
438
478
|
|
|
439
|
-
#
|
|
440
|
-
|
|
441
|
-
# r1 is missing cookies from Set-Cookie headers!
|
|
442
|
-
|
|
443
|
-
# Cookies not accumulating!
|
|
444
|
-
r2 = s.get("https://example.com/page")
|
|
445
|
-
# r2 has LOST cookies from r1!
|
|
479
|
+
# Impersonation fingerprint can become outdated
|
|
480
|
+
# Cookie handling has known issues
|
|
446
481
|
```
|
|
447
482
|
|
|
448
|
-
### bas
|
|
483
|
+
### bas
|
|
449
484
|
|
|
450
485
|
```python
|
|
451
486
|
import bas
|
|
452
487
|
|
|
488
|
+
# Paste curl from DevTools — done
|
|
453
489
|
s = bas.from_curl(r'''curl "https://example.com" -b "session=abc"''')
|
|
454
490
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
#
|
|
458
|
-
|
|
459
|
-
# Cookies accumulate!
|
|
460
|
-
r2 = s.get("https://example.com/dashboard")
|
|
461
|
-
# r2 has ALL cookies from r1 + new ones
|
|
462
|
-
|
|
463
|
-
# No manual Cookie header needed!
|
|
464
|
-
# bas auto-injects cookies from the jar
|
|
491
|
+
r = s.get("https://example.com")
|
|
492
|
+
# All headers auto-applied
|
|
493
|
+
# Cookies auto-injected
|
|
494
|
+
# Zero setup, zero dependencies
|
|
465
495
|
```
|
|
466
496
|
|
|
467
497
|
## API Reference
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "bas-http"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.4"
|
|
8
8
|
description = "Copy-paste your browser's request, bas handles the rest. No impersonation needed. Zero dependencies."
|
|
9
9
|
readme = "bas/README.md"
|
|
10
10
|
license = "MIT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|