Fair Compute Python Client
Fair is a Python client for Fair Compute API. It allows to schedule jobs, monitor their status and retrieve results.
Creating Fair Account
To use FairCompute Python Client you need to have a Fair account. Please sign up at https://faircompute.com.
Launching a job
To launch a job, create a FairClient instance and call run method.
from fair import FairClient
client = FairClient('http://faircompute:8000', '<email>', '<password>')
client.run(image='alpine', command=['echo', 'hello fair compute'])
Developing Fair
This section is for developers of FairCompute Python client library.
Prerequisites
Create virtual environment and install requirements.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Testing
By default, testing is done against client running on localhost, so you need to start the server and at least one compute node locally. To start the server locally see https://github.com/faircompute/faircompute#running-locally.
Project is using pytest for testing. To run all tests:
pytest
To run tests against remote server, set FAIRCOMPUTE_SERVER_URL, FAIRCOMPUTE_USER_EMAIL
and FAIRCOMPUTE_USER_PASSWORD environment variables:
FAIRCOMPUTE_SERVER_URL=http://faircompute:8000 FAIRCOMPUTE_USER_EMAIL=<email> FAIRCOMPUTE_USER_PASSWORD=<password> pytest
Uploading to PyPI
Please follow the instructions at https://packaging.python.org/tutorials/packaging-projects/
rm -rf dist
python3 -m build
python3 -m twine upload --repository testpypi dist/*
python3 -m twine upload dist/*
Metadata
Release files for faircompute 0.22.1
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 |
|---|---|---|---|---|
| faircompute-0.22.1.tar.gz | 5.3 kB | Without provenance | Details for faircompute-0.22.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| faircompute-0.22.1-py3-none-any.whl | Python 3 | none | any | Details for faircompute-0.22.1-py3-none-any.whl |
Total release size: 11.0 kB
Release files / faircompute-0.22.1.tar.gz
| Download URL | faircompute-0.22.1.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba9961f510a34ab2b0bf24f32346fe374321ddfc1639f3df55628816112fdf59
|
|
BLAKE2b-256 checksum How to use checksums |
30586523f9240e38f53154938e21c1769913be4b3b2e01d9a7b58fe14a2e02e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / faircompute-0.22.1-py3-none-any.whl
| Download URL | faircompute-0.22.1-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4862366c15dd1c40b1fc289ae339fbec2644d2c647c3bf8f79b808abf94a2949
|
|
BLAKE2b-256 checksum How to use checksums |
144be15896a40d2728a11d60e636e2d8157570014a179cde5930bb1abf2c7594
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for faircompute 0.22.1
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.