Easy to use functions for making changes to sql tables using SqlAlchemy.
Project description
FullmetalAlchemy: Easy to use functions for sql table changes
What is it?
FullmetalAlchemy is a Python package with easy to use functions for inserting, deleting, updating, selecting records in SQL tables.
Where to get it
The source code is currently hosted on GitHub at: https://github.com/eddiethedean/fullmetalalchemy
# PyPI
pip install fullmetalalchemy
Dependencies
Example
import fullmetalalchemy as fa
# Create SqlAlchemy engine to connect to database.
engine = fa.create_engine('sqlite:///foo.db')
# Get a SqlAlchemy table to pass to FullmetalAlchemy functions
table = fa.features.get_table('xy', engine)
# Select records
fa.select.select_records_all(table)
[{'id': 1, 'x': 1, 'y': 2}, {'id': 1, 'x': 2, 'y': 3}]
# Insert records
fa.insert.insert_records(table, [{'id': 3, 'x': 3, 'y': 4}, {'id': 4, 'x': 5, 'y': 6}])
# Delete records
fa.delete.delete_records(table, 'id', [1, 3])
# Update records
fa.update.update_records(table, [{'id': 1, 'x': 11, 'y': 22}, {'id': 1, 'x': 23, 'y': 34}], 'id')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fullmetalalchemy-1.2.0.tar.gz
(27.3 kB
view hashes)
Built Distribution
Close
Hashes for fullmetalalchemy-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632a217499943891e808c37cb895c67d40fe5cc3573f87de52d3ea92608c4280 |
|
MD5 | cb5d956539454438706c19339d8ba41a |
|
BLAKE2b-256 | 72a21be9d59aa931fab0a64857c8402b214aeea28ed733bf5cffc7ad6d15ed66 |