Skip to content

echo-cms

Package that implements CMS data importing

💾 Installation

This package can be installed using pip by following the latest instructions on the main README of the Performance Echo organization in GitHub.

📖 Documentation

The documentation of this module is available at echo-cms.pages.dev. It uses the mkdocs tool alongside mkdocs-material and mkdocstrings to generate a static website with all the information needed to use the package. All relevant configuration files are present in mkdocs.yml and the documentation files are in the docs folder.

To see the documentation while developing the package, run the command below and open the browser at the address http://localhost:8111. You can change the port if needed.

mkdocs serve -a localhost:8111

When pushing changes to the repository, the documentation will be automatically updated in Cloudfare Pages due to the connection configured in Cloudflare. This way, you don't need to worry about updating the documentation when pushing changes to the repository. The process of configuring the connection in Cloudflare Pages is explained in this link, but there are details were considered:

  1. The deployment uses Cloudflare credentials bruno.macedo@echoenergia.com.br and 1cY&l@EZTx6e9d.
  2. Add the requirements-cloudflare.txt file to the repository, containing the dependencies needed to build the documentation
  3. Change the build command to pip install -r requirements-cloudflare.txt && mkdocs build
  4. To avoid Cloudflare trying to install the requirements from the requirements.txt file, you should add environment variable SKIP_DEPENDENCY_INSTALL with the value 1 to the build settings.
  5. Add the values below in the extra field of the mkdocs.yml file to avoid the page being indexed by search engines like Google and Bing.

    ```yaml extra: meta: - name: robots content: noindex

  6. Specify the Python version to be used in the Cloudflare Pages build settings by adding .python-version file to the root of the repository. Don't forget to remove any mentions to this file in .gitignore file.

🧪 Testing

Pytest

Several pre-defined tests are configured in the auto_test.py file using pytest. Run it to see if the standard functionality of the module is working properly.

One good way to use the pre-configured tests is by using the Visual Studio Code testing module. To do so, just open the icon on the left side of the screen that looks like a test tube and run or debug the tests using pytest.

Warning

Keep in mind that the pre-configured tests in this file assumes that you are running them from the performance server. They will fail otherwise.

Local installation

During development the package can be installed from the local repository using the command below. The first line is there to remove the build folder, which can have previously deleted files.

uv pip install . --no-deps --reinstall --no-cache

🏃 Scripts

The folder scripts was added to the package as a version control for scripts deployed in remote servers to run automated tasks. One example is the ge_cms_exporter.py script that exports data from the GE CMS software to a folder shared via FTP to later be imported by the performance server.

Any changes made to these scripts should be written documented in this package for future reference.

Current scripts:

  • ge_cms_exporter.py: Exports data from GE CMS software to a shared folder via FTP.
  • disconnect.bat: When executed as admin will disconnect the current RDP session without logging off the user.

📝 TODO - Future work

Below are listed some ideas for future work in this package. They are not a priority, but would be nice to have.

  • Upgrade pickled models of CMS LDA to allow compatibility with scikit-learn version 1.4 and above. Currently we forced version 1.3.2 to avoid breaking the code.