No project description provided
Project description
ticdat
Go here for project status and installation instructions. Go here for documentation.
ticdat
is a Python package that provides lightweight, ORM style functionality around either a dict-of-dicts or
pandas.DataFrame
representation of tables. It is well suited for defining and validating the input data for complex
solve engines (i.e. optimization and scheduling-type problems).
ticdat
functionality is organized around two classes - TicDatFactory
and PanDatFactory
. Both classes define a
simple database style schema on construction. Data integrity rules can then be added in the form of foreign key
relationships, data field types (to include numerical ranges and allowed strings) and row predicates
(functions that check if a given row violates a particular data condition). The factory classes can then be used to
construct TicDat
/PanDat
objects that contain tables consistent with the defined schema. By design,
ticdat
, allows these data objects to violate the data integrity rules while providing convenient bulk query functions
to determine where those violations occur.
TicDat
objects (created by a TicDatFactory
) contain tables in a dict-of-dict format. The outer dictionary maps
primary key values to data rows. The inner dictionaries are data rows indexed by field names (similar to
csv.DictReader/csv.DictWriter
). Tables that do not have primary keys are rendered as a list of data row dictionaries.
PanDat
objects (created by PanDatFactory
) render tables as pandas.DataFrame
objects. The columns in each
DataFrame
will contain all of the primary key and data fields that were defined in the PanDatFactory
schema. The
PanDatFactory
code can be thought of as implementing a shim library that organizes DataFrame
objects into a
predefined schema, and facilitates rich integrity checks based on schema defined rules.
The ticdat
example library is focused on two patterns for building optimization engines - using TicDatFactory
in
conjunction with gurobipy
and using PanDatFactory
in conjunction with amplpy
. That said, ticdat
can also be
used with libraries like pyomo
, pulp
, docplex
and xpress
. It also has functionality to support the OPL and
LINGO modeling languages, although the AMPL support is far more mature.
ticdat
is also useful for machine-learning applications. In this case, one typically uses PanDatFactory
to
provide ORM-like functionality on top of pandas
, as well as to simplify the munging of time stamp data and
text columns that contain exclusively numbers.
The ticdat
library is distributed under the BSD2 open source license.
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
Built Distribution
File details
Details for the file ticdat-0.2.25.tar.gz
.
File metadata
- Download URL: ticdat-0.2.25.tar.gz
- Upload date:
- Size: 197.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 483ac8a7be10fbbc37baa5d13c258ace660f5b088b12b079877b092abbd2c3df |
|
MD5 | 8970f79363dd30c19896829d083846cd |
|
BLAKE2b-256 | cb32284e682ae5d6a0227b723f338fd06db1f9951475d96da1773c5f8f1ee20e |
File details
Details for the file ticdat-0.2.25-py2.py3-none-any.whl
.
File metadata
- Download URL: ticdat-0.2.25-py2.py3-none-any.whl
- Upload date:
- Size: 218.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99c2ba6838868928e7414243965a86d52899caab332a4ccf932f3ecfdc4d5016 |
|
MD5 | ba01bdd73f1d2e169a82a02676e83dda |
|
BLAKE2b-256 | e897e58fcb8679843d0954ee307736d790cc0c1252b51db64e4b490fa9cb5533 |