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.1.0.tar.gz
(27.2 kB
view hashes)
Built Distribution
Close
Hashes for fullmetalalchemy-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4aff3da2b1a25c29c0b1441ff21d5b80f7a52ac4d01618e2ee5c76a8f9a23440 |
|
MD5 | 6c97672f9ba8bc145bf6ec104d7ddbe1 |
|
BLAKE2b-256 | 737def0fb382d8c0390dc30b685ef487f8a01db0e628bd7444738e4df1c71f33 |