Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Python async wrapper for IMGW-PIB API.
You can install the library with pip:
pip install imgw-pib
"""Example of usage IMGW-PIB."""
import asyncio
import logging
from aiohttp import ClientError, ClientSession
from imgw_pib import ApiError, ImgwPib
logging.basicConfig(level=logging.DEBUG)
WEATHER_STATION_ID = "12200"
HYDROLOGICAL_STATION_ID = "154190050"
async def main() -> None:
"""Run main function."""
async with ClientSession() as websession:
try:
imgwpib = await ImgwPib.create(
websession,
weather_station_id=WEATHER_STATION_ID,
hydrological_station_id=HYDROLOGICAL_STATION_ID,
)
weather_data = await imgwpib.get_weather_data()
hydrological_data = await imgwpib.get_hydrological_data()
except ApiError as error:
print(f"API Error: {error.status}")
except ClientError as error:
print(f"ClientError: {error}")
except TimeoutError as error:
print(f"TimeoutError: {error}")
else:
print(f"Weather stations: {imgwpib.weather_stations}")
print(f"Weather data: {weather_data}")
print(f"Hydrological stations: {imgwpib.hydrological_stations}")
print(f"Hydrological data: {hydrological_data}")
loop = asyncio.new_event_loop()
loop.run_until_complete(main())
loop.close()
The library raises ApiError
when the IMGW-PIB API returns an error, ClientError
for network-related errors, and TimeoutError
when a request times out.
Contributions are welcome! Please feel free to submit a Pull Request.
FAQs
Python wrapper for IMGW-PIB API.
We found that imgw-pib 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.