Skip to main content

Core implementation of EOQ3 for python

Project description

eoq3 - EOQ3 core implementation for python

This implements EOQ3 domains, values, queries and commands in python. It is the central module of the EOQ3 implementation for python. It contains a ready-to-use domainwithmdb for programatic model interactions.

Getting started example

This example implements the "Why EOQ?" example and some additional prints of model information.

from eoq3.domainwithmdb import DomainWithMdb
from eoq3.command import Crt, Get,Set #commands
from eoq3.query import Cls,Pth #queries
from eoq3.concepts import * #import constants as CONCEPTS, ....
from eoq3.examples.warehouse import CreateWarehouseM1Model, CreateWarehouseM2Model #creation of example models
# currently PyecoreMdb is the only local domain. eoq3pyecoremdb must be installed.
from eoq3pyecoremdb import PyEcoreMdb #requres pyecoremdb to be installed

# Initialize a local domain
mdb = PyEcoreMdb()
domain = DomainWithMdb(mdb)
# Init warehouse meta and user model
CreateWarehouseM2Model(domain) #open function to see model creation commands
CreateWarehouseM1Model(domain) #open function to see model creation commands
# Would you like to get a list of articles?
articles = domain.Do( Get( Cls('Article') ) )
print("Articles: %s"%(articles))
# Would you like to know which one is sold less than 3-times?
badArticles = domain.Do( Get( Cls('Article').Sel(Pth('sells').Les(3)) ) )
print("Bad articles: %s"%(badArticles))
# You might want to reduce their price by 10%?
nameAndPrice = domain.Do( Get( Cls('Article').Zip([Pth('name'),Pth('price')])))
print("Article prices: %s"%(nameAndPrice))
domain.Do( Set( 
	Cls('Article').Sel(Pth('sells').Les(3)),
	'price',
	Cls('Article').Sel(Pth('sells').Les(3)).Pth('price').Mul(0.9) 
) )
nameAndPrice = domain.Do( Get( Cls('Article').Zip([Pth('name'),Pth('price')])))
print("Article prices: %s"%(nameAndPrice))
# Would you like to see a list of the names of the categories of the badly selling articles sorted by ascendingly?
badCategories = domain.Do( Get( Cls('Article').Sel(Pth('sells').Les(3)).Met('PARENT').Pth('name').Uni([]).Idx('SORTASC') ) )
print(badCategories)

This example is available as https://gitlab.com/eoq/py/pyeoq/Examples/Eoq3/WhyWarehouse.py

Documentation

For more information see EOQ3 documentation: https://eoq.gitlab.io/doc/eoq3/

pyeoq repository

Pyeoq module's source can be found here: https://gitlab.com/eoq/py/pyeoq

Author

2024 Bjoern Annighoefer

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

eoq3-2.9.3.tar.gz (116.2 kB view details)

Uploaded Source

Built Distribution

eoq3-2.9.3-py3-none-any.whl (142.7 kB view details)

Uploaded Python 3

File details

Details for the file eoq3-2.9.3.tar.gz.

File metadata

  • Download URL: eoq3-2.9.3.tar.gz
  • Upload date:
  • Size: 116.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for eoq3-2.9.3.tar.gz
Algorithm Hash digest
SHA256 c1771ef9b032eddd1500e43457afd3a887ba294bbac70b74bed44b0d4bb1637b
MD5 e0bedd6c628f9daa73d7ce225b427ab0
BLAKE2b-256 26e569bc928bc83ce43f9f00eca80c983405d1b46af8d3b907581eeaafe819fd

See more details on using hashes here.

File details

Details for the file eoq3-2.9.3-py3-none-any.whl.

File metadata

  • Download URL: eoq3-2.9.3-py3-none-any.whl
  • Upload date:
  • Size: 142.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for eoq3-2.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c0b5a4be040a4c43036875c16095b48089aef462794587c1a5da1a0d3a4ee602
MD5 31aba2c19b05df7ebbca247463c4d405
BLAKE2b-256 50c7d2748815f494c79f924c2eb1c78e77cfb2e7ade59381e99ae86fc33f6c3e

See more details on using hashes here.

Supported by

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