Mortar Data (Serverless)
Install with pip install mortardata
Set the following environment variables:
export MORTARDATA_S3_REGION=""
export MORTARDATA_S3_BUCKET=""
export MORTARDATA_QUERY_ENDPOINT=""
Then use as follows:
from mortardata import Client
# connect client
c = Client()
vav_points = """
PREFIX brick: <https://brickschema.org/schema/Brick#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ref: <https://brickschema.org/schema/Brick/ref#>
SELECT ?equip ?point ?id WHERE {
?equip rdf:type/rdfs:subClassOf* brick:VAV ;
brick:hasPoint ?point .
?point ref:hasExternalReference/ref:hasTimeseriesId ?id .
}"""
# get metadata for first 20 sites
df = c.sparql(vav_points, sites=c.sites[:20])
# most operations return dataframes
df.to_csv("vav_points.csv")
# get timeseries data into a dataframe for 2 sites, maximum of 1 million points for January 2016
df = c.data_sparql(vav_points, start="2016-01-01", end="2016-02-01", limit=1e6, sites=['urn:bldg2#','urn:bldg5#'])
print(df.head())
# similar to the above, but streams data directly into a CSV file. Can be helpful for extra large downloads
num = c.data_sparql_to_csv(vav_points, "vav_data.csv", limit=1e6, sites=['urn:bldg2#','urn:bldg5#'])
print(f"Downloaded {num} datapoints")
Release files for mortardata 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mortardata-0.1.8.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mortardata-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / mortardata-0.1.8.tar.gz
| Download URL | mortardata-0.1.8.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d2973725ed29a4d66190a7c83a1e23e7c35f5eaa656c0eab74512e789a3341b
|
|
BLAKE2b-256 checksum How to use checksums |
902c397100e8a368d10297eb2055de360b133eda68c46009cd370cfa5f39317a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
|
Release files / mortardata-0.1.8-py3-none-any.whl
| Download URL | mortardata-0.1.8-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5a76f64f1b3b435f48c6b527b187d121039d08eb680c87ae4e675e02dece773
|
|
BLAKE2b-256 checksum How to use checksums |
e25cdb39af3c7568b35e509407499942d05d0d7d0ba4a2f43672be9315ac16e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
|