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's association with AMPL is particularly strong. The design goals of ticdat were inspired by AMPL’s pattern of cleanly separating model from data, as well as its ability to thoroughly validate input data prior to solving. AMPL Optimization has endorsed ticdat as their preferred library for bridging the world’s leading modeling language (AMPL) with Python’s most powerful data analysis package (pandas).

The ticdat library is distributed under the BSD2 open source license.

Metadata

Release files for ticdat 0.2.18

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.18
File Size Uploaded Provenance Actions
ticdat-0.2.18.tar.gz 127.3 kB Without provenance Details for ticdat-0.2.18.tar.gz

Built distribution (wheel)

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

Total release size: 273.7 kB

Release files / ticdat-0.2.18.tar.gz

Download URL ticdat-0.2.18.tar.gz
Size 127.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d9cb3ce895b7c6ecc1b2c5b29d82a59e95325542518d9a468137cb7b8ed16f06
BLAKE2b-256 checksum
How to use checksums
236ea157a92617947ff5ec39d8d7de6cb7fcdcbbd6b05b27cdd2ffba0ec1a545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0

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

Download URL ticdat-0.2.18-py2.py3-none-any.whl
Size 146.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2420f6e3946ca20b6154174c07540b505489e2746f05e455439c5f375f61dc39
BLAKE2b-256 checksum
How to use checksums
07dadc28a72a99b2be20afea83c3f81f697828569e26897a223fd547327b3a34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0

Security for ticdat 0.2.18

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