Skip to main content

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.

Metadata

Release files for ticdat 0.2.30

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

Source distribution (sdist)

Source distribution for ticdat 0.2.30
File Size Uploaded
ticdat-0.2.30.tar.gz 200.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ticdat 0.2.30
File Interpreter ABI Platform
ticdat-0.2.30-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 422.0 kB

Release files / ticdat-0.2.30.tar.gz

Download URL ticdat-0.2.30.tar.gz
Size 200.7 kB
Tags Source
SHA-256 checksum
How to use checksums
93186576b053387900e93708969349e2147c66288889c8e9e1e256345bd0f7f6
BLAKE2b-256 checksum
How to use checksums
909137b36a1acc8bab5c4955308bd5ecf3600543934c586e82b82eaa6bd94bc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.2

Release files / ticdat-0.2.30-py2.py3-none-any.whl

Download URL ticdat-0.2.30-py2.py3-none-any.whl
Size 221.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
02985c4ec3a053498202ef7a0992cfbe3d25abd60ce39274e412e4751753996c
BLAKE2b-256 checksum
How to use checksums
bf84c72e054cde876eda27aafba5f9beac06bdabb562cdfd839e0c425748d92b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.2.30 This release

2 release files

0.2.29

2 release files

0.2.28

2 release files

0.2.26

2 release files

0.2.24

1 release file

0.2.22

2 release files

0.2.21

1 release file

0.2.20

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.16

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.8

2 release files

0.2.7

1 release file

0.2.6

1 release file

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

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