PERSESSION (PERsistent SESSION)
A wrapper on requests.Session with following additional functionalities:
- Persistence: session can be cached in a file for persistence between script runs.
- Login functionalities: login and is_logged_in functions are available to help logging into sites
Usage
from persession import Session, LoginStatus
base_url = 'https://e.com'
cache_file_path = 'cache.dat'
session = Session(cache_file_path)
is_logged_in = session.is_logged_in()
if not is_logged_in:
login_url = base_url + '/login'
data = {'user': 'user', 'password': 'pass'}
res = session.login(login_url, data)
if res.login_status != LoginStatus.FAILURE:
is_logged_in = True
print('Login success')
else:
print('login failed')
if is_logged_in:
data_url = base_url + '/data'
res = session.get(data_url)
You can also check out example.py for a detailed example.
Metadata
Release files for persession 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| persession-0.1.4.tar.gz | 4.9 kB | Without provenance | Details for persession-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| persession-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for persession-0.1.4-py3-none-any.whl |
Total release size: 14.5 kB
Release files / persession-0.1.4.tar.gz
| Download URL | persession-0.1.4.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d076b19fd8667d48beeaf37b1a4df9fa020284da8e3a4324f38e8d51711629d
|
|
BLAKE2b-256 checksum How to use checksums |
8d2ba1293acd81c4d55fc85ad670059367a70361d588d20809af4c0cc135a6f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8
|
Release files / persession-0.1.4-py3-none-any.whl
| Download URL | persession-0.1.4-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2e7ce54d53bedf2cbc4d47e0e65571cbe375f3fcce3443ec8f956e9d1b6f3b1
|
|
BLAKE2b-256 checksum How to use checksums |
d481c2282e3950ddfc1e7eca87a24a5d42170a65b86b0bc5927cb0b9f59f429d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8
|
Security for persession 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.