Ramon Perez - A Roadmap for Turning Theory and Data Projects into Python Packages

Turn your theory or data project into a Python package by following this roadmap, covering creation, naming conventions, dependencies, and publishing.

Key takeaways
  • To turn a theory or data project into a Python package, create a repository, install the necessary dependencies, and start with a bare package structure.
  • Use a simple and consistent naming convention, such as lars for LASSO regression.
  • Use a pyproject.toml file to manage dependencies, and install dependencies using pip.
  • Create a _MODEL_\_init__.py file to define the package structure.
  • Use twine to create a wheel file and publish the package to PyPI.
  • Use pdm to manage package dependencies and build the package.
  • Consider using a README.md file to provide documentation for the package.
  • Create a virtual environment to isolate dependencies and ensure compatibility.
  • Use a consistent naming convention for files and directories.
  • Use a version control system like Git to manage changes to the package.
  • Create a setup.py file to define the package structure and dependencies.
  • Use pytest to run tests for the package.
  • Create a requirements.txt file to specify dependencies.
  • Use a CI/CD pipeline to automate testing and building of the package.