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.
Provides helper functions to help converting behave tables into pandas dataframes and vice versa.
Utility package for the Behave BDD testing framework, to make converting gherkin tables to and from pandas data frames a breeze.
pip install behave-pandas
The behave-pandas api is extremely simple, and consists in two functions:
from behave_pandas import table_to_dataframe, dataframe_to_table
Feature: Table printer
as a tester
I want to be able to create gherkin tables from existing data frames
Scenario: simple index
Given a gherkin table as input
| str | float | str |
| index_col | float_col | str_col |
| egg | 3.0 | silly walks |
| spam | 4.1 | spanish inquisition |
| bacon | 5.2 | dead parrot |
When converted to a data frame using 1 row as column names and 1 column as index
And printed using data_frame_to_table
Then it prints a valid string copy pasteable into gherkin files
"""
| object | float64 | object |
| index_col | float_col | str_col |
| egg | 3.0 | silly walks |
| spam | 4.1 | spanish inquisition |
| bacon | 5.2 | dead parrot |
"""
Associated steps:
from behave import *
from behave_pandas import table_to_dataframe, dataframe_to_table
use_step_matcher("parse")
@given("a gherkin table as input")
def step_impl(context,):
context.input = context.table
@when('converted to a data frame using {column_levels:d} row as column names and {index_levels:d} column as index')
def step_impl(context, column_levels, index_levels):
context.parsed = table_to_dataframe(context.input, column_levels=column_levels, index_levels=index_levels)
@then("it prints a valid string copy pasteable into gherkin files")
def step_impl(context):
assert context.result == context.text
@step("printed using data_frame_to_table")
def step_impl(context):
context.result = dataframe_to_table(context.parsed)
Parsed dataframe:
>>> context.parsed
float_col str_col
index_col
egg 3.0 silly walks
spam 4.1 spanish inquisition
bacon 5.2 dead parrot
>>> context.parsed.info()
<class 'pandas.core.frame.DataFrame'>
Index: 3 entries, egg to bacon
Data columns (total 2 columns):
float_col 3 non-null float64
str_col 3 non-null object
dtypes: float64(1), object(1)
memory usage: 72.0+ bytes
FAQs
Provides helper functions to help converting behave tables into pandas dataframes and vice versa.
We found that behave-pandas 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.