diff --git a/Base/Py/PyFmt.cpp b/Base/Utils/PyFmt.cpp
similarity index 98%
rename from Base/Py/PyFmt.cpp
rename to Base/Utils/PyFmt.cpp
index 1de783d8ae4f429aea281b3ec401c0ef133652f2..c51cb39bb88ea99e448eb89c2bc20bd346940bd5 100644
--- a/Base/Py/PyFmt.cpp
+++ b/Base/Utils/PyFmt.cpp
@@ -2,7 +2,7 @@
 //
 //  BornAgain: simulate and fit reflection and scattering
 //
-//! @file      Base/Py/PyFmt.cpp
+//! @file      Base/Utils/PyFmt.cpp
 //! @brief     Implements functions from namespace pyfmt.
 //!
 //! @homepage  http://www.bornagainproject.org
@@ -12,7 +12,7 @@
 //
 //  ************************************************************************************************
 
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Const/Units.h" // printDegrees
 #include "Base/Math/Constants.h"
 #include "Base/Utils/Algorithms.h"
diff --git a/Base/Py/PyFmt.h b/Base/Utils/PyFmt.h
similarity index 95%
rename from Base/Py/PyFmt.h
rename to Base/Utils/PyFmt.h
index 1e15f14f06e987588cf557a45ab1fc2daf4d134e..7c08e9b4b95b31d4a11da522b835567fbd94a9af 100644
--- a/Base/Py/PyFmt.h
+++ b/Base/Utils/PyFmt.h
@@ -2,7 +2,7 @@
 //
 //  BornAgain: simulate and fit reflection and scattering
 //
-//! @file      Base/Py/PyFmt.h
+//! @file      Base/Utils/PyFmt.h
 //! @brief     Defines namespace pyfmt.
 //!
 //! @homepage  http://www.bornagainproject.org
@@ -17,8 +17,8 @@
 #endif
 
 #ifndef USER_API
-#ifndef BORNAGAIN_BASE_PY_PYFMT_H
-#define BORNAGAIN_BASE_PY_PYFMT_H
+#ifndef BORNAGAIN_BASE_UTILS_PYFMT_H
+#define BORNAGAIN_BASE_UTILS_PYFMT_H
 
 #include "Base/Vector/Vectors3D.h"
 #include <string>
@@ -74,5 +74,5 @@ std::string indent(size_t width = 4u);
 
 } // namespace Py::Fmt
 
-#endif // BORNAGAIN_BASE_PY_PYFMT_H
+#endif // BORNAGAIN_BASE_UTILS_PYFMT_H
 #endif // USER_API
diff --git a/Core/Export/PyFmt2.cpp b/Core/Export/PyFmt2.cpp
index 0d8415184b16459dbf9c54e5da9c356b567d488f..1e33056088092063754e36bdb0ba10f98722da7d 100644
--- a/Core/Export/PyFmt2.cpp
+++ b/Core/Export/PyFmt2.cpp
@@ -17,7 +17,7 @@
 #include "Base/Axis/PointwiseAxis.h"
 #include "Base/Const/Units.h"
 #include "Base/Math/Constants.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Utils/Algorithms.h"
 #include "Base/Utils/StringUtils.h"
 #include "Core/Export/PyFmtLimits.h"
diff --git a/Core/Export/PyFmtLimits.cpp b/Core/Export/PyFmtLimits.cpp
index f8edfa3dda5b0ff816ebd0db80c016f892812a6f..9674b8b1a44d2ed1192e4dfcb4d8f96541105701 100644
--- a/Core/Export/PyFmtLimits.cpp
+++ b/Core/Export/PyFmtLimits.cpp
@@ -13,7 +13,7 @@
 //  ************************************************************************************************
 
 #include "Core/Export/PyFmtLimits.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Fit/Param/RealLimits.h"
 #include <iomanip>
 
diff --git a/Core/Export/SampleToPython.cpp b/Core/Export/SampleToPython.cpp
index 5670f02f9a539f97a0f0ed454d95cf639dc31c1d..f4c51180a959b6fb4b26328b10e7796edd42b303 100644
--- a/Core/Export/SampleToPython.cpp
+++ b/Core/Export/SampleToPython.cpp
@@ -13,7 +13,7 @@
 //  ************************************************************************************************
 
 #include "Core/Export/SampleToPython.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Utils/Assert.h"
 #include "Base/Vector/Transform3D.h"
 #include "Core/Export/ComponentKeyHandler.h"
