# 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": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "",
"author": "Hestia Team",
"author_email": "guillaumeroyer.mail@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a7/92/e72df5adf3f675367b00e16ad1a9c8fe7925c132f161dd923cedec691520/hestia-earth-utils-0.12.2.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.12.2",
"project_urls": {
"Homepage": "https://gitlab.com/hestia-earth/hestia-utils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cf8fe0785332e21d750d436209abae44b6e62eafe55e38aae38d9dea9c1614a9",
"md5": "a54045d61832b1be5db360ec9ad4b6af",
"sha256": "fd0a11628e3d5b1c4bc1c5155d1a9c4988e542d811cd5c5bdb86c29b7828e829"
},
"downloads": -1,
"filename": "hestia_earth_utils-0.12.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a54045d61832b1be5db360ec9ad4b6af",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 29549,
"upload_time": "2024-02-21T10:44:48",
"upload_time_iso_8601": "2024-02-21T10:44:48.898971Z",
"url": "https://files.pythonhosted.org/packages/cf/8f/e0785332e21d750d436209abae44b6e62eafe55e38aae38d9dea9c1614a9/hestia_earth_utils-0.12.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a792e72df5adf3f675367b00e16ad1a9c8fe7925c132f161dd923cedec691520",
"md5": "50ee45ab7d2d5e3908be4e9725239f3d",
"sha256": "482e7fe325962d9307854d322fd1dc62fb04168fa18316ec0ceb20ceead263c9"
},
"downloads": -1,
"filename": "hestia-earth-utils-0.12.2.tar.gz",
"has_sig": false,
"md5_digest": "50ee45ab7d2d5e3908be4e9725239f3d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 23017,
"upload_time": "2024-02-21T10:44:51",
"upload_time_iso_8601": "2024-02-21T10:44:51.053800Z",
"url": "https://files.pythonhosted.org/packages/a7/92/e72df5adf3f675367b00e16ad1a9c8fe7925c132f161dd923cedec691520/hestia-earth-utils-0.12.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-21 10:44:51",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "hestia-earth",
"gitlab_project": "hestia-utils",
"lcname": "hestia-earth-utils"
}