Skip to main content

GDX2py

Documentation Status

Read and write GAMS Data eXchange (GDX) files using Python.

Requirements

  • GAMS: version 47.0 or higher
  • Python: 3.8 or higher

Installing GAMS

Get GAMS from https://www.gams.com/download/ and install it to your system. No license is needed for the use of GDX libraries.

Installation

Install with

pip install gdx2py

Usage

>>> from gdx2py import GdxFile, GAMSSet, GAMSScalar, GAMSParameter
>>> with GdxFile('/path/to/gdx/file.gdx', mode='w') as gdx:
>>>     gdx['set1'] = ['a', 'b', 'c']  # Write a simple set
>>>     set1 = gdx['set1']  # Read a symbol
>>>     # Write a 2-dimensional set
>>>     gdx['set2'] = [('a', 'foo'), ('b', 'bar'), ('c', 'baz')]
>>>     # Write a scalar with explanatory text
>>>     gdx['scalar'] = GAMSScalar(3.14, expl_text="Value of pi")  
>>>     # Write a parameter with domain                                     
>>>     gdx['par1'] = GAMSParameter({'a': 1, 'b': 2,  
                                     'c': 3, 'd': 4 }, 
                                    domain=['set1'])  

Comparison to similar packages

Compared to other packages like PyGDX, gdx-pandas, gdxtools and gdxpy, GDX2py relies only on the Python standard library and the low-level GDX API gamsapi.core.gdx module which is part of the GAMS Python API (gamsapi) available on PyPI.


EU emblem This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 774629.

Metadata

Release files for GDX2py 2.2.0

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

Source distribution (sdist)

Source distribution for GDX2py 2.2.0
File Size Uploaded
gdx2py-2.2.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for GDX2py 2.2.0
File Interpreter ABI Platform
GDX2py-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / gdx2py-2.2.0.tar.gz

Download URL gdx2py-2.2.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2397df573878d24cacfd4eb835b532bed4d7a6d70bbd35c5d9121660a379d0ab
BLAKE2b-256 checksum
How to use checksums
bf84b520b039b018adbab22b32d2f9ff11b0f9bceaa8c99357f886e6301597af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / GDX2py-2.2.0-py3-none-any.whl

Download URL GDX2py-2.2.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a36b5090312c9c242adbbb5edb0c82db88a6017ea06e8513e2f83c8e17bce8a3
BLAKE2b-256 checksum
How to use checksums
b0c74f4633141ad31701e097ea351b7041df31c81ed682251a69ba7294c9bafa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.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