ServiceX-Local
A drop in to enable local running of the ServiceX codegen and science images. This is mostly geared toward running for debugging and testing.
Installation
Install this as a library in your virtual environment with:
pip install servicex-localfor all the Docker based codegen and science container access.pip install servicex-local[xAOD]to get a local xAOD code generator (and the required dependencies) along with the docker based code.
Some science images requires a x509 certificate to run. You'll need to get the x509up into your /tmp area. If you don't have the tools installed locally, do the following:
- Make sure in your
~/.globusdirectory (on whatever OS you are no) contains theusercert.pemanduserkey.pemfiles - Use the
voms_proxy_initto initialize against theatlasvoms.
The science image code will pick up the location of the 509 cert.
Usage
Certificates
This will do its best to track x509 certs. If a file called x509up is located in your temp directory (including on windows), that will be copied into the docker image or other places to be used.
Example Code
This text is a DRAFT
To use this, example code is as follows:
codegen = LocalXAOD()
science_runner = ScienceWSL2("atlas_al9", "22.2.107")
adaptor = SXLocalAdaptor(codegen, science_runner)
# The simple query, take straight from the example in the documentation.
query = q.FuncADL_ATLASr22() # type: ignore
jets_per_event = query.Select(lambda e: e.Jets("AnalysisJets"))
jet_info_per_event = jets_per_event.Select(
lambda jets: {
"pt": jets.Select(lambda j: j.pt()),
"eta": jets.Select(lambda j: j.eta()),
}
)
spec = {
"Sample": [
{
"Name": "func_adl_xAOD_simple",
"Dataset": dataset.FileList(
[
"tests/test.root", # noqa: E501
]
),
"Query": jet_info_per_event,
}
]
}
files = deliver(spec, servicex_name="servicex-uc-af", sx_adaptor=adaptor)
assert files is not None, "No files returned from deliver! Internal error"
Running tests
If you are on a machine with wsl2 and or docker you can run the complete set of tests with flags:
pytest --wsl2 --docker
Acknowledgments
This docker versions of this code are thanks to @ketan96-m's work on this Service MR.
Metadata
Release files for servicex-local 1.2.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 | |
|---|---|---|---|
| servicex_local-1.2.1.tar.gz | 21.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| servicex_local-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.7 kB
Release files / servicex_local-1.2.1.tar.gz
| Download URL | servicex_local-1.2.1.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80e8987d2f76856105c1ce3dfea42d76af4421316e7b91a2a396a51f0b8e5743
|
|
BLAKE2b-256 checksum How to use checksums |
9e91520c8bb14797e6e7a537004c6a9942a99838870704960d8a7ec938319ea2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2026.
Transparency logRelease files / servicex_local-1.2.1-py3-none-any.whl
| Download URL | servicex_local-1.2.1-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
65bc98479530ca8f90f784e0d8381a1360b7ee643af862bf8cd5198ec6f3deb9
|
|
BLAKE2b-256 checksum How to use checksums |
085633c7c287dc71e32f7763937a9d3092791ecd77637b6c7a07df72d6a77b1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2026.
Transparency log