qload : better assertion on files
qload is a library to load or extract content of a file to perform assertion in automatic tests without boilerplate. It support file from filesystem, ftp, s3, ...
Benefits
- oneliner to assert on the content of a file
- useful differential when the test fails thanks to subpart extraction
- support for the most common formats (yaml, csv, json, txt)
- support for multiple file systems and protocols (local, ftp, s3)
- rich expression engine to extract part of a file (regexp for
textand jmespath forcsv,jsonandyamlto improve differential)
Gettings started
pip install qload
Usage
import qload
assert 'database_url: postgresql://127.0.0.1:5432/postgres' in qload.text('file.txt')
assert qload.text('file.txt', expression='Hello .*') == 'Hello Fabien'
assert qload.json('file.json') == {}
assert qload.json('s3://mybucket/file1.json') == {}
assert qload.json('file.json', expression='$.id') == ''
assert len(qload.json('file.json', expression='$.id')) == 4
assert qload.yaml('file.yml') == {}
assert qload.yaml('file.yml', expression='$.id') == ''
assert qload.csv('file.csv', expression='[*].Account') == ['ALK', 'BTL', 'CKL']
assert qload.csv('file.csv', expression='[*].Account')[0] == 'ALK'
assert qload.parquet('file.parquet', expression='[*].Account')[0] == 'ALK'
assert qload.ftp(host='localhost', port=21, login='admin', password='admin').csv(path='dir/file.csv', expression='') == []
assert qload.s3(bucket='bucket', aws_access_key_id='', aws_secret_access_key='', region_name='eu-west-1', endpoint_url='http://localhost:9090').json(path='dir/file.csv') == {}
assert qload.isfile('file.json') is True
assert qload.s3(bucket='bucket').isfile('file.json') is True
Metadata
Release files for qload 1.0.3
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 |
|---|---|---|---|---|
| qload-1.0.3.tar.gz | 5.3 kB | Without provenance | Details for qload-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qload-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for qload-1.0.3-py3-none-any.whl |
Total release size: 11.9 kB
Release files / qload-1.0.3.tar.gz
| Download URL | qload-1.0.3.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
415bde98c37d47c756ba07aaeb45f148de0fb22ccf1b1367a2ed8d94373049eb
|
|
BLAKE2b-256 checksum How to use checksums |
d1d199d58ce87873ac39400f39f50d4846a69cdfa2634cc47c3ba4344b66a263
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-35-generic
|
Release files / qload-1.0.3-py3-none-any.whl
| Download URL | qload-1.0.3-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af38eafd0ec0bfbf439f5d2a6db057f2255d339313afa9aef8517faf10d6188f
|
|
BLAKE2b-256 checksum How to use checksums |
afbf27c829349cd42b389a4e5051c3d89348d509d8ac989be79cb2e3124f23d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-35-generic
|
Security for qload 1.0.3
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.