Skip to main content

Easy to use functions for making changes to sql tables using SqlAlchemy.

Project description

FullmetalAlchemy Logo

FullmetalAlchemy: Easy to use functions for sql table changes

PyPI Latest Release Tests

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)

Uploaded Source

Built Distribution

fullmetalalchemy-1.2.0-py3-none-any.whl (30.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page