# hepdata_lib
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1217998.svg)](https://doi.org/10.5281/zenodo.1217998)
[![PyPI version](https://badge.fury.io/py/hepdata-lib.svg)](https://badge.fury.io/py/hepdata-lib)
[![Actions Status](https://github.com/HEPData/hepdata_lib/workflows/tests/badge.svg)](https://github.com/HEPData/hepdata_lib/actions)
[![Coverage Status](https://codecov.io/gh/HEPData/hepdata_lib/graph/badge.svg?branch=main)](https://codecov.io/gh/HEPData/hepdata_lib?branch=main)
[![Documentation Status](https://readthedocs.org/projects/hepdata-lib/badge/)](http://hepdata-lib.readthedocs.io/)
[![Docker image](https://github.com/HEPData/hepdata_lib/actions/workflows/docker.yml/badge.svg)](https://github.com/HEPData/hepdata_lib/pkgs/container/hepdata_lib)
Library for getting your data into HEPData
- Documentation: https://hepdata-lib.readthedocs.io
This code works with Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11 or 3.12.
## Installation
It is highly recommended you install `hepdata_lib` into a [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).
```shell
pip install hepdata_lib
```
If you are not sure about your Python environment, please also see below how to use `hepdata_lib` in a Docker or Apptainer container.
## Getting started
For using `hepdata_lib`, you don't even need to install it, but can use the [binder](https://mybinder.org/) or [SWAN](https://swan.cern.ch/) (CERN-only) services using one of the buttons below:
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/Getting_started.ipynb)
[![SWAN](https://swanserver.web.cern.ch/swanserver/images/badge_swan_white_150.png)](https://cern.ch/swanserver/cgi-bin/go/?projurl=https://github.com/HEPData/hepdata_lib.git)
You can also use the Docker image:
```shell
docker run --rm -it -p 8888:8888 -v ${PWD}:/home/hepdata ghcr.io/hepdata/hepdata_lib:latest
```
And then point your browser to [http://localhost:8888](http://localhost:8888) and use the token that is printed out. The output will end up in your current working directory (`${PWD}`).
If you prefer a shell, instead run:
```shell
docker run --rm -it -p 8888:8888 -v ${PWD}:/home/hepdata ghcr.io/hepdata/hepdata_lib:latest bash
```
If on CERN LXPLUS or anywhere else where there is Apptainer available but not Docker, you can still use the docker image:
```shell
export APPTAINER_CACHEDIR="/tmp/$(whoami)/apptainer"
apptainer shell -B /afs -B /eos docker://ghcr.io/hepdata/hepdata_lib:latest bash
```
Unpacking the image can take a few minutes the first time you use it. Please be patient. Both EOS and AFS should be available and the output will be in your current working directory.
## Further examples
There are a few more examples available that can directly be run using the [binder](https://mybinder.org/) links below or using [SWAN](https://swan.cern.ch/) (CERN-only, please use LCG release LCG_94 or later) and selecting the corresponding notebook manually:
- [Reading in text files](https://github.com/HEPData/hepdata_lib/blob/main/examples/Getting_started.ipynb)
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/Getting_started.ipynb)
<br/><br/>
- [Reading in a CMS combine ntuple](https://github.com/HEPData/hepdata_lib/blob/main/examples/combine_limits.ipynb)
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/combine_limits.ipynb)
<br/><br/>
- [Reading in ROOT histograms](https://github.com/HEPData/hepdata_lib/blob/main/examples/reading_histograms.ipynb)
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/reading_histograms.ipynb)
<br/><br/>
- [Reading a correlation matrix](https://github.com/HEPData/hepdata_lib/blob/main/examples/correlation.ipynb)
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/correlation.ipynb)
<br/><br/>
- [Reading TGraph and TGraphError from '.C' files](https://github.com/HEPData/hepdata_lib/blob/main/examples/read_c_file.ipynb)
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/read_c_file.ipynb)
<br/><br/>
- [Preparing scikit-hep histograms](https://github.com/HEPData/hepdata_lib/blob/main/examples/reading_scikithep_histograms.ipynb)
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/reading_scikihep_histograms.ipynb)
<br/><br/>
## External dependencies
- [ROOT](https://root.cern.ch)
- [ImageMagick](https://www.imagemagick.org)
Make sure that you have `ROOT` in your `$PYTHONPATH` and that the `convert` command is available by adding its location to your `$PATH` if needed.
A ROOT installation is not strictly required if your input data is not in a ROOT format, for example, if
your input data is provided as text files or `scikit-hep/hist` histograms. Most of the `hepdata_lib`
functionality can be used without a ROOT installation, other than the `RootFileReader` and `CFileReader` classes,
and other functions of the `hepdata_lib.root_utils` module.
Raw data
{
"_id": null,
"home_page": "https://github.com/HEPData/hepdata_lib",
"name": "hepdata-lib",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "HEPData physics OpenData",
"author": "Andreas Albert, Clemens Lange",
"author_email": "hepdata-lib@cern.ch",
"download_url": "https://files.pythonhosted.org/packages/6c/4b/79135513b2bc8f490328dcb9ea22632f4520a4ec1fd22b603ca25bb28574/hepdata_lib-0.15.0.tar.gz",
"platform": null,
"description": "# hepdata_lib\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1217998.svg)](https://doi.org/10.5281/zenodo.1217998)\n[![PyPI version](https://badge.fury.io/py/hepdata-lib.svg)](https://badge.fury.io/py/hepdata-lib)\n[![Actions Status](https://github.com/HEPData/hepdata_lib/workflows/tests/badge.svg)](https://github.com/HEPData/hepdata_lib/actions)\n[![Coverage Status](https://codecov.io/gh/HEPData/hepdata_lib/graph/badge.svg?branch=main)](https://codecov.io/gh/HEPData/hepdata_lib?branch=main)\n[![Documentation Status](https://readthedocs.org/projects/hepdata-lib/badge/)](http://hepdata-lib.readthedocs.io/)\n[![Docker image](https://github.com/HEPData/hepdata_lib/actions/workflows/docker.yml/badge.svg)](https://github.com/HEPData/hepdata_lib/pkgs/container/hepdata_lib)\n\nLibrary for getting your data into HEPData\n\n- Documentation: https://hepdata-lib.readthedocs.io\n\nThis code works with Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11 or 3.12.\n\n## Installation\n\nIt is highly recommended you install `hepdata_lib` into a [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).\n\n```shell\npip install hepdata_lib\n```\n\nIf you are not sure about your Python environment, please also see below how to use `hepdata_lib` in a Docker or Apptainer container.\n\n## Getting started\n\nFor using `hepdata_lib`, you don't even need to install it, but can use the [binder](https://mybinder.org/) or [SWAN](https://swan.cern.ch/) (CERN-only) services using one of the buttons below:\n\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/Getting_started.ipynb)\n[![SWAN](https://swanserver.web.cern.ch/swanserver/images/badge_swan_white_150.png)](https://cern.ch/swanserver/cgi-bin/go/?projurl=https://github.com/HEPData/hepdata_lib.git)\n\nYou can also use the Docker image:\n\n```shell\ndocker run --rm -it -p 8888:8888 -v ${PWD}:/home/hepdata ghcr.io/hepdata/hepdata_lib:latest\n```\n\nAnd then point your browser to [http://localhost:8888](http://localhost:8888) and use the token that is printed out. The output will end up in your current working directory (`${PWD}`).\n\nIf you prefer a shell, instead run:\n\n```shell\ndocker run --rm -it -p 8888:8888 -v ${PWD}:/home/hepdata ghcr.io/hepdata/hepdata_lib:latest bash\n```\n\nIf on CERN LXPLUS or anywhere else where there is Apptainer available but not Docker, you can still use the docker image:\n\n```shell\nexport APPTAINER_CACHEDIR=\"/tmp/$(whoami)/apptainer\"\napptainer shell -B /afs -B /eos docker://ghcr.io/hepdata/hepdata_lib:latest bash\n```\n\nUnpacking the image can take a few minutes the first time you use it. Please be patient. Both EOS and AFS should be available and the output will be in your current working directory.\n\n## Further examples\n\nThere are a few more examples available that can directly be run using the [binder](https://mybinder.org/) links below or using [SWAN](https://swan.cern.ch/) (CERN-only, please use LCG release LCG_94 or later) and selecting the corresponding notebook manually:\n\n- [Reading in text files](https://github.com/HEPData/hepdata_lib/blob/main/examples/Getting_started.ipynb)\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/Getting_started.ipynb)\n<br/><br/>\n- [Reading in a CMS combine ntuple](https://github.com/HEPData/hepdata_lib/blob/main/examples/combine_limits.ipynb)\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/combine_limits.ipynb)\n<br/><br/>\n- [Reading in ROOT histograms](https://github.com/HEPData/hepdata_lib/blob/main/examples/reading_histograms.ipynb)\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/reading_histograms.ipynb)\n<br/><br/>\n- [Reading a correlation matrix](https://github.com/HEPData/hepdata_lib/blob/main/examples/correlation.ipynb)\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/correlation.ipynb)\n<br/><br/>\n- [Reading TGraph and TGraphError from '.C' files](https://github.com/HEPData/hepdata_lib/blob/main/examples/read_c_file.ipynb)\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/read_c_file.ipynb)\n<br/><br/>\n- [Preparing scikit-hep histograms](https://github.com/HEPData/hepdata_lib/blob/main/examples/reading_scikithep_histograms.ipynb)\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/reading_scikihep_histograms.ipynb)\n<br/><br/>\n\n## External dependencies\n\n- [ROOT](https://root.cern.ch)\n- [ImageMagick](https://www.imagemagick.org)\n\nMake sure that you have `ROOT` in your `$PYTHONPATH` and that the `convert` command is available by adding its location to your `$PATH` if needed.\n\nA ROOT installation is not strictly required if your input data is not in a ROOT format, for example, if\nyour input data is provided as text files or `scikit-hep/hist` histograms. Most of the `hepdata_lib`\nfunctionality can be used without a ROOT installation, other than the `RootFileReader` and `CFileReader` classes,\nand other functions of the `hepdata_lib.root_utils` module.\n",
"bugtrack_url": null,
"license": null,
"summary": "Library for getting your data into HEPData",
"version": "0.15.0",
"project_urls": {
"Bug Reports": "https://github.com/HEPData/hepdata_lib/issues",
"Documentation": "https://hepdata-lib.readthedocs.io",
"Homepage": "https://github.com/HEPData/hepdata_lib",
"Source": "https://github.com/HEPData/hepdata_lib"
},
"split_keywords": [
"hepdata",
"physics",
"opendata"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d6cf8c201a90e37ec078942ddf2a389667610ecc517c87d4361a90f7bdef1831",
"md5": "80fb7ae76ccdae25fab477fe86cb8b21",
"sha256": "b26eecd27a24bcb53c7d163aa82c5e0c2994b37298f996e5d10a78eb7ead137d"
},
"downloads": -1,
"filename": "hepdata_lib-0.15.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "80fb7ae76ccdae25fab477fe86cb8b21",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 24555,
"upload_time": "2024-04-11T22:33:52",
"upload_time_iso_8601": "2024-04-11T22:33:52.710147Z",
"url": "https://files.pythonhosted.org/packages/d6/cf/8c201a90e37ec078942ddf2a389667610ecc517c87d4361a90f7bdef1831/hepdata_lib-0.15.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6c4b79135513b2bc8f490328dcb9ea22632f4520a4ec1fd22b603ca25bb28574",
"md5": "5f450c91f83f45c35a9b038387568969",
"sha256": "88325da7e9ee9408eafebb518117ff3c39f438048766f1a19f59ef22f6c6d1d4"
},
"downloads": -1,
"filename": "hepdata_lib-0.15.0.tar.gz",
"has_sig": false,
"md5_digest": "5f450c91f83f45c35a9b038387568969",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 41449,
"upload_time": "2024-04-11T22:33:54",
"upload_time_iso_8601": "2024-04-11T22:33:54.540527Z",
"url": "https://files.pythonhosted.org/packages/6c/4b/79135513b2bc8f490328dcb9ea22632f4520a4ec1fd22b603ca25bb28574/hepdata_lib-0.15.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-11 22:33:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "HEPData",
"github_project": "hepdata_lib",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": []
},
{
"name": "PyYAML",
"specs": [
[
">=",
"4.0"
]
]
},
{
"name": "future",
"specs": []
},
{
"name": "hist",
"specs": []
},
{
"name": "scipy",
"specs": []
},
{
"name": "hepdata-validator",
"specs": [
[
">=",
"0.3.5"
]
]
}
],
"lcname": "hepdata-lib"
}