# HESTIA Utils
## Install
1. Install the module:
```bash
pip install hestia_earth.utils
```
2. Add this to your environment variables:
```
API_URL=https://api.hestia.earth
WEB_URL=https://www.hestia.earth
```
## Usage
1. To download a file from the HESTIA API:
```python
from hestia_earth.schema import SchemaType
from hestia_earth.utils.api import download_hestia
cycle = download_hestia('cycleId', SchemaType.CYCLE)
sandContent = download_hestia('sandContent', SchemaType.TERM)
```
2. To search for a specific Node on HESTIA:
```python
from hestia_earth.schema import SchemaType
from hestia_earth.utils.api import find_node_exact
source = find_node_exact(SchemaType.SOURCE, {'bibliography.title': 'My Bibliography'})
```
3. To get a lookup table from local file system:
```python
from hestia_earth.schema import SchemaType
from hestia_earth.utils.lookup import load_lookup
df = load_lookup('path/to/my/lookup.csv')
```
4. To get a lookup table from HESTIA:
```python
from hestia_earth.schema import SchemaType
from hestia_earth.utils.lookup import download_lookup
df = download_lookup('crop.csv')
```
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/hestia-earth/hestia-utils",
"name": "hestia-earth-utils",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "HESTIA Team",
"author_email": "guillaumeroyer.mail@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8f/14/87fbc5decb1096478bf0bc53b7c7902473b7b31eccb16374786f53d9540b/hestia_earth_utils-0.13.15.tar.gz",
"platform": null,
"description": "# HESTIA Utils\n\n## Install\n\n1. Install the module:\n```bash\npip install hestia_earth.utils\n```\n2. Add this to your environment variables:\n```\nAPI_URL=https://api.hestia.earth\nWEB_URL=https://www.hestia.earth\n```\n\n## Usage\n\n1. To download a file from the HESTIA API:\n```python\nfrom hestia_earth.schema import SchemaType\nfrom hestia_earth.utils.api import download_hestia\n\ncycle = download_hestia('cycleId', SchemaType.CYCLE)\nsandContent = download_hestia('sandContent', SchemaType.TERM)\n```\n\n2. To search for a specific Node on HESTIA:\n```python\nfrom hestia_earth.schema import SchemaType\nfrom hestia_earth.utils.api import find_node_exact\n\nsource = find_node_exact(SchemaType.SOURCE, {'bibliography.title': 'My Bibliography'})\n```\n\n3. To get a lookup table from local file system:\n```python\nfrom hestia_earth.schema import SchemaType\nfrom hestia_earth.utils.lookup import load_lookup\n\ndf = load_lookup('path/to/my/lookup.csv')\n```\n\n4. To get a lookup table from HESTIA:\n```python\nfrom hestia_earth.schema import SchemaType\nfrom hestia_earth.utils.lookup import download_lookup\n\ndf = download_lookup('crop.csv')\n```\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "HESTIA's utils library",
"version": "0.13.15",
"project_urls": {
"Homepage": "https://gitlab.com/hestia-earth/hestia-utils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "82407e0ffbf38d1fc7385dce29eecf02e0844ea7565303c8eba4863af3718ae3",
"md5": "f294d7ba9357b049c4f1fdf313bd1335",
"sha256": "c4438d36f7dfa68cf7eb6d8af24dd1429b3b215f324aba6470f0a1d26791cb05"
},
"downloads": -1,
"filename": "hestia_earth_utils-0.13.15-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f294d7ba9357b049c4f1fdf313bd1335",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 33393,
"upload_time": "2025-01-08T09:27:50",
"upload_time_iso_8601": "2025-01-08T09:27:50.858773Z",
"url": "https://files.pythonhosted.org/packages/82/40/7e0ffbf38d1fc7385dce29eecf02e0844ea7565303c8eba4863af3718ae3/hestia_earth_utils-0.13.15-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8f1487fbc5decb1096478bf0bc53b7c7902473b7b31eccb16374786f53d9540b",
"md5": "fd929a97e3d3825be9dce30a22ca4443",
"sha256": "1b3e82a7b9bdfb722b3907c4eaa5b65f24f9d93d9e18e429d9365f87d4b05ee6"
},
"downloads": -1,
"filename": "hestia_earth_utils-0.13.15.tar.gz",
"has_sig": false,
"md5_digest": "fd929a97e3d3825be9dce30a22ca4443",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 26028,
"upload_time": "2025-01-08T09:27:52",
"upload_time_iso_8601": "2025-01-08T09:27:52.148045Z",
"url": "https://files.pythonhosted.org/packages/8f/14/87fbc5decb1096478bf0bc53b7c7902473b7b31eccb16374786f53d9540b/hestia_earth_utils-0.13.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-08 09:27:52",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "hestia-earth",
"gitlab_project": "hestia-utils",
"lcname": "hestia-earth-utils"
}