Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Pandasql is a great project but it lacked the ability to call Python UDF's or use SQL to update a DataFrame. Bettersql allows both of these features plus there is no need to define a lambda to pass globals() because I wrote the function to automatically get globals() from the caller level.
To install bettersql, simply:
$ pip install bettersql
A simple example:
from pandas import DataFrame
from bettersql import sqldf
def reverse(x):
# sample function with one parameter
if x is not None:
return x[::-1]
# DataFrame source
names = DataFrame({'id':[1, 2, 3], 'name':['Alpha', 'Beta', 'Gamma'], 'category':[1, 2, 2]})
# Dict of lists source
categories = {'id':[1, 2, 3], 'name':['One', 'Two', 'Three']}
sql = '''
SELECT n.id, n.name, n.category, c.name as categoryname, reverse(n.name) as reverse
FROM names AS n
LEFT JOIN categories AS c on n.category= c.id
'''
# The first reverse is the alias for the function in SQL and the second reverse is a reference to the Python UDF
r = sqldf(sql, reverse = reverse)
print(r)
FAQs
A package to use SQL with Pandas DataFrames, list and dict.
We found that bettersql 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.