Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A package to interact and download behavior data from ASHRAE Global Occupant Behavior Database. Currently available on PyPI and conda-forge. More features coming in the furture.
poetry install
pip install --upgrade obplatform
conda install -c conda-forge obplatform
For Python 3.10: If you see an error like the following when resolving dependencies, it's caused by a bug in conda with Python 3.10.
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- python=3.1
Three possible solutions:
Once you activate the environment through conda or micromamba:
mamba install -c conda-forge obplatform
import logging
import zipfile
import pandas as pd
from obplatform import Connector, logger
connector = Connector()
# List all behaviors available in the database
print(connector.list_behaviors())
# Print progress information
# Comment out the following line to hide progress information
logger.setLevel(logging.INFO)
# Download Appliance Usage + Occupant Presence behaviors from study 22, 11, and 2.
connector.download_export(
"data.zip",
["Appliance_Usage", "Occupancy_Measurement"],
["22", "11", "2"],
show_progress_bar=True, # False to disable progrees bar
)
behavior_type = "Appliance_Usage"
study_id = "22"
zf = zipfile.ZipFile("data.zip")
df = pd.read_csv(zf.open(f"{behavior_type}_Study{study_id}.csv"))
print(df.head())
# List all behaviors available in study 1, 2, 3, and 4
json_study_behaviors = connector.list_behaviors_in_studies(studies=["1", "2", "3", "4"])
print(json_study_behaviors)
# List all studies available in the database, filtered by behavior types,
# countries, cities, {building type, room_type} combinations.
json_studies = connector.list_studies(
behaviors=["Occupancy_Measurement", "Appliance_Usage"],
countries=["USA", "UK"],
cities=["Palo Alto", "Coventry", "San Antonio"],
buildings=[
{
"building_type": "Educational",
"room_type": "Classroom",
},
{
"building_type": "Educational",
"room_type": "Office",
},
{
"building_type": "Residential",
"room_type": "Single-Family House",
},
],
)
print(json_studies)
Please only use the following names as input. e.g. Please use Lighting_Status
(listed below) instead of Lighting Adjustment
(displayed on the website).
'Appliance_Usage', 'Fan_Status', 'Door_Status', 'HVAC_Measurement', 'Lighting_Status', 'Occupant_Number', 'Occupancy_Measurement', 'Other_HeatWave', 'Other_Role of habits in consumption', 'Other_IAQ in Affordable Housing', 'Shading_Status', 'Window_Status'
In the next version, the package will auto detect either type of input and convert to the correct query parameter.
Study 2 is a special case. It has very large source files (> 2 GB) so we compressed all data in study 2 as a single .tar.gz
file. In the example above, data.zip
contains a tar.gz
file along with several separate csv files from other studies. When writing libraries to read from csv file from the downloaded zip, Study 2 should be treated as a special case.
FAQs
APIs to access ASHRAE OB Database
We found that obplatform demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.