<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MolGod</title>
    <description>The latest articles on DEV Community by MolGod (@molgod).</description>
    <link>https://dev.to/molgod</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4240193%2F471ae275-2ea7-40fe-ae17-26ae91fa41da.png</url>
      <title>DEV Community: MolGod</title>
      <link>https://dev.to/molgod</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/molgod"/>
    <language>en</language>
    <item>
      <title>From SMILES to a printable 3D model: how molecular models are prepared for 3D printing</title>
      <dc:creator>MolGod</dc:creator>
      <pubDate>Fri, 13 Nov 2026 17:08:32 +0000</pubDate>
      <link>https://dev.to/molgod/from-smiles-to-a-printable-3d-model-how-molecular-models-are-prepared-for-3d-printing-2aa3</link>
      <guid>https://dev.to/molgod/from-smiles-to-a-printable-3d-model-how-molecular-models-are-prepared-for-3d-printing-2aa3</guid>
      <description>&lt;p&gt;Physical molecular models help students and researchers see geometry that flat structural formulas hide. This short guide describes the typical pipeline from a chemical identifier to a printable 3D model.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Start from a reliable identifier
&lt;/h2&gt;

&lt;p&gt;Every substance can be pinned down with several identifiers: the CAS Registry Number, a SMILES string, an InChI and its hashed form, the InChIKey. For caffeine, for example, the CAS RN is 58-08-2. Using a CAS number together with a structure identifier avoids mixing up isomers and salts.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Generate 3D coordinates
&lt;/h2&gt;

&lt;p&gt;A SMILES string only encodes connectivity. To get a 3D shape you need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;add explicit hydrogens,&lt;/li&gt;
&lt;li&gt;embed the molecule in 3D space (distance geometry or a similar method),&lt;/li&gt;
&lt;li&gt;run a force-field optimisation to remove strained geometry,&lt;/li&gt;
&lt;li&gt;check stereocenters against the source identifier.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Choose a representation
&lt;/h2&gt;

&lt;p&gt;Ball-and-stick models show bonds clearly. Space-filling models show the van der Waals volume. For printing, ball-and-stick usually needs thicker bonds than the "real" proportions so the print stays sturdy.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Export and check the mesh
&lt;/h2&gt;

&lt;p&gt;Export the geometry as STL, then verify that the mesh is watertight, that atoms overlap enough to be printed as one solid and that the model fits the printer bed. Scale so that the thinnest bond is at least a couple of nozzle widths thick.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Print and label
&lt;/h2&gt;

&lt;p&gt;Print in a single colour or split by element for multi-colour printers. Label the model with the compound name and CAS number so it can be traced back to its record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ready-made examples
&lt;/h2&gt;

&lt;p&gt;If you prefer to start from existing models, the &lt;a href="https://molgod.org/molecule/58-08-2/" rel="noopener noreferrer"&gt;MolGod caffeine 3D model page&lt;/a&gt; shows how a substance page can combine the CAS number, structure data and a print-ready STL file.&lt;/p&gt;

&lt;p&gt;Questions or corrections are welcome in the comments.&lt;/p&gt;

</description>
      <category>chemistry</category>
      <category>3dprinting</category>
      <category>education</category>
      <category>science</category>
    </item>
    <item>
      <title>The 16 sections of a Safety Data Sheet (SDS) and where the CAS number fits</title>
      <dc:creator>MolGod</dc:creator>
      <pubDate>Fri, 13 Nov 2026 13:30:13 +0000</pubDate>
      <link>https://dev.to/molgod/the-16-sections-of-a-safety-data-sheet-sds-and-where-the-cas-number-fits-e47</link>
      <guid>https://dev.to/molgod/the-16-sections-of-a-safety-data-sheet-sds-and-where-the-cas-number-fits-e47</guid>
      <description>&lt;p&gt;A Safety Data Sheet (SDS) follows the 16-section layout defined by the GHS standard, so you can find the same information in the same place for any chemical.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 16 sections
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Identification (product name, supplier, &lt;strong&gt;CAS number&lt;/strong&gt; is often listed here or in section 3)&lt;/li&gt;
&lt;li&gt;Hazard(s) identification (GHS classification, pictograms, H and P statements)&lt;/li&gt;
&lt;li&gt;Composition / information on ingredients (substances, concentrations, CAS and EC numbers)&lt;/li&gt;
&lt;li&gt;First-aid measures&lt;/li&gt;
&lt;li&gt;Fire-fighting measures&lt;/li&gt;
&lt;li&gt;Accidental release measures&lt;/li&gt;
&lt;li&gt;Handling and storage&lt;/li&gt;
&lt;li&gt;Exposure controls / personal protection&lt;/li&gt;
&lt;li&gt;Physical and chemical properties&lt;/li&gt;
&lt;li&gt;Stability and reactivity&lt;/li&gt;
&lt;li&gt;Toxicological information&lt;/li&gt;
&lt;li&gt;Ecological information&lt;/li&gt;
&lt;li&gt;Disposal considerations&lt;/li&gt;
&lt;li&gt;Transport information&lt;/li&gt;
&lt;li&gt;Regulatory information&lt;/li&gt;
&lt;li&gt;Other information (revision date, abbreviations)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why the CAS number matters
&lt;/h2&gt;