diff --git a/Core/Export/SimulationToPython.cpp b/Core/Export/SimulationToPython.cpp
index 5e27d3a1abda7295cd9cdd0631fa6ad76127b72e..a45e1132c7376c2e55ecba337dc5581de69ca52a 100644
--- a/Core/Export/SimulationToPython.cpp
+++ b/Core/Export/SimulationToPython.cpp
@@ -13,7 +13,7 @@
 //  ************************************************************************************************
 
 #include "Core/Export/SimulationToPython.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Utils/Algorithms.h"
 #include "Core/Background/ConstantBackground.h"
 #include "Core/Background/PoissonNoiseBackground.h"
diff --git a/GUI/View/Intensity/PlotEventInfo.cpp b/GUI/View/Intensity/PlotEventInfo.cpp
index 4a1f8ca8231f946e7c01107200787a4cd7210464..536cc98cdcb7500126b1bdfda5c2888a7839ce92 100644
--- a/GUI/View/Intensity/PlotEventInfo.cpp
+++ b/GUI/View/Intensity/PlotEventInfo.cpp
@@ -13,7 +13,7 @@
 //  ************************************************************************************************
 
 #include "GUI/View/Intensity/PlotEventInfo.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 
 PlotEventInfo::PlotEventInfo(PLOT_TYPE type)
     : m_in_axes_range(false)
diff --git a/GUI/View/Projection/SaveProjectionsAssistant.cpp b/GUI/View/Projection/SaveProjectionsAssistant.cpp
index c8e3386971aa61423b5c1820d51fcc09014f6852..416d7b184741a953b65ae32d813afc1af293e67f 100644
--- a/GUI/View/Projection/SaveProjectionsAssistant.cpp
+++ b/GUI/View/Projection/SaveProjectionsAssistant.cpp
@@ -13,7 +13,7 @@
 //  ************************************************************************************************
 
 #include "GUI/View/Projection/SaveProjectionsAssistant.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Device/Histo/Histogram1D.h"
 #include "Device/Histo/Histogram2D.h"
 #include "GUI/Application/GlobalSettings.h"
diff --git a/Param/Distrib/Distributions.cpp b/Param/Distrib/Distributions.cpp
index d4e199660287dabddd8ea4452890eb88e3f892dc..3ace290ab31fc922e1e0bd9529caec575dd79c77 100644
--- a/Param/Distrib/Distributions.cpp
+++ b/Param/Distrib/Distributions.cpp
@@ -14,7 +14,7 @@
 
 #include "Param/Distrib/Distributions.h"
 #include "Base/Math/Constants.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Param/Distrib/ParameterSample.h"
 #include <algorithm>
 #include <cmath>
diff --git a/Sample/Correlations/FTDecay1D.cpp b/Sample/Correlations/FTDecay1D.cpp
index fb7a242bb4d94fa0479a1da8be3a26cfb663e2ce..31d1fe772ac529c2fc1e0f444fdfae879b2df939 100644
--- a/Sample/Correlations/FTDecay1D.cpp
+++ b/Sample/Correlations/FTDecay1D.cpp
@@ -14,7 +14,7 @@
 
 #include "Sample/Correlations/FTDecay1D.h"
 #include "Base/Math/Functions.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Utils/Assert.h"
 #include <algorithm>
 
diff --git a/Sample/Correlations/FTDecay2D.cpp b/Sample/Correlations/FTDecay2D.cpp
index 7b9d6be990496f928179cf0f3023c6df523fff5a..75e6f1b5c7ce07a4b13ae93abfd09bf23971d0bc 100644
--- a/Sample/Correlations/FTDecay2D.cpp
+++ b/Sample/Correlations/FTDecay2D.cpp
@@ -14,7 +14,7 @@
 
 #include "Sample/Correlations/FTDecay2D.h"
 #include "Base/Math/Functions.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Utils/Assert.h"
 #include <algorithm>
 
diff --git a/Sample/Correlations/FTDistributions1D.cpp b/Sample/Correlations/FTDistributions1D.cpp
index 1d2c9968d9c072deb3befdce0f4282658d650966..0d59b3468f3bf1f8b26c2646c76c9eb6f568fbe1 100644
--- a/Sample/Correlations/FTDistributions1D.cpp
+++ b/Sample/Correlations/FTDistributions1D.cpp
@@ -15,7 +15,7 @@
 #include "Sample/Correlations/FTDistributions1D.h"
 #include "Base/Math/Constants.h"
 #include "Base/Math/Functions.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Utils/Assert.h"
 #include <limits>
 
