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.
This library is used to read or write data in Postgres, MongoDB (Only read) or Google Sheets
Justogres is a connector to comunicate pandas.DataFrame objects with postgres database
for more details review documentation
install:
pip install justogres
upgrade:
pip install justogres --upgrade
from justogres import clientPsql
psql = clientPsql(
host = "<your host>",
user = "<your user>",
password = "<your password>",
db_name = "<your database name>",
)
import pandas as pd
example_df = pd.DataFrame(data=example_data)
psql.insert(
example_df,
table_name=<your table name>, #if doesn't exist table, will be created
schema=<your schema name>, #should be created previously
#optional
chunksize=<your chunksize to load (default: 1000)>,
column_types={<name_column_df>:<data_type postgres>})# if not declare column types, will be assigned automatically
we have 2 ways to read DB, both return pandas.DataFrame object but its main difference is the type of data that is assigned to the columns of the dataframe
query_example_to_read="""SELECT *
FROM schema_name.table_name;"""
df = psql.exec_query(
query_example_to_read,
#optional
chunksize=<your chunksize to load (default: 1000)>
)
query_example_to_read="""SELECT *
FROM schema_name.table_name;"""
df = psql.read_with_pandas(
query_example_to_read,
#optional
**kwargs=<all attributes we can use with pandas.read_sql()>
)
for more info of pandas.read_sql()
this method doesn't return anything
query_example="""DELETE
FROM schema_name.table_name
WHERE column_name='value';"""
psql.exec_query(
query_example,
#optional
chunksize=<your chunksize to load (default: 1000)>
)
from justogres import SpreadSheets
spread_sheet_client = SpreadSheets("credentials.json")
spreadsheet_id = '1SVZDYBw17S1XeRNBW08YA7i29mOfFlGmmF6EWKH84bk'
worksheet_name = 'Result'
spread_sheet_client.append_dataframe(data_frame ,spreadsheet_id, worksheet_name)
from justogres import SpreadSheets
spread_sheet_client = SpreadSheets("credentials.json")
spreadsheet_id = '1SVZDYBw17S1XeRNBW08YA7i29mOfFlGmmF6EWKH84bk'
worksheet_name = 'Result'
spread_sheet_client.worksheet_to_dataframe(spreadsheet_id, worksheet_name)
FAQs
This library is used to read or write data in Postgres, MongoDB (Only read) or Google Sheets
We found that justogres demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.