Skip to main content

A utility tool for Python project initialization and management

Project description

Python Project Manager

Version Python Coverage License

A command-line utility for initializing and managing Python projects.

Features

  • Virtual environment creation and management
  • Git repository initialization with customizable .gitignore
  • Remote Git repository configuration (GitHub, GitLab, etc.)
  • Dependencies management

Prerequisites

  • Python 3.8 or higher
  • Git installed and configured on your system
  • Read/Write access to your remote Git repository (if using --repo-name)

Installation

pip install hodlon-python-project-manager

Usage

Basic usage:

# Initialize a new project with Git repository
pysetup --repo-name my-project

# Force recreate virtual environment
pysetup --force-venv

# Both options together
pysetup --repo-name my-project --force-venv

Detailed Usage Examples

Create a New Project with Virtual Environment

# Create a new project with virtual environment
pysetup

# View detailed output
pysetup --verbose

Configure Remote Git Repository

# GitHub (default)
pysetup --repo-name my-awesome-project

# GitLab
GIT_HOST_URL="https://gitlab.com" pysetup --repo-name my-awesome-project

Force Virtual Environment Recreation

Useful if your virtual environment is corrupted or you want to start fresh:

pysetup --force-venv

Repository Naming Rules

Repository names can only contain:

  • Alphanumeric characters (a-z, A-Z, 0-9)
  • Hyphens (-)
  • Underscores (_)
  • Dots (.)

Generated Project Structure

After running pysetup, your project will have the following structure:

my-project/
├── .gitignore        # Default Git configuration for Python
├── .venv/            # Python virtual environment
└── requirements.txt  # Dependencies file (if exists)

Configuration

The tool can be configured using environment variables:

  • GIT_HOST_URL: URL of your Git host (default: https://github.com)
  • DEFAULT_BRANCH: Default Git branch name (default: main)
  • VENV_DIR: Virtual environment directory name (default: .venv)
  • REQUIREMENTS_FILE: Requirements file name (default: requirements.txt)

Example:

# Using GitHub
GIT_HOST_URL="https://github.com" pysetup --repo-name my-project

# Using GitLab
GIT_HOST_URL="https://gitlab.com" pysetup --repo-name my-project

# Using a self-hosted Git service
GIT_HOST_URL="https://git.company.com" pysetup --repo-name my-project

Development

  1. Clone the repository:
git clone https://github.com/HodlON42/python-project-manager.git
cd python-project-manager
  1. Create a virtual environment and install development dependencies:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate.bat
pip install -e ".[test]"
  1. Run tests:
pytest  # Run all tests
pytest --cov  # Run tests with coverage report

Contributing

Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the GNU AGPL License - see LICENSE file for details.

Security

  • Git commands are executed using shell=True for compatibility. Input validation is performed to mitigate risks.
  • Repository names are used as-is in Git commands. Ensure you use valid repository names.
  • For security issues, please refer to CONTRIBUTING.md

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

hodlon_python_project_manager-1.0.0.tar.gz (46.8 kB view details)

Uploaded Source

Built Distribution

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

hodlon_python_project_manager-1.0.0-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file hodlon_python_project_manager-1.0.0.tar.gz.

File metadata

File hashes

Hashes for hodlon_python_project_manager-1.0.0.tar.gz
Algorithm Hash digest
SHA256 07c92fc8bd0d678af7468e0da8d9f4d61d2314a6f992467845d8c9cdad05d6c5
MD5 4186a613cfcbdb0c948106a2541a869d
BLAKE2b-256 3dc7ae4097ad382c0219a5bf35dd7c57c08e7e5e46738bef8d55c539b54c890e

See more details on using hashes here.

File details

Details for the file hodlon_python_project_manager-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hodlon_python_project_manager-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84f90c09e299d0c1829ef54b7094e768cd25c41ded701fcfc224ba10d3d6007a
MD5 62a98367ab6b06a74848a53823a89f1c
BLAKE2b-256 b7baf13ce783506224f809b077f335dd5ca0d0084d7c9a3e3d10fd1b837e2f5d

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