Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ItsZcx/pyTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

6 Commits

Repository files navigation

pyTemplate

This is a Python project template that includes a basic structure for a Python application, including configuration, modules, tests, and utilities. It also includes a pre-configured Poetry project and Ruff linting settings.

The project uses Pydantic for handling environment variables, which are loaded from a .env file. This provides a type-safe and validated way of accessing and managing configuration settings.

Table of Contents

  1. Template Structure
  2. Setup
  3. Usage
  4. License

Template Structure

The project structure is as follows:

pyTemplate
├── .env.example
├── .gitignore
├── LICENSE
├── poetry.lock
├── pyproject.toml
├── README.md
├── docs
│ └── documentation.md
└── pytemplate
 ├── __init__.py
 ├── config.py
 ├── main.py
 ├── modules
 │ ├── __init__.py
 │ └── xmodule
 │ ├── __init__.py
 │ ├── module_helpers.py
 │ └── module.py
 ├── tests
 │ └── x
 │ └── x_test.py
 └── utils
 ├── __init__.py
 └── utils.py
  • .env.example: Example environment variables file.
  • .gitignore: Gitignore file to exclude certain files from version control.
  • LICENSE: The project's license file.
  • poetry.lock: Poetry's lock file, ensuring consistent dependency versions.
  • pyproject.toml: Poetry's project configuration file.
  • README.md: This README file.
  • docs/documentation.md: Additional project documentation.
  • pytemplate/: The main Python package directory.
    • config.py: Configuration module.
    • __init__.py: Package initialization file.
    • main.py: Entry point for the application.
    • modules/: Directory for project modules.
    • tests/: Directory for test cases.
    • utils/: Directory for utility modules.

Setup

To set up the project, you'll need to have poetry installed. Then, follow these steps:

  1. Clone the repository:
git clone https://github.com/ItsZcx/pyTemplate.git
  1. Navigate to the project directory:
cd pyTemplate
  1. Install the project dependencies using Poetry:
poetry install
  1. (Optional) Create a virtual environment and activate it:
poetry shell

Usage

To run the application, use the following command:

poetry run python pytemplate/main.py

To run the tests, use the following command:

poetry run pytest

License

This project is licensed under the MIT License.

About

Python folder structure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /