PyCargo is a CLI tool designed to bootstrap Python projects with ease. It helps you set up a Python project directory, manage dependencies, initialize Git repositories, and optionally create a GitHub repository.
- Create a Python project directory.
- Generate a
requirements.txtfile based on predefined setups (basic,advanced,data-science, orblank). - Initialize a Git repository and configure Git settings.
- Automatically check and set Git configuration (
user.nameanduser.email). - Create a GitHub repository (requires a GitHub Personal Access Token).
- Specify whether the GitHub repository should be private or public.
- Automatically install and configure
uvfor virtual environment and dependency management. - Download essential files like
.gitignoreandLICENSEautomatically from predefined URLs.
Download the latest release from the pycargo-0.2.10-x86_64.msi file and install it on your system.
Run the pycargo command with the desired options:
pycargo -n my_projectThis creates a project directory named my_project with the default advanced setup.
pycargo -n my_project -s basicAvailable setup types:
basic: Installsnumpy,pandas,matplotlib,seaborn, andipykernel.advanced: Installs additional libraries likeplotly,requests, andstreamlit.data-science: Includesbasiclibraries plusscikit-learn,statsmodels,streamlit, andxgboost.blank: Creates an emptyrequirements.txtfile for custom dependencies.
pycargo -n my_project -gThis creates a public GitHub repository named my_project and links it to the local Git repository.
pycargo -n my_project -g -pThis creates a private GitHub repository named my_project and links it to the local Git repository.
pycargo -n my_project -g --github-repo-name custom_repo_nameThis creates a GitHub repository named custom_repo_name and links it to the local Git repository.
After the setup is complete, activate the virtual environment:
.venv\Scripts\activateTo display the help menu with all available options:
pycargo --helpTo display the current version of PyCargo:
pycargo -VThe following files are automatically downloaded and added to your project:
.gitignore: A standard Python.gitignorefile from GitHub's official repository.LICENSE: The Apache License 2.0 from the official Apache website.
If user.name or user.email is not set in your Git configuration, PyCargo will prompt you to set them during the setup process.
PyCargo ensures that uv is installed on your system. If not, it will automatically install it for you.
To create a GitHub repository, you need to set a GitHub Personal Access Token (PAT) as an environment variable:
- Generate a PAT from your GitHub account with
reposcope. - Set the
GITHUB_TOKENenvironment variable:- Command Prompt:
setx GITHUB_TOKEN "your-token-here"
- PowerShell:
[Environment]::SetEnvironmentVariable("GITHUB_TOKEN", "your-token-here", "User")
- Windows GUI:
- Open the Start Menu and search for "Environment Variables".
- Click on "Edit the system environment variables".
- Under "User variables", click "New" and set:
- Variable name:
GITHUB_TOKEN - Variable value:
your-token-here
- Variable name:
- Command Prompt:
pycargo -n data_project -s data-science -g --github-repo-name data_project_repoThis creates a data_project directory, sets up a data-science environment, initializes a Git repository, and creates a linked GitHub repository named data_project_repo.
This project is licensed under the MIT License. See the LICENSE file for details.
