Skip to main content

A utility package for retrieving ATLAS open data URLs and metadata.

Project description

Atlas Open Magic 🪄📊

Tests Dynamic TOML Badge

Atlas Open Magic is a Python package made to simplify working with ATLAS Open Data by providing utilities to manage metadata and URLs for streaming the data.

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 .

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')

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('2016')

Functions description and usage

available_releases()

Shows the available open data releases keys and descriptions.

Usage:

import atlasopenmagic as atom
atom.available_releases()

get_current_release()

Retrieves the release that the package is currently set at.

Usage:

release = atom.get_current_release()
print(release)

set_release(release)

Set the release (scope) in which to look for information (research open data, education 8 TeV, et). The release passed to the function has to be one of the keys listed by available_releases().

Usage:

atom.set_release('2024r-pp')

get_metadata(key, *var)

Get metadata information for MC data.

Usage: You can get a dictionary with all the metadata

metadata = atom.get_metadata('301209')

Or a single variable

xsec = atom.get_metadata('301209', 'cross_section')

The available variables are: dataset_id, short_name, e-tag, cross_section, filter_efficiency, k_factor, number_events, sum_weights, sum_weights_squared, process, generators, keywords, description, job_link.

The keys to be used for research data are the Dataset IDs found in the Monte Carlo Metadata

get_urls(key)

Retrieves the list of URLs corresponding to a given key. This is used for MC data.

Usage:

urls = atom.get_urls('12345')

available_data()

Retrieves the list of keys for the data available for a scope.

Usage:

atom.available_data()

get_urls_data(data_key)

Retrieves the list of URLs corresponding to one of the keys listed by available_data().

Usage:

data = get_urls_data('2016')

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-name).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin feature-name).
  5. Create a Pull Request.

Please ensure all tests pass before submitting a pull request.

License

This project is licensed under the Apache 2.0 License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atlasopenmagic-0.3.1.tar.gz (225.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atlasopenmagic-0.3.1-py3-none-any.whl (242.3 kB view details)

Uploaded Python 3

File details

Details for the file atlasopenmagic-0.3.1.tar.gz.

File metadata

  • Download URL: atlasopenmagic-0.3.1.tar.gz
  • Upload date:
  • Size: 225.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for atlasopenmagic-0.3.1.tar.gz
Algorithm Hash digest
SHA256 584aa0f5120977f13f64c44dcd70c0cf74f7ef11e956bacee2d7e100b081951b
MD5 2cd540d6909adf4d2db8f39d2af4b8c3
BLAKE2b-256 f79441e6cf1b342ec3a010e76f00df033c9b702b8ece0d1f8f3bb822a9202e6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for atlasopenmagic-0.3.1.tar.gz:

Publisher: build-and-publish.yml on atlas-outreach-data-tools/atlasopenmagic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atlasopenmagic-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: atlasopenmagic-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 242.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for atlasopenmagic-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe664193a984c3cb5e178c5d3dd50c03d698a4ddd24e1a7173f73fc6738c9875
MD5 ecbaf9d5a0e5977750de3a078f5d00a9
BLAKE2b-256 f98b5e103d5f986802a89aef1520847b3ba18f218a843a38dcafbe0ca6aff66f

See more details on using hashes here.

Provenance

The following attestation bundles were made for atlasopenmagic-0.3.1-py3-none-any.whl:

Publisher: build-and-publish.yml on atlas-outreach-data-tools/atlasopenmagic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page