Library for connection of TransCAD data files to Python
Project description
model-connector: Library for accessing travel model data
Installation:
Install using pip
pip install model-connector
Example Usage
Reading from a TransCAD binary file
import model_connector as mc
# Read a TransCAD fixed format binary file into a dataframe,
# retaining null values
df = mc.read_ffb("myfile.bin")
# Read a TransCAD fixed format binary file into a dataframe,
# converting null values to zeros
dfz = mc.read_ffb("myfile.bin", null_to_zero=True)
Writing to a TransCAD binary file
import model_connector as mc
import pandas as pd
df = pd.DataFrame({"ID":[1,2,3],
"RealField":[1.1, 2.2, 3.3, ],
"IntField":[1, 2, 3],
"DateField":[20210101, 20210115, 20210130],
"DateTimeField":[pd.Timestamp("2021-01-01 00:00:05"),
pd.Timestamp("2021-01-15 00:10:05"),
pd.Timestamp("2021-01-30 00:20:05")]})
mc.write_ffb(df, "sample_output.bin")
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 Distribution
model_connector-0.0.3.tar.gz
(11.2 kB
view hashes)
Built Distribution
Close
Hashes for model_connector-0.0.3-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 1500c582e165583e6cfcea2bd34942ac65368b9cf3938642ab4ad2fd1dd0576b |
|
| MD5 | 6a68315a5ecb7e7afbbdb58a9d4ca187 |
|
| BLAKE2b-256 | 2e14c0d7b6a66f62ed179b5ea75e1444a37bcc549c8b556d6dbd1f702c388f75 |