Skip to main content

Python Library that implements the BO4E Standard.

Project description

PyPi license code style PyPI pyversions

Python Library that Implements BO4E. Requires Python >=3.8.

Other Noteworthy BO4E Implementations

Contributing

Contributions are welcome. Feel free to open a Pull Request against the develop branch of this repository. Please provide unit tests if you contribute logic beyond bare bare business object definitions.

To enhance this BO4E implementation and contribute to this project check out the develop branch, install tox and set the virtual environment created by the command

tox -e dev

The created venv should be located somewhere around .tox/dev/Scripts.

Regular Expression for Enumerations

If you want to add a new enumeration from the BO4E website then you can use the following regular expression pattern:

^(?<wert>[A-Z\d_]+)\t(?<bedeutung>.+)$

In combination with this substitution:

"$wert": "$wert", # $bedeutung

This substitution can directly used on the website regex101.

Versioning

Short background information about versioning of python packages.
At the moment (2021-02-10) there are seven ways to define the version of your package.
We use setuptools-scm for versioning so we can use the tags of git to define the version.
The tool itself again has several ways how to configure it.
We use the pyproject.toml file to configure setuptools-scm.
There we tell the build-system with "setuptools_scm[toml]>=3.4" that we use setuptools_scm and the version must be at least 3.4.
The [toml] section tells setuptools-scm that it finds all settings in our pyproject.toml file.
[tool.setuptools_scm] in pyproject.toml enables version inference.
In the setup.py we have to use the attribute use_scm_version=True.

To create the version number itself, we stick to the default behavior of setuptools-scm. It will take a look at three things:

  1. latest tag (with a version number)

  2. the distance to this tag (e.g. number of revisions since latest tag)

  3. workdir state (e.g. uncommitted changes since latest tag)

and uses roughly the following logic to render the version:

no distance and clean:

{tag}

distance and clean:

{next_version}.dev{distance}+{scm letter}{revision hash}

no distance and not clean:

{tag}+dYYYYMMDD

distance and not clean:

{next_version}.dev{distance}+{scm letter}{revision hash}.dYYYYMMDD

The next version is calculated by adding 1 to the last numeric component of the tag.

To get the current version run in your working directory:

python setup.py --version

At the moment it is not possible to get the version number at runtime. To achieve this, we have to implement Retrieving package version at runtime.

If you follow the instruction in the release workflow, you will get the version number which you define with the label name.

Release workflow

  • Check with tox all tests and lintings: tox

  • Check with tox if the packaging works fine: tox -e test_packaging

  • Merge all your changes you would like to have in the release into the master branch (open new PR develop→master)

  • Check that all Github actions for tests and linting do pass (should be automatically enforced for PRs against master)

  • Go to BO4E-python and click on “Draft a new release” in the right sidebar

  • Write in the Tag version field and in the Release title your new version, i.e. v0.0.6

  • Add a describtion to the release

  • Publish the release

There is a github action which gets triggered by a release event. It will run all default tests with tox. If they pass, it will take the tag title to replace the version information in the setup.cfg file. After checking the package with twine check it will finally upload the new package release.

Hochfrequenz

Hochfrequenz Unternehmensberatung GmbH is a Grünwald (near Munich) based consulting company with offices in Berlin and Bremen. According to Kununu ratings Hochfrequenz is among the most attractive employers within the German energy market. Applications of talented developers are welcome at any time! Please consider visiting our career page that also contains job openings.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

bo4e-0.0.13.tar.gz (72.3 kB view details)

Uploaded Source

Built Distribution

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

bo4e-0.0.13-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

File details

Details for the file bo4e-0.0.13.tar.gz.

File metadata

  • Download URL: bo4e-0.0.13.tar.gz
  • Upload date:
  • Size: 72.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for bo4e-0.0.13.tar.gz
Algorithm Hash digest
SHA256 98ebe9048d3baf2414331b932726b21ad74caaaa36c26a6525c2e2cc575f47e5
MD5 18b6a7d0e43581dce0e30164ddb25156
BLAKE2b-256 7466729c253c39e88ba24fe3187c1bc99bd2816d3bdd2bddcb4d06117d6d8ec7

See more details on using hashes here.

File details

Details for the file bo4e-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: bo4e-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 44.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for bo4e-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 17895c72e43c938c02e7ae23f0ba6049cbd4836a4b64a7ff1f87edb8756c2685
MD5 ef2c739000d799b1f3773d1c211a53b9
BLAKE2b-256 c11367e2c3d404181023d7f9fb8d256fcb61dd5d8bb82918653e111715d8c9ba

See more details on using hashes here.

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