format the README.md

This commit is contained in:
LC mac
2026-01-07 23:14:05 +08:00
parent a9af9d33af
commit 28f01a613a

View File

@@ -1,10 +1,3 @@
Heres an **extended README.md** that combines your original usage instructions with the **Makefile workflow** for clarity and ease of onboarding:
***
## ✅ Extended `README.md`
````markdown
# hdwalletpy Setup & Usage Guide
This project provides a Python-based HD Wallet tool with optional Docker-based build automation for fast, reproducible environments.
@@ -16,24 +9,27 @@ This project provides a Python-based HD Wallet tool with optional Docker-based b
### **Option 1: Standard Python Setup (Host Machine)**
1. Clone the repository:
```bash
git clone https://github.com/<your-username>/hdwalletpy.git
cd hdwalletpy
````
```
2. Create a virtual environment:
```bash
python -m venv .venv
source .venv/bin/activate
```
2. Create a virtual environment:
3. Install dependencies:
```bash
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
```
```bash
python -m venv .venv
source .venv/bin/activate
```
***
3. Install dependencies:
```bash
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
```
---
### **Option 2: Fast Setup Using Docker + Makefile**
@@ -67,19 +63,19 @@ Installs dependencies from `wheelhouse` (no compilation needed).
#### **Optional: Work Inside a Warm Container**
```bash
make up # Start container
make shell # Open shell inside container
make venv-container # Create container-only venv at /opt/venv
make up # Start container
make shell # Open shell inside container
make venv-container # Create container-only venv at /opt/venv
```
#### **Cleanup**
```bash
make clean # Remove host venv and wheelhouse
make down # Stop/remove container
make clean # Remove host venv and wheelhouse
make down # Stop/remove container
```
***
---
## ✅ Basic Usage
@@ -110,14 +106,14 @@ python ./src/pyhdwallet.py fetchkey "https://example.com/key.asc" --out mykey.as
python ./src/pyhdwallet.py test
```
***
---
## 🔐 Notes on `--file`, AES ZIP, and PGP
* `--file` writes **only** an AES-encrypted ZIP (no raw `.json`/`.asc` left on disk), using `pyzipper`.
* If `--pgp-pubkey-file` is set, the ZIP contains a single ASCII-armored PGP message (`.asc`) created with PGPy-style `PGPMessage.new(...)` then `pubkey.encrypt(...)`.
- `--file` writes **only** an AES-encrypted ZIP (no raw `.json`/`.asc` left on disk), using `pyzipper`.
- If `--pgp-pubkey-file` is set, the ZIP contains a single ASCII-armored PGP message (`.asc`) created with PGPy-style `PGPMessage.new(...)` then `pubkey.encrypt(...)`.
***
---
## ⚠️ About `--force`
@@ -130,16 +126,16 @@ python ./src/pyhdwallet.py gen > out.txt # likely refused (non-TTY)
python ./src/pyhdwallet.py gen --force > out.txt # allowed
```
***
---
## ✅ Why Use Makefile?
* **Speed:** Avoid repeated `apt-get` installs; wheels cached locally.
* **Reproducibility:** Same Docker image for builds; no environment drift.
* **Convenience:** One-liner tasks (`make wheels`, `make venv-host`, `make shell`).
* **Separation:** Host venv vs container venv for clean workflows.
- **Speed:** Avoid repeated `apt-get` installs; wheels cached locally.
- **Reproducibility:** Same Docker image for builds; no environment drift.
- **Convenience:** One-liner tasks (`make wheels`, `make venv-host`, `make shell`).
- **Separation:** Host venv vs container venv for clean workflows.
***
---
## Common Makefile Targets
@@ -153,22 +149,3 @@ make venv-container # Container venv at /opt/venv
make down # Stop/remove container
make clean # Remove .venv_host and wheelhouse
```
***
## License
Add your license info here.
```
---
✅ This README now **integrates your original usage instructions** with the **Makefile workflow**, so new users can choose between a standard Python setup or the optimized Docker-based approach.
---
👉 Do you want me to **also include the Makefile and Dockerfile snippets directly in the README** (so users dont need to open separate files), or keep them as separate files for clarity?
Or should I prepare a **GitHub-ready ZIP** with `README.md`, `Makefile`, `Dockerfile`, and `.gitignore` for you?
```