{"id":22643226,"url":"https://github.com/hochfrequenz/bo4e-dotnet","last_synced_at":"2026-04-02T12:01:52.745Z","repository":{"id":37504721,"uuid":"221756295","full_name":"Hochfrequenz/BO4E-dotnet","owner":"Hochfrequenz","description":"C# / .NET Core implementation of Business Objects for Energy (BO4E). Full Docs: https://hochfrequenz.github.io/bo4e-livedocs/api/BO4E.BO.html","archived":false,"fork":false,"pushed_at":"2024-12-10T10:21:37.000Z","size":6379,"stargazers_count":5,"open_issues_count":49,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-12-10T10:28:15.200Z","etag":null,"topics":["bo4e","dotnet","energiewirtschaft"],"latest_commit_sha":null,"homepage":"https://hochfrequenz.de","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hochfrequenz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-14T17:53:57.000Z","updated_at":"2024-12-10T09:31:28.000Z","dependencies_parsed_at":"2023-07-21T11:31:20.941Z","dependency_job_id":"6c5e8d0c-b4b6-4200-ab15-2c17951faf51","html_url":"https://github.com/Hochfrequenz/BO4E-dotnet","commit_stats":{"total_commits":543,"total_committers":14,"mean_commits":"38.785714285714285","dds":"0.49723756906077343","last_synced_commit":"bd970ca037ab385419153a9b6cd5668d2373cd0c"},"previous_names":["hfinnovation/bo4e-dotnet"],"tags_count":221,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hochfrequenz%2FBO4E-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hochfrequenz%2FBO4E-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hochfrequenz%2FBO4E-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hochfrequenz%2FBO4E-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hochfrequenz","download_url":"https://codeload.github.com/Hochfrequenz/BO4E-dotnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230568590,"owners_count":18246378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bo4e","dotnet","energiewirtschaft"],"created_at":"2024-12-09T05:09:43.683Z","updated_at":"2026-01-23T20:12:23.327Z","avatar_url":"https://github.com/Hochfrequenz.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BO4E-dotnet\n\n![Unittests Status Badge](https://github.com/Hochfrequenz/BO4E-dotnet/workflows/Unittests/badge.svg)\n![Nuget Pre-Release Package](https://github.com/Hochfrequenz/BO4E-dotnet/workflows/Nuget%20Develop%20Prerelease/badge.svg)\n![Nuget Release Package](https://github.com/Hochfrequenz/BO4E-dotnet/workflows/Nuget%20Master%20Release/badge.svg)\n\nBO4E-dotnet is a C# implementation of **B**usiness **O**bjects for **E**nergy ([BO4E](https://www.bo4e.de/)), a standard used to model business objects in the German energy market. This repository contains class definitions and enumerations for most of the Business Objects, however as of today it's not complete yet and pull requests are very welcome. [JSON.net](https://github.com/JamesNK/Newtonsoft.Json) attributes are used to model obligatory and optional fields of the single business objects and components.\n\nThe source code in this repository is Open Source and available under a MIT license; see [the license file](LICENSE).\n\n## Nuget Packages and Usage of BO4E-dotnet\n\nThe content of this repository is used to build the following nuget packages:\n\n| **Package Name**                                                                             | **Description**                                                                                                                                                                  | **Stability \u0026 Maturity**                                                                                                 |\n| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |\n| [Hochfrequenz.BO4Enet](https://www.nuget.org/packages/Hochfrequenz.BO4Enet)                  | Definitions of the business objects (namespace `BO4E.BO`), compontents (namespace `BO4E.COM`) and enumerations (namespace `BO4E.ENUM`)                                           | not feature complete but stable and widely used in production for JSON serialization; still alpha for GRPC serialization |\n| [Hochfrequenz.BO4E.Extensions](https://www.nuget.org/packages/Hochfrequenz.BO4E.Extensions/) | Contains extension methods for business objects and components (as of now mostly `BO.Energiemenge` and `COM.Verbrauch`, which are heavily used by Hochfrequenz cloud solutions). | stable, high test coverage, production use                                                                               |\n| [Hochfrequenz.BO4E.Reporting](https://www.nuget.org/packages/Hochfrequenz.BO4E.Extensions/)  | Contains tools to analyse single business objects and sets of objects                                                                                                            | stable, high test coverage, production use                                                                               |\n\n## This Repository Is Not Feature Complete Yet\n\nPlease see [Issue #29](https://github.com/Hochfrequenz/BO4E-dotnet/issues/29) for a list of Business Objects, that are not yet implemented. Your contributions are very welcome.\n\n## Detailed Documentation\n\nThe docstrings from within the source code are used to automatically generate a [doc.fx based documentation](https://hochfrequenz.github.io/bo4e-livedocs/api/BO4E.BO.html). Please also consider the [official documentation](https://www.bo4e.de/dokumentation) maintained by Interessengemeinschaft Geschäftsobjekte Energiewirtschaft e.V. from which most of the source code docstrings are copied/derived.\n\n## Getting Started / Basic Examples\n\n1. install the nuget package [Hochfrequenz.BO4Enet](https://www.nuget.org/packages/Hochfrequenz.BO4Enet)\n2. import it\n\n```c#\nusing BO4E;\n```\n\n3. start developing applications based on Business Objects for Energy (BO4E)\n\n### Create BusinessObjects\n\n```c#\nusing BO4E.BO;\nusing BO4E.ENUM;\n// ...\nvar energiemenge = new Energiemenge()\n{\n    LokationsId = \"DE0123456789012345678901234567890\",\n    LokationsTyp = LokationsTyp.MeLo,\n    Energieverbrauch = new List\u003cVerbrauch\u003e()\n};\n```\n\n### Make Use of Built in Validation Methods for German Location IDs\n\n```c#\nusing BO4E.BO;\nusing BO4E.ENUM;\n// ...\nvar malo = new Marktlokation()\n{\n    MarktlokationsId = \"1235678901\",\n    Sparte = Sparte.STROM,\n    Energierichtung = Energierichtung.AUSSP\n};\nAssert.IsFalse(malo.IsValid()); // because the obligatory bilanzierungsmethode is not set\nmalo.bilanzierungsmethode = Bilanzierungsmethode.SLP;\nAssert.IsTrue(malo.IsValid(checkId:false)); // because all obligatory fields are set\nAssert.IsFalse(malo.IsValid()); // but the marklokationsId is still wrong\nmalo.MarktlokationsId = \"51238696781\"; // matches the appropriate regex and has the right check sum\nAssert.IsTrue(malo.IsValid());\n```\n\n### Add Custom Fields on the Fly via UserProperties\n\n```c#\nusing BO4E.BO;\nusing Newtonsoft.Json;\n// ...\nstring meloJson = @\"{'messlokationsId': 'DE0123456789012345678901234567890', 'sparte': 'STROM', 'myCustomInfo': 'some_value_not_covered_by_bo4e', 'myCustomValue': 123.456}\";\nvar melo = JsonConvert.DeserializeObject\u003cMesslokation\u003e(meloJson);\nAssert.IsTrue(melo.IsValid());\nAssert.IsNotNull(melo.UserProperties);\nAssert.AreEqual(\"some_value_not_covered_by_bo4e\", melo.UserProperties[\"myCustomInfo\"].ToObject\u003cstring\u003e());\nAssert.AreEqual(123.456M, melo.UserProperties[\"myCustomValue\"].ToObject\u003cdecimal\u003e());\n```\n\n### Don't Write Your Own Logic for Basic Operations\n\n```c#\nusing BO4E.COM;\nusing BO4E.ENUM;\n// ...\nvar v1 = new Verbrauch()\n{\n    Einheit = Mengeneinheit.KWH,\n    Obiskennzahl = \"1-1:1.8.0\",\n    Startdatum = new DateTime(2019, 1, 1, 0, 0, 0, DateTimeKind.Utc),\n    Enddatum = new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc)\n};\nvar v2 = new Verbrauch()\n{\n    Einheit = Mengeneinheit.KWH,\n    Obiskennzahl = \"1-1:1.8.0\",\n    Startdatum = new DateTime(2019, 1, 1, 0, 0, 0, DateTimeKind.Utc),\n    Enddatum = new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc)\n};\n\nAssert.AreEqual(v1, v2);\nAssert.IsTrue(v1.Equals(v2));\nAssert.AreEqual(v1.GetHashCode(), v2.GetHashCode());\nAssert.IsFalse(v1 == v2);\n```\n\n### Feature Rich Extension Packages\n\nUsing the [Hochfrequenz.BO4E.Extensions](https://www.nuget.org/packages/Hochfrequenz.BO4E.Extensions/) gives you access to powerful analysis methods for Business Objects. We present them directly as minimal working examples in executable show case tests.\n\n- [Energiemenge](/TestBO4E.Extensions/ShowCaseTests/EnergiemengeShowCaseTests.cs)\n- [Verbrauch](TestBO4E.Extensions/ShowCaseTests/VerbrauchShowCaseTests.cs)\n- [CompletenessReport](/TestBO4E.Reporting/ShowCaseTests/CompletenessReportShowCaseTests.cs)\n- [(Partially) Anonymized Business Objects](/TestBO4E-dotnet-Encryption/ShowCaseTests/AnonymizerShowCaseTests.cs)\n\n### Stable and Reliable Due to Good Test Coverage\n\n(branch coverage as of 2020-04-09, not yet automated)\n\n- ~54% in BO4E main project\n- ~69% in the extensions package\n- ~66% in the reporting package\n\n## Batteries Included\n\nWe try to make the usage of BO4E in general and this library in particular as smooth as possible. Therefore it not only includes bare C\\# files but also some extra ressources that might be usefule to you.\n\n### PlantUML files\n\nThe folder [puml-files](puml-files) contains autogenerated PlantUML definitions for Business Objects, COMponents and ENUMs that are currently implemented in this repository. You can use the files provided in this repository or generate them on your own using [PlantUmlClassDiagramGenerator](https://github.com/pierre3/PlantUmlClassDiagramGenerator) by Hirotada Kobayashi aka pierre3. Please find instructions on how to use the tool in their repository. Please especially note that [include.puml](puml-files/include.puml) includes _all_ definitions inside just one file.\n\n### Easy Validation using Json.NET Schema (JSchema)\n\nThe folder [json-schema-files](json-schema-files) contains autogenerated JSON.net schemas for all Business Objects that are currently implemented in this repository. Using these schemas allows for easy, transparent and cross plattform validation of your Business Objects. (Find out more about [Json Schema](https://www.newtonsoft.com/jsonschema).)\n\n### Protocol-Buffer Definitions\n\nIn the folder [BO4E-dotnet/protobuf-files](BO4E-dotnet/protobuf-files) you can find autogenerated `.proto` files for all implemented Business Objects (except for those with multiple inheritance like e.g. `BO.Marktteilnehmer` or those derived from `BO.Preisblatt` which still causes headache using [protobuf-net](https://github.com/protobuf-net/protobuf-net)). The proto files are embedded into the BO4E nuget package as content files. This allows you to reference them.\n\n## Release Workflow\n\nClick on [\"Draft a new Release\"](https://github.com/Hochfrequenz/BO4E-dotnet/releases/new), then create a new tag **without a `v` prefix**, e.g. `0.2.34`.\nThis should trigger the [nuget Github Action](https://github.com/Hochfrequenz/BO4E-dotnet/blob/58fcbd224f5de59c6380c96b7af6f698d85ffcf3/.github/workflows/nuget_package_push.yml#L8).\n\nFind previous workflow runs [here](https://github.com/Hochfrequenz/BO4E-dotnet/actions/workflows/nuget_package_push.yml).\n\n## Other Noteworthy BO4E Implementations\n\n- [Golang](https://github.com/Hochfrequenz/go-bo4e/)\n- [Kotlin](https://github.com/openEnWi/ktBO4E-lib)\n- [Python](https://github.com/Hochfrequenz/BO4E-python/)\n- [TypeScript](https://github.com/Hochfrequenz/bo4e-dotnet-ts-models), inherently consistent with this .NET library\n- [TypeScript](https://github.com/openEnWi/tsBO4E-lib), independent of this library\n\n## Contributing\n\nContributions are welcome. Feel free to open a Pull Request against the main branch of this repository. Please provide unit tests if you contribute logic beyond bare bare business object definitions. We do track our modification proposals to the official BO4E standard in a separate repository: [BO4E-modification-proposals](https://github.com/Hochfrequenz/bo4e-modification-proposals).\n\n## Hochfrequenz\n\n[Hochfrequenz Unternehmensberatung GmbH](https://www.hochfrequenz.de) is a Grünwald (near Munich) based consulting company with offices in Berlin, Köln, Leipzig and Bremen. We're not only the main contributor to open source BO4E software but, according to [Kununu ratings](https://www.kununu.com/de/hochfrequenz-unternehmensberatung1), also 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](https://www.hochfrequenz.de/index.php/karriere/aktuelle-stellenausschreibungen/full-stack-entwickler) (German only).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhochfrequenz%2Fbo4e-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhochfrequenz%2Fbo4e-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhochfrequenz%2Fbo4e-dotnet/lists"}