Measure Space Weather, Climate, Air Quality and Geocoding Tool
pip install llama-index-tools-measurespace
This tool connects to the MeasureSpace's API, using the measure-space-api Python package. You must initialize the tool with corresponding API keys from MeasureSpace and OpenAI (if you use OpenAI).
The tool has access to the following functions:
- hourly weather forecast (next 5 days)
- daily weather forecast (next 15 days)
- daily climate forecast (next 10 months)
- daily air quality forecast (next 5 days)
- get latitude and longitude from given city names
- get nearest city for given latitude and longitude
Usage
Assume you have an .env file with the following content:
GEOCODING_API_KEY=<your-geocoding-api-key>
HOURLY_WEATHER_API_KEY=<your-hourly-weather-api-key>
DAILY_WEATHER_API_KEY=R<your-daily-weather-api-key>
DAILY_CLIMATE_API_KEY=<your-daily-climate-api-key>
AIR_QUALITY_API_KEY=<your-air-quality-api-key>
OPENAI_API_KEY=<your-openai-api-key>
Note that you only need the API keys if you need the services.
from llama_index.tools.measurespace import MeasureSpaceToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from dotenv import load_dotenv
import os
load_dotenv()
api_keys = {
"hourly_weather": os.getenv("HOURLY_WEATHER_API_KEY"),
"daily_weather": os.getenv("DAILY_WEATHER_API_KEY"),
"daily_climate": os.getenv("DAILY_CLIMATE_API_KEY"),
"air_quality": os.getenv("AIR_QUALITY_API_KEY"),
"geocoding": os.getenv("GEOCODING_API_KEY"),
}
tool_spec = MeasureSpaceToolSpec(api_keys)
agent = FunctionAgent(
tools=tool_spec.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run("How's the temperature for New York in next 3 days?"))
print(await agent.run("What's the latitude and longitude of New York?"))
# get a list of tools
for tool in tool_spec.to_tool_list():
print(tool.metadata.name)
# Use a specific tool
tool_spec.get_daily_weather_forecast("New York")
tool_spec.get_latitude_longitude_from_location("New York")
Metadata
Release files for llama-index-tools-measurespace 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_tools_measurespace-0.3.0.tar.gz | 5.1 kB | Without provenance | Details for llama_index_tools_measurespace-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_tools_measurespace-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_tools_measurespace-0.3.0-py3-none-any.whl |
Total release size: 9.9 kB
Release files / llama_index_tools_measurespace-0.3.0.tar.gz
| Download URL | llama_index_tools_measurespace-0.3.0.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac1dd1103756287d3d943d13ef57cf52a1c402c5050766cfcc9752c1c78baf91
|
|
BLAKE2b-256 checksum How to use checksums |
056ed1cf7b141449482c6e49c812a2dbb42c0da988dcb298ee4868c3a2dc793c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_tools_measurespace-0.3.0-py3-none-any.whl
| Download URL | llama_index_tools_measurespace-0.3.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2b2bd20f74cb475327b1e085e825c1cb3aa6f348d7bfbb6ddb60fc37773944b
|
|
BLAKE2b-256 checksum How to use checksums |
f7d8293a0690c7cd56637ecc7d5c4efa63923bb2833aff86d1f84db9aa1e1c8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-tools-measurespace 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.