A utility package for retrieving ATLAS open data URLs and metadata.
Project description
ATLAS Open Magic 🪄📊
atlasopenmagic is a Python package made to simplify working with ATLAS Open Data by providing utilities to manage metadata and URLs for streaming the data.
Key Features:
- Simple functions to set the active data release (e.g.,
2024r-pp). - Efficient local caching of metadata to minimize API calls.
- Helper functions to retrieve specific dataset information, including file URLs for different "skims" (filtered versions of datasets).
- Support for multiple URL protocols (root, https, eos).
- Configuration via environment variables for easy integration into different workflows.
Installation
You can install this package using pip.
pip install atlasopenmagic
Alternatively, clone the repository and install locally:
git clone https://github.com/atlas-outreach-data-tools/atlasopenmagic.git
cd atlasopenmagic
pip install .
Documentation
You can find the full documentation for ATLAS Open Magic in the ATLAS Open Data website.
Quick start
First, import the package:
import atlasopenmagic as atom
See the available releases and set to one of the options given by available_releases()
atom.available_releases()
set_release('2024r-pp')
Check in the Monte Carlo Metadata which datasets do you want to retrieve and use the 'Dataset ID'. For example, to get the metadata from Pythia8EvtGen_A14MSTW2008LO_Zprime_NoInt_ee_SSM3000:
all_metadata = atom.get_metadata('301204')
If we only want a specific variable:
xsec = atom.get_metadata('301204', 'cross_section_pb')
To get the URLs to stream the files for that MC dataset:
all_mc = atom.get_urls('301204')
To get some data instead, check the available options:
atom.available_data()
And get the URLs for the one that's to be used:
all_mc = atom.get_urls('data')
Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-name). - Commit your changes (
git commit -am 'Add some feature'). - Push to the branch (
git push origin feature-name). - Create a Pull Request.
Please ensure all tests pass before submitting a pull request (just run pytest from the main directory of the package).
Developers can also pip install including additional tools required for testing:
pip install atlasopenmagic[dev]
or with a local copy of the repository:
pip install '.[dev]'
Pre-commit Hooks
We use pre-commit hooks, find below how to use them.
Installation
-
Install the
[dev]dependencies if you haven't already, as shown above. -
Install the git hook scripts:
pre-commit install
- (Optional) Run against all files:
pre-commit run --all-files
What the hooks do
- black: Formats Python code consistently
- isort: Sorts imports alphabetically and separates them into sections
- ruff: Fast Python linter that catches common errors and style issues
- codespell: Checks for common misspellings in code and comments
- trailing-whitespace: Removes trailing whitespace
- end-of-file-fixer: Ensures files end with a newline
- pydocstyle: Checks docstring style (Google convention)
The hooks will run automatically on git commit.
If any hook fails, the commit will be blocked until the issues are fixed.
License
This project is licensed under the Apache 2.0 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file atlasopenmagic-1.8.0.tar.gz.
File metadata
- Download URL: atlasopenmagic-1.8.0.tar.gz
- Upload date:
- Size: 32.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d0ba66bc8119c6905359f1463b1e69687f50fff0173633c1af8c16606be0e7d
|
|
| MD5 |
0303afe26d5876708bc03169a054f2ad
|
|
| BLAKE2b-256 |
c87a1879096f923add7168689d264a79ae892ef4d6998beb865a10507f2225ee
|
Provenance
The following attestation bundles were made for atlasopenmagic-1.8.0.tar.gz:
Publisher:
build-and-publish.yml on atlas-outreach-data-tools/atlasopenmagic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atlasopenmagic-1.8.0.tar.gz -
Subject digest:
9d0ba66bc8119c6905359f1463b1e69687f50fff0173633c1af8c16606be0e7d - Sigstore transparency entry: 708586052
- Sigstore integration time:
-
Permalink:
atlas-outreach-data-tools/atlasopenmagic@4d1561ad71a227e68a883644eb57e1083ddda5f7 -
Branch / Tag:
refs/tags/v1.8.0 - Owner: https://github.com/atlas-outreach-data-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@4d1561ad71a227e68a883644eb57e1083ddda5f7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file atlasopenmagic-1.8.0-py3-none-any.whl.
File metadata
- Download URL: atlasopenmagic-1.8.0-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
487bbf08a8009d6da36c334c8d35d31819e1f72651718be297f2b90bb5407656
|
|
| MD5 |
7cc2f1f05fa8253788803561146fce21
|
|
| BLAKE2b-256 |
484dde3ecfff1c44d27a68477339752074002dfe7991c1ce3f8d51647f0912b3
|
Provenance
The following attestation bundles were made for atlasopenmagic-1.8.0-py3-none-any.whl:
Publisher:
build-and-publish.yml on atlas-outreach-data-tools/atlasopenmagic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atlasopenmagic-1.8.0-py3-none-any.whl -
Subject digest:
487bbf08a8009d6da36c334c8d35d31819e1f72651718be297f2b90bb5407656 - Sigstore transparency entry: 708586053
- Sigstore integration time:
-
Permalink:
atlas-outreach-data-tools/atlasopenmagic@4d1561ad71a227e68a883644eb57e1083ddda5f7 -
Branch / Tag:
refs/tags/v1.8.0 - Owner: https://github.com/atlas-outreach-data-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@4d1561ad71a227e68a883644eb57e1083ddda5f7 -
Trigger Event:
release
-
Statement type: