# 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/bc/d4/92283d8d6d19e0c69df787f99f98bc8ade902e6051f3a2c4c1e3e8a34223/hestia-earth-utils-0.13.12.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.12",
"project_urls": {
"Homepage": "https://gitlab.com/hestia-earth/hestia-utils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "df47d9709fa72f46cfa625803d82b7ce3cd7a6e746768a473e705c8cb3269e9e",
"md5": "332d9ffcc54ee0d6456e2653084d9abe",
"sha256": "e72efd7f9792a52fa1eb33a2925fb1a6f2efc83a686bb28467193e4cfe499925"
},
"downloads": -1,
"filename": "hestia_earth_utils-0.13.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "332d9ffcc54ee0d6456e2653084d9abe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 33300,
"upload_time": "2024-12-20T14:18:14",
"upload_time_iso_8601": "2024-12-20T14:18:14.531208Z",
"url": "https://files.pythonhosted.org/packages/df/47/d9709fa72f46cfa625803d82b7ce3cd7a6e746768a473e705c8cb3269e9e/hestia_earth_utils-0.13.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bcd492283d8d6d19e0c69df787f99f98bc8ade902e6051f3a2c4c1e3e8a34223",
"md5": "f01bf7cc43692667012ee9bbc90d3c48",
"sha256": "0427c1378da384487a8bf8197512a21a8c34f64e032822e58357daf7555ff6bf"
},
"downloads": -1,
"filename": "hestia-earth-utils-0.13.12.tar.gz",
"has_sig": false,
"md5_digest": "f01bf7cc43692667012ee9bbc90d3c48",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 25952,
"upload_time": "2024-12-20T14:18:15",
"upload_time_iso_8601": "2024-12-20T14:18:15.674438Z",
"url": "https://files.pythonhosted.org/packages/bc/d4/92283d8d6d19e0c69df787f99f98bc8ade902e6051f3a2c4c1e3e8a34223/hestia-earth-utils-0.13.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-20 14:18:15",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "hestia-earth",
"gitlab_project": "hestia-utils",
"lcname": "hestia-earth-utils"
}