Skip to main content

A Python 3 client for odbAccess using pylife-odbserver

Project description

pylife-odbclient

A Modern Python client for odbAccess using pylife-odbserver

Purpose

Unfortunately Abaqus usually comes with an outdated python engine. So you can't access an Abaqus odb file from within modern python code using the latest packages. This python package is the client part of a client server setup to make odb files accessible from within python code using a current python version in a transparent way.

Solution

The sibling package pylife-odbserver provides a slim server that as python software that is running with old python versions of Abaqus (even 2.7), that can be run inside the Abaqus python engine. It accepts command via sys.stdin and according to the command is querying data from the odbAccess interface and returning them in a pickle object.

This package comes with a python class OdbClient that spawns the server in the background when an instance of OdbClient is instantiated. Then the client object can be used to transparently access data from the odb file via the server. Once the client object goes out of scope i.e. is deleted, the server process is stopped automatically.

Installation

  • Install the odbclient using pip with the command
pip install pylife-odbclient

Usage

Usually you only will see the OdbClient class interface when you access an odb file. The only point you care about the server is when you instantiate an OdbClient object. You need to know the following things

  • The path to the Abaqus executable

  • The path to the python environment pylife-server is installed into.

Then you can instantiate a OdbClient object using

import odbclient as CL

client = CL.OdbClient("yourodb.odb")

See the API docs of OdbClient for details.

Limitations

Limited functionality

Only a subset of Abaqus variable locations are supported. These are: nodal, element nodal, whole element and centroid. Integration point variables are extrapolated to element nodal.

You can only extract data from an odb file, not write to it.

String literals

So far only names made of ascii strings are supported. That means that instance names, node that names and the like containing non-ascii characters like German umlauts will not work.

Development

Due to the server client architechture running the unit tests is not completely trivial. Here are some instructions on how to get them running.

Setting up the environments

As of now, we are assuming that conda is used to setup the server environments. Probably we will change for uv in the future.

We provide a bash script in tests/create_server_envs.sh that you can run from within the root folder of odbclient (the folder this README.md resides in). Then it should generate all the necessary environments. You will have to run the script again, if there has been a release update in between.

The script is not well tested. So please be prepared for some manual steps.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylife_odbclient-2.2.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylife_odbclient-2.2.0-py2.py3-none-any.whl (14.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pylife_odbclient-2.2.0.tar.gz.

File metadata

  • Download URL: pylife_odbclient-2.2.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylife_odbclient-2.2.0.tar.gz
Algorithm Hash digest
SHA256 19ee8088dc7a463842f4ccefd8a8ec6891e8a18c864c7e33d319986ed18aa615
MD5 cba7a3dd9ce4174f7c19988b5f9445e7
BLAKE2b-256 1684daae1a67e445dd781a4440ed85fa9b6c60a7775a9793c11c6d5bd33223b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylife_odbclient-2.2.0.tar.gz:

Publisher: pypi-deploy-odbclient.yml on boschresearch/pylife

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pylife_odbclient-2.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pylife_odbclient-2.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 aa84c3503228559b386334b00157ae365d7cf50dd683d3641a191b7e71e17e2f
MD5 bfa37dd9400ef9df2a175f0e8b33c4ca
BLAKE2b-256 ee8f997fa67e02f9500459c8c580183f6774f178caf76292e3f1baa9de87bafc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylife_odbclient-2.2.0-py2.py3-none-any.whl:

Publisher: pypi-deploy-odbclient.yml on boschresearch/pylife

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page