OpenPartsLibrary 0.1.9__py3-none-any.whl → 0.1.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
openpartslibrary/db.py CHANGED
@@ -13,9 +13,12 @@ import os
13
13
 
14
14
 
15
15
  class PartsLibrary:
16
- def __init__(self):
16
+ def __init__(self, db_path=None):
17
17
  import os
18
- sqlite_path = os.path.join(os.path.dirname(__file__), 'data', 'parts.db')
18
+ if db_path is not None:
19
+ sqlite_path = db_path
20
+ else:
21
+ sqlite_path = os.path.join(os.path.dirname(__file__), 'data', 'parts.db')
19
22
  print(sqlite_path)
20
23
  self.engine = create_engine('sqlite:///' + sqlite_path)
21
24
 
@@ -51,7 +51,6 @@ class File(Base):
51
51
  part_id = Column(ForeignKey('parts.id'))
52
52
  part = relationship('Part', back_populates='cad_reference')
53
53
 
54
-
55
54
  class Part(Base):
56
55
  __tablename__ = 'parts'
57
56
 
@@ -112,17 +111,56 @@ class Supplier(Base):
112
111
  def to_dict(self):
113
112
  return {column.name: getattr(self, column.name) for column in self.__table__.columns}
114
113
 
115
- class Adress(Base):
116
- __tablename__ = 'adresses'
114
+ class Material(Base):
115
+ __tablename__ = "materials"
117
116
 
118
117
  id = Column(Integer, primary_key=True)
119
118
  uuid = Column(String(32), unique=True, nullable=False)
120
- street = Column(String(200))
121
- house_number = Column(String(20))
122
- postal_code = Column(String(20))
123
- city = Column(String(100))
124
- country = Column(String(100))
125
-
119
+ # General information
120
+ name = Column(String, nullable=False) # e.g. Steel plate 12 mm
121
+ standard_number = Column(String) # Standardized number (e.g., 1.4301)
122
+ density = Column(Float) # g/cm³
123
+
124
+ # Mechanical properties
125
+ elastic_modulus = Column(Float) # Young’s modulus (GPa)
126
+ shear_modulus = Column(Float) # Shear modulus (GPa)
127
+ poisson_ratio = Column(Float) # Dimensionless
128
+ tensile_strength = Column(Float) # Rm, MPa
129
+ yield_strength = Column(Float) # Re or Rp0.2, MPa
130
+ fatigue_strength = Column(Float) # Endurance limit, MPa
131
+ elongation = Column(Float) # Elongation at break, %
132
+ hardness = Column(Float) # hardness value, scale also has to specified
133
+ hardness_scale = Column(String) # e.g., HB, HV, HRC
134
+ toughness = Column(Float) # Charpy impact energy, J
135
+
136
+ # Physical properties
137
+ thermal_conductivity = Column(Float) # W/mK
138
+ specific_heat_capacity = Column(Float) # J/kgK
139
+ thermal_expansion = Column(Float) # 1/K
140
+ electrical_conductivity = Column(Float) # S/m
141
+ magnetic_behavior = Column(String) # Ferromagnetic, paramagnetic, diamagnetic
142
+
143
+ # Chemical properties
144
+ oxidation_resistance_air = Column(String) # good, limited, poor
145
+
146
+ # Technological properties
147
+ weldability = Column(String) # good, limited, poor
148
+ castability = Column(String) # good, limited, poor
149
+ formability = Column(String) # good, limited, poor
150
+ machinability = Column(String) # good, limited, poor
151
+ hardenability = Column(String) # good, limited, poor
152
+
153
+ # Operational properties
154
+ temperature_min = Column(String) # Usable min temperature
155
+ temperature_max = Column(String) # Usable max temperature
156
+ wear_resistance = Column(String) # good, limited, poor
157
+
158
+ # Economic aspects
159
+ price = Column(Float) # Price per kg, currency also has to be specified separately
160
+ currency = Column(String) # Currency for the price per kg
161
+ availability = Column(String) # available/ not available
162
+ lead_time = Column(Integer) # lead time for delivery in days
163
+
126
164
 
127
165
  '''
128
166
  Relationship tables
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OpenPartsLibrary
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: Python library for creating a database of hardware components for manufacturing
5
5
  Home-page: https://github.com/alekssadowski95/OpenPartsLibrary
6
6
  Author: Aleksander Sadowski
@@ -0,0 +1,9 @@
1
+ openpartslibrary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ openpartslibrary/cli.py,sha256=4QZi-Gub33jWsUPnVmIv2N_iq8fd9WTGePscLwMujHY,2614
3
+ openpartslibrary/db.py,sha256=y7joiVY1_4-5CXY4ezKLKNJ8qlB99aJoYYt1SqENgZY,8670
4
+ openpartslibrary/models.py,sha256=agXXC_TmH7_soQqOAawRT-1Y2_643Nof7Vmq36xzNh4,7013
5
+ openpartslibrary-0.1.11.dist-info/licenses/LICENSE,sha256=d0dlaVkR5u5bZVrTL-FmUyCoiu3o87Vc-MF1X-NYSXA,1076
6
+ openpartslibrary-0.1.11.dist-info/METADATA,sha256=Oh2SAKaHoYQgGUcJSWZnZngePubuRQeR5QopzoqgXZI,7815
7
+ openpartslibrary-0.1.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ openpartslibrary-0.1.11.dist-info/top_level.txt,sha256=-26qZ2PdH7UxxjYQmnXDViKaFDd5Mb5e_Xp__WDTdKQ,17
9
+ openpartslibrary-0.1.11.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- openpartslibrary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- openpartslibrary/cli.py,sha256=4QZi-Gub33jWsUPnVmIv2N_iq8fd9WTGePscLwMujHY,2614
3
- openpartslibrary/db.py,sha256=pW2QtaluIEqVUMDU3kj7EUSE-WzfH9Q3BtiUdy1Fnjo,8572
4
- openpartslibrary/models.py,sha256=tadjKKi-ChLaqwYM96biZ2DiRSiaszrX5e76dhFHKGQ,5163
5
- openpartslibrary-0.1.9.dist-info/licenses/LICENSE,sha256=d0dlaVkR5u5bZVrTL-FmUyCoiu3o87Vc-MF1X-NYSXA,1076
6
- openpartslibrary-0.1.9.dist-info/METADATA,sha256=SkqvSZ2uM2qdgmBwFl50TUyjPiGH5n7_W_pXlBslXTA,7814
7
- openpartslibrary-0.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- openpartslibrary-0.1.9.dist-info/top_level.txt,sha256=-26qZ2PdH7UxxjYQmnXDViKaFDd5Mb5e_Xp__WDTdKQ,17
9
- openpartslibrary-0.1.9.dist-info/RECORD,,