diff --git a/Sample/Correlations/FTDistributions2D.cpp b/Sample/Correlations/FTDistributions2D.cpp
index a691271ecb2a972fcea88ea1e250e29ec5a1572e..1041bab1084cdbbc5b8106b1d8be7a4735df5e6d 100644
--- a/Sample/Correlations/FTDistributions2D.cpp
+++ b/Sample/Correlations/FTDistributions2D.cpp
@@ -15,7 +15,7 @@
 #include "Sample/Correlations/FTDistributions2D.h"
 #include "Base/Math/Bessel.h"
 #include "Base/Math/IntegratorGK.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Utils/Assert.h"
 #include <limits>
 
diff --git a/Sample/Interface/LayerRoughness.cpp b/Sample/Interface/LayerRoughness.cpp
index 677e3a3e4e691cd4a0166ef2bf51447224c2f582..998c792db238bb1d259017387858c33b9d3d5e5d 100644
--- a/Sample/Interface/LayerRoughness.cpp
+++ b/Sample/Interface/LayerRoughness.cpp
@@ -14,7 +14,7 @@
 
 #include "Sample/Interface/LayerRoughness.h"
 #include "Base/Math/Constants.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Fit/Param/RealLimits.h"
 
 //! Constructor of layer roughness.
diff --git a/Sample/Scattering/IFormFactor.cpp b/Sample/Scattering/IFormFactor.cpp
index d36f07eeca610c9bef93040fbd474f734e433ef8..baf23bd36d52b99fe46a1ec371bc6bc85de5dfc7 100644
--- a/Sample/Scattering/IFormFactor.cpp
+++ b/Sample/Scattering/IFormFactor.cpp
@@ -13,7 +13,7 @@
 //  ************************************************************************************************
 
 #include "Sample/Scattering/IFormFactor.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Utils/StringUtils.h"
 #include "Base/Vector/WavevectorInfo.h"
 #include "Sample/Scattering/FormFactorDecoratorPositionFactor.h"
diff --git a/Sample/SoftParticle/FormFactorSphereLogNormalRadius.cpp b/Sample/SoftParticle/FormFactorSphereLogNormalRadius.cpp
index 70099662b6a9042dd71344b6daacfc3c3b06a086..2679e1b6ad58362e84f55924b45dd4b8fead236f 100644
--- a/Sample/SoftParticle/FormFactorSphereLogNormalRadius.cpp
+++ b/Sample/SoftParticle/FormFactorSphereLogNormalRadius.cpp
@@ -13,7 +13,7 @@
 //  ************************************************************************************************
 
 #include "Sample/SoftParticle/FormFactorSphereLogNormalRadius.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Param/Distrib/Distributions.h"
 #include "Param/Distrib/ParameterSample.h"
 #include "Sample/LibFF/SomeFormFactors.h"
diff --git a/Tests/Functional/PyEmbedded/Tests.cpp b/Tests/Functional/PyEmbedded/Tests.cpp
index 3f81124835b8216bcdeab50f330247ddd062a0fe..607b7931262c03585b595c771652dc972db23656 100644
--- a/Tests/Functional/PyEmbedded/Tests.cpp
+++ b/Tests/Functional/PyEmbedded/Tests.cpp
@@ -14,7 +14,7 @@
 #include "BABuild.h"
 #include "BAVersion.h"
 #include "Base/Py/PyCore.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Base/Py/PyUtils.h"
 #include "Base/Utils/SysUtils.h"
 #include "Core/Export/ExportToPython.h"
diff --git a/Tests/Unit/Core/PythonFormattingTest.cpp b/Tests/Unit/Core/PythonFormattingTest.cpp
index 3e604c89f7652b5f1eae716078a72f3b72753422..e0e6525d5b9a5c7aeeef9e7be946fde4a435119a 100644
--- a/Tests/Unit/Core/PythonFormattingTest.cpp
+++ b/Tests/Unit/Core/PythonFormattingTest.cpp
@@ -1,5 +1,5 @@
 #include "Base/Const/Units.h"
-#include "Base/Py/PyFmt.h"
+#include "Base/Utils/PyFmt.h"
 #include "Core/Export/PyFmt2.h"
 #include "Core/Export/PyFmtLimits.h"
 #include "Param/Distrib/Distributions.h"