Skip to main content

SQLAlchemy-DataFlex

A SQLAlchemy dialect for the FlexODBC driver

Objectives

This dialect is mainly intended to offer an easy way to access the DataFlex flat-file databases of older or EOL'd application-specific softwares. It is designed for use with the ODBC driver available from FlexQuarters

Pre-requisites

  • The FlexODBC driver from FlexQuarters. The library was written and tested against v3, but it should work with v4 as well. The library has been re-written from the ground up and tested to work against the latest available version of FlexODBC (4.0.27.2).

  • 32-bit Python. Neither of the available FlexODBC driver versions support or come in a 64-bit version.

Co-requisites

This dialect requires SQLAlchemy and pyodbc. They are both specified as requirements so pip will install them if they are not already in place. To install separately, just:

pip install -U SQLAlchemy pyodbc

Installation

PyPI-published version:

pip install -U sqlalchemy-dataflex

Absolute bleeding-edge (probably buggy):

pip install -U git+https://github.com/the-wondersmith/sqlalchemy-dataflex

Getting Started

Create an ODBC DSN (Data Source Name) that points to the directory containing your DataFlex FILELIST.cfg and .DAT table.

Tip: For best results, be sure to select the 4-digit date option and the . option for decimals

Then, in your Python app, you can connect to the database via:

from sqlalchemy_dataflex import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker


db = create_engine("dataflex+pyodbc://@your_dsn", echo=False)
super_session = sessionmaker(bind=db)
super_session.configure(autoflush=True, autocommit=True, expire_on_commit=True)
session = super_session()

NOTE: It is highly recommended that you use the datatype classes from the package itself in place of the ones that are usually imported from SQLAlchemy. The testing suite doesn't use the SQLAlchemy type classes, so any issues that might arise from their use with the dialect won't be caught by the tests.

The SQLAlchemy Project

SQLAlchemy-DataFlex is based on SQLAlchemy-access, which is part of the [SQLAlchemy Project] (https://www.sqlalchemy.org) and tries to adhere to the same standards and conventions as the core project.

At the time of this writing, it's unlikely that SQLAlchemy-DataFlex actually does comply with the aforementioned standards and conventions. That will be rectified (if and when) in a future release.

Development / Bug reporting / Pull requests

SQLAlchemy maintains a Community Guide detailing guidelines on coding and participating in that project.

While I'm aware that this project could desperately use the participation of anyone else who actually knows what they're doing, DataFlex and the FlexODBC driver are so esoteric and obscure (at the time of this writing) that I don't reasonably expect anyone to actually want to. If I am mistaken in that belief, please God submit a pull request.

This library technically works, but it isn't feature-complete so to speak. The FlexODBC driver only supports a very limited subset of SQL commands and queries, and doesn't always respond to pyodbc's get_info() inquiries the way that pyodbc is expecting. You can see the complete list of the way it responds to all of the available pyodbc get_info() inquiries here. If you are interested in which features are currently lacking or absent in the dialect, see the notes and comments littered throughout the testing suite here.

License

This library is derived almost in its entirety from the SQLAlchemy-Access library written by Gord Thompson. As such, and given that SQLAlchemy-access is distributed under the MIT license, this library is subject to the same licensure and grant of rights as its parent works SQLAlchemy and SQLAlchemy-Access.

Metadata

Release files for sqlalchemy-dataflex 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlalchemy-dataflex 0.1.5
File Size Uploaded Provenance Actions
sqlalchemy-dataflex-0.1.5.tar.gz 37.4 kB Without provenance Details for sqlalchemy-dataflex-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-dataflex 0.1.5
File Interpreter ABI Platform Actions
sqlalchemy_dataflex-0.1.5-py3-none-any.whl Python 3 none any Details for sqlalchemy_dataflex-0.1.5-py3-none-any.whl

Total release size: 73.7 kB

Release files / sqlalchemy-dataflex-0.1.5.tar.gz

Download URL sqlalchemy-dataflex-0.1.5.tar.gz
Size 37.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8735b78632264470a5b8848b15eb9c0c1fba37595abe25f459a52856209a0d44
BLAKE2b-256 checksum
How to use checksums
1a976e7a1a2e4a060def93d10a8c9ceff21e7307034709d49dff326a32302731
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Darwin/18.7.0

Release files / sqlalchemy_dataflex-0.1.5-py3-none-any.whl

Download URL sqlalchemy_dataflex-0.1.5-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9645111a63a7adbdc7bac42c7ba136b04d01758cf820739eead84937966d21d
BLAKE2b-256 checksum
How to use checksums
6ac084e89b8fedded5b2ce0fd0d443db4095397b7c50ac79b7990287fde932d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Darwin/18.7.0

Security for sqlalchemy-dataflex 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page