Skip to main content

A package for opening, editing, and saving Files of Synthesis (*.fos)

Project description

FoSpy

A package for opening, editing, and saving Files of Synthesis (*.fos)

Code Example

from FoSpy import Synthesis, TemplateSet

# load synthesis and templates from files
my_synthesis = Synthesis.fromFile(r"example/synthesis.fos")
my_templates = TemplateSet.fromFile(r"example/templates.fos")

# change some metadata for my synthesis
my_synthesis.metadata.name = "TE002"
my_synthesis.metadata.date = "05-17-2026"
my_synthesis.metadata.internal_project_ID = "Arsenide 28+d clathrates"
my_synthesis.reaction.nominal_formula = "Ba8Cu13Zn11As28.5"

# load a template and fill it in before adding to synthesis
arsenic_template = my_templates.materials.get_first(formula=ChemFormula("As"))
arsenic = arsenic_template.fill(type="reagent", ratio=28.5)
my_synthesis.materials.append(arsenic)

# save changes
saved = [file.save() for file in (my_templates, my_synthesis)]

A Simple FOS File

name: TE001
date: 03-11-2026
// This comment will remain attached to the experimenters when saving.
experimenters: [
    name: Travis Errthum
    affiliation: Kovnir Group - Iowa State University
    orcid: 0009-0006-1937-5672
]
// ! Comments starting with a ! do not get read from the file.
internal_project_ID: Ba2-TM5-Pn6
internal_project_description: Unique Clathrate

[Reaction]
nominal_formula: Ba2Zn5Sb6
nominal_mass: 250.0
nominal_mass_units: mg

[[Materials]]
:name
:type
:formula
:supplier
:cas
:form
:purity
:env
:ratio
:treatments

    Barium
    reagent
    Ba
    Thermofisher
    7440-39-3
    lump
    0.999
    Ar (g)
    // The comment below will be correctly re-calculated when saving,
    // ...provided that the materials.add_weight_pcts routine is scheduled.
    // otherwise it will be removed altogether.
    // ! Total weight percent: 200%
    2.0
    [
        type: cutting
        repeats: 1
        observations: smaller pieces improve homogenization
    ]

Project details


Download files

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

Source Distribution

fospy-0.0.3.tar.gz (362.2 kB view details)

Uploaded Source

Built Distribution

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

fospy-0.0.3-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file fospy-0.0.3.tar.gz.

File metadata

  • Download URL: fospy-0.0.3.tar.gz
  • Upload date:
  • Size: 362.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for fospy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5cb35a1d30307addf3a7368f30c6a8a2bb656f9f41f36ff57127efa61f4bc22f
MD5 e789994206b46078fd2456e9887b47cf
BLAKE2b-256 d4ec893affe391fcf1f76b573f9e6155b734880f06ac44c87b03b685654d26c9

See more details on using hashes here.

File details

Details for the file fospy-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: fospy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for fospy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 af414666a318e0c5bbcac1aa91145498df53aa1f6a2935fe5e2db5fc78614ef2
MD5 5081e7c5eed76fe26a1130f09a9b1aca
BLAKE2b-256 c2ab3f0c95fa1c6c8dc46853f75ba860728ae2e38f082af5e92d402c90aa8c4b

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