python-materialsdb is an unofficial python library for materialsdb.org an open format and database for building materials.
Features :
Package
- serialiser.py :
- from xml : deserialise from materialsdb*.xsd compliant xml file
- to xml : serealise classes to a materialsdb*.xsd compliant xml file
- classes.py : generated classes corresponding to XML elements
- cache.py : cache latest materials data from producers
- config.py : set and get user config as language and country
- ifc/project_library.py : convert deserialised source into IFC (IfcProjectLibrary)
devutils
- classes_generator.py : generate classes (dataclasses except for simple type) for materialsdb*.xsd elements
config
Materials data are often localized. You can set your language and country this way:
from materialsdb import config
config.set_lang("fr")
config.set_country("CH")
Note: in materialsdb standard languages are ISO 639-1 codes and countries are ISO_3166-1_alpha-2 codes.
Usage examples :
Check out some examples:
Querying materials :
The library keeps an sqlite index of the cached materials data for fast filtering and single-material access:
from materialsdb import query
query.refresh() # incremental update from cached xml
rows = query.search("isolant", sort="lambda") # filtered, sorted summaries
material = query.get_material(rows[0].id) # full material dataclass
How to install
Using pip
pip install python-materialsdb
Dependencies
- lxml (BSD) : xml parser (tested with version 6.1.1)
- ifcopenshell (LGPL) : ifc read/write (tested with version 0.8.5)
Third parties :
- materialsdb.org (GPL) : materials schema
Metadata
Release files for python-materialsdb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_materialsdb-0.1.0.tar.gz | 34.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_materialsdb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.4 kB
Release files / python_materialsdb-0.1.0.tar.gz
| Download URL | python_materialsdb-0.1.0.tar.gz |
|---|---|
| Size | 34.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b19714cb0aaf867e4c44a4afc59968f57ba68f37601c7504973ec0816e6be7d
|
|
BLAKE2b-256 checksum How to use checksums |
34aca4967abf196d282db361d3ce557ebe5bf421689f1dac041cc295e69d2f9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / python_materialsdb-0.1.0-py3-none-any.whl
| Download URL | python_materialsdb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 33.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41a104266ef8cacf1eedc50422ad5c225ba99628510483e6f03f368079237dc6
|
|
BLAKE2b-256 checksum How to use checksums |
51e761325fdae1109a2d7ce3c18d0132b53c50591289b325da5ae92008f49805
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|