fasvaorm is a ORM to access the database used within FASva.
Project description
FASva MySQL-ORM
This project contains a Object-relational mapping (ORM) that is used to access the MySQL/MariaDB used within the research project FASva using SQLAlchemy.
Installation
You can find the latest version on PyPi.
$ pip install fasvaorm
Usage
Utilizing fasvaorm for accessing the database is quite straightforward. Each available table is represented as a class in the fasvaorm.models module. Here is an example on how to initialize and query the database.
from fasvaorm import init_engine, get_session
from fasvaorm.models import Drive
# initialize the engine. Will also try to create the database if it does not exist.
engine = init_engine("mysql+pymysql://{user}@{host}:{port}/{database}".format(**dict(user='root', host='localhost',
port=3306,
database='database')))
# now get a session
session = get_session()
# and use that session to query all available drives
for d in session.query(Drive).all():
print(d.name)
# use can also access all records of that drive
for r in d.records:
print(r.filepath)
# or the vehicle
print(d.vehicle.serial_number)
# or also all scenes of that drive
for a in d.aggregations:
print(a.timestamp)
For further examples on how to use fasvaorm see the tests package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
fasvaorm-0.8.3-py3-none-any.whl
(36.3 kB
view details)
File details
Details for the file fasvaorm-0.8.3-py3-none-any.whl
.
File metadata
- Download URL: fasvaorm-0.8.3-py3-none-any.whl
- Upload date:
- Size: 36.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.1 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.5.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36e108387cd2647b5621698b6baf4c8a66d6e92b5f8186febb38940bee859402 |
|
MD5 | b3a36e6426d3b3d3d51f56801cb6b0ea |
|
BLAKE2b-256 | 733b0e8cad5597a47218b845097e29e732c6bf5a429b91e64fbe6d9e81717eab |