forked from MSDLLCpapers/py-pkglite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed cc45366 with MkDocs version: 1.6.1
- Loading branch information
0 parents
commit 6cf4fa5
Showing
67 changed files
with
15,105 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!-- `.md` and `.py` files are generated from the `.qmd` file. Please edit that file. --> | ||
|
||
--- | ||
title: "Get started" | ||
format: gfm | ||
eval: false | ||
--- | ||
|
||
!!! tip | ||
|
||
To run the code from this article as a Python script: | ||
|
||
```bash | ||
python3 examples/get-started.py | ||
``` | ||
|
||
Let's walk through a typical pkglite for Python workflow. | ||
|
||
## Import pkglite | ||
|
||
```{python} | ||
import pkglite | ||
``` | ||
|
||
## Python API | ||
|
||
Single directory: | ||
|
||
```python | ||
from pkglite import use_pkglite, pack, unpack | ||
|
||
dirs = ["path/to/pkg"] | ||
txt = "path/to/pkg.txt" | ||
use_pkglite(dirs) | ||
pack(dirs, output_file=txt) | ||
unpack(txt, output_dir="path/to/output") | ||
``` | ||
|
||
Multiple directories: | ||
|
||
```python | ||
from pkglite import use_pkglite, pack, unpack | ||
|
||
dirs = ["path/to/pkg1", "path/to/pkg2"] | ||
txt = "path/to/pkgs.txt" | ||
use_pkglite(dirs) | ||
pack(dirs, output_file=txt) | ||
unpack(txt, output_dir="path/to/output") | ||
``` | ||
|
||
## Command line interface | ||
|
||
Single directory: | ||
|
||
```bash | ||
# Create a .pkgliteignore file to exclude files from packing | ||
pkglite use path/to/pkg | ||
|
||
# Pack a single directory into a text file | ||
pkglite pack path/to/pkg -o path/to/pkg.txt | ||
|
||
# Unpack the text file into a directory | ||
pkglite unpack path/to/pkg.txt -o path/to/output | ||
``` | ||
|
||
Multiple directories: | ||
|
||
```bash | ||
# Create a .pkgliteignore file to exclude files from packing | ||
pkglite use path/to/pkg1 path/to/pkg2 | ||
|
||
# Pack multiple directories into a text file | ||
pkglite pack path/to/pkg1 path/to/pkg2 -o path/to/pkgs.txt | ||
|
||
# Unpack the text file into multiple directories under `output/` | ||
pkglite unpack path/to/pkgs.txt -o path/to/output | ||
``` | ||
|
||
Run `pkglite --help`, `pkglite use --help`, `pkglite pack --help`, | ||
or `pkglite unpack --help` for more information about the available | ||
subcommands and options. |
Oops, something went wrong.