&lt;p&gt;A CAS Registry Number is an unambiguous identifier for a substance. Product names vary between suppliers and languages, while the CAS number stays the same, so it is the safest key for matching an SDS to a substance in a database or an inventory.&lt;/p&gt;

&lt;p&gt;A minimal lookup key in code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sds_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"58-08-2"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Caffeine"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ghs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"GHS07"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sds_index&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"58-08-2"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Practical checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Match the SDS to the substance by CAS number, not by trade name.&lt;/li&gt;
&lt;li&gt;Check the revision date in section 16.&lt;/li&gt;
&lt;li&gt;Read sections 2, 7 and 8 first for handling decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For identifiers such as CAS, SMILES and InChI for individual molecules, see the &lt;a href="https://molgod.org/encyclopedia/" rel="noopener noreferrer"&gt;MolGod molecule encyclopedia&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>chemistry</category>
      <category>safety</category>
      <category>database</category>
      <category>python</category>
    </item>
    <item>
      <title>How to read and validate a CAS Registry Number (with a Python check-digit example)</title>
      <dc:creator>MolGod</dc:creator>
      <pubDate>Thu, 12 Nov 2026 05:59:41 +0000</pubDate>
      <link>https://dev.to/molgod/how-to-read-and-validate-a-cas-registry-number-with-a-python-check-digit-example-3b9l</link>
      <guid>https://dev.to/molgod/how-to-read-and-validate-a-cas-registry-number-with-a-python-check-digit-example-3b9l</guid>
      <description>&lt;p&gt;A CAS Registry Number (CAS RN) is a unique numeric identifier assigned by the Chemical Abstracts Service to a chemical substance. Unlike a trivial name, it does not change when people use a different synonym, which makes it the most practical key for matching substances across safety data sheets (SDS), supplier catalogues and datasets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Format
&lt;/h2&gt;

&lt;p&gt;A CAS number has three parts separated by hyphens: &lt;code&gt;XXXXXXX-YY-Z&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the first part has 2 to 7 digits,&lt;/li&gt;
&lt;li&gt;the second part has exactly 2 digits,&lt;/li&gt;
&lt;li&gt;the last part is a single check digit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Substance&lt;/th&gt;
&lt;th&gt;CAS RN&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Water&lt;/td&gt;
&lt;td&gt;7732-18-5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ethanol&lt;/td&gt;
&lt;td&gt;64-17-5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Caffeine&lt;/td&gt;
&lt;td&gt;58-08-2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Acetylsalicylic acid (aspirin)&lt;/td&gt;
&lt;td&gt;50-78-2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The check digit
&lt;/h2&gt;

&lt;p&gt;The last digit is computed from the others. Take all digits except the check digit, read them from right to left, multiply the first by 1, the second by 2, the third by 3 and so on, sum the products and take the result modulo 10.&lt;/p&gt;

&lt;p&gt;For ethanol (64-17-5): the digits without the check digit are 6, 4, 1, 7. Read from the right they are 7, 1, 4, 6, so 7*1 + 1*2 + 4*3 + 6*4 = 45, and 45 mod 10 = 5. That matches the final digit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validation in Python
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;is_valid_cas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fullmatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="s2"&gt;"\d{2,7}-\d{2}-\d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cas&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;
    &lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"-"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;reversed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;cas&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"7732-18-5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"64-17-5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"58-08-2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"50-78-2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"64-17-4"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;is_valid_cas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cas&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last value, &lt;code&gt;64-17-4&lt;/code&gt;, fails because its check digit is wrong, which is a typical typo caught by this test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A valid check digit only proves the number is well formed, not that it is assigned to the substance you think it is. Always confirm the substance name against a trusted source.&lt;/li&gt;
&lt;li&gt;One substance can have several CAS numbers (for example for different salts, hydrates or isomers), and mixtures may not have a single number.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where to look up substances
&lt;/h2&gt;

&lt;p&gt;For a quick lookup of a substance by name or CAS number, together with basic safety information, you can use the &lt;a href="https://molgod.org/" rel="noopener noreferrer"&gt;MolGod chemical substance reference&lt;/a&gt;. For hazard classification and handling, always read the official safety data sheet from the supplier of the exact product you use.&lt;/p&gt;

&lt;p&gt;If you work with chemical data in code, validating CAS numbers at the input stage saves a surprising amount of cleaning later.&lt;/p&gt;

</description>
      <category>chemistry</category>
      <category>python</category>
      <category>data</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
