pyinit
is a command-line tool designed to help developers quickly scaffold Python library projects. This tool generates essential files like README.md
, LICENSE
, setup.py
, and more, allowing developers to focus on coding without worrying about project setup.
- Automatically creates Python library project structure.
- Generates essential files such as
README.md
,LICENSE
,__init__.py
,setup.py
, andrequirements.txt
. - Supports custom templates for flexibility.
- Cross-platform: Works on Linux, macOS, and Windows.
- Command-line interface with interactive prompts and support for command-line arguments for faster project initialization.
To install pyinit
on Linux, download the latest release from the releases page and move the binary to a directory in your PATH
.
wget https://github.com/t3tra-dev/pyinit/releases/download/v1.0.0/pyinit-linux-latest-v1.0.0.zip
unzip pyinit-linux-latest-v1.0.0.zip
chmod +x pyinit
sudo mv pyinit /usr/local/bin/
Now you can run pyinit
:
pyinit --help
For macOS, download the latest release from the releases page and move the binary to your PATH
.
curl -L -O https://github.com/t3tra-dev/pyinit/releases/download/v1.0.0/pyinit-macos-latest-v1.0.0.zip
unzip pyinit-macos-latest-v1.0.0.zip
chmod +x pyinit
sudo mv pyinit /usr/local/bin/
Now you can run pyinit
:
pyinit --help
For Windows, download the latest release from the releases page and extract it:
Invoke-WebRequest -Uri https://github.com/t3tra-dev/pyinit/releases/download/v1.0.0/pyinit-windows-latest-v1.0.0.zip -OutFile pyinit.zip
Expand-Archive -Path pyinit.zip -DestinationPath .
Add the binary to your PATH
by following these steps:
- Right-click "This PC" and select "Properties."
- Click "Advanced system settings" and go to "Environment Variables."
- Under "System variables," select
Path
and click "Edit." - Click "New" and add the path where
pyinit.exe
is located. - Click "OK" to close all windows.
You can now run pyinit
from the command line:
pyinit --help
To build pyinit
from source locally, you need to have Rust installed.
- Install Rust on your system.
Clone the repository and run cargo install --path .
:
git clone https://github.com/t3tra-dev/pyinit.git
cd pyinit
cargo install --path .
Now you can run pyinit
:
pyinit --help
pyinit
can be used interactively or non-interactively by providing command-line arguments.
pyinit [OPTIONS]
--name
,-n
: Specify the name of the Python library.--description
,-d
: Provide a description for the library.--author
,-a
: Specify the author's name.--license
,-l
: Choose the license type (MIT, GPL, Apache-2.0, and more).--help
,-h
: Display help information (-h
shows summary).--version
: Print version
To create a Python library project interactively, run:
pyinit
You'll be prompted to enter the project details such as the name, description, author, and license. If you want to skip the interactive mode, you can use command-line arguments:
pyinit --name mylib --description "A Python library for awesome features" --author "John Doe" --license MIT
This will generate the following directory structure:
mylib/
├── LICENSE
├── README.md
├── mylib/
│ └── __init__.py
├── requirements.txt
├── setup.py
└── tests/
When selecting custom
as the license type, you'll be prompted to enter custom license text or leave it blank. Otherwise, the selected license will automatically populate the LICENSE
file.
We welcome contributions! Please follow these steps to contribute:
- Fork the repository: https://github.com/t3tra-dev/pyinit.
- Create a feature branch:
git checkout -b feature/your-feature
. - Commit your changes:
git commit -m 'Add a new feature'
. - Push to the branch:
git push origin feature/your-feature
. - Open a Pull Request.
For any questions or support, feel free to open an issue in the repository's Issues section.
thanks for all contributors!
pyinit
is licensed under the MIT License. See the LICENSE file for more details.