-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from jozu-ai/docs-updates-for-kitops
Update the pykitops docs to better fit the KitOps format
- Loading branch information
Showing
7 changed files
with
65 additions
and
87 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,64 +1,70 @@ | ||
# How-to Guides | ||
|
||
This part of the project documentation focuses on a **problem-oriented** approach. You'll tackle common tasks that you might have, with the help of the code provided in this project. | ||
|
||
## How To Create A Kitfile Object? | ||
|
||
Whether you're working with an existing ModelKit's Kitfile, | ||
Whether you're working with an existing ModelKit's Kitfile, | ||
or starting from nothing, the `kitops` package can help you | ||
get this done. | ||
|
||
Install the `kitops` package from PYPI into your project's environment | ||
Install the `kitops` package from PYPI into your project's environment | ||
with the following command | ||
|
||
``` | ||
```sh | ||
pip install kitops | ||
``` | ||
|
||
Inside of your code you can now import the `Kitfile` | ||
class from the `kitops.modelkit.kitfile` module: | ||
|
||
# your code | ||
from kitops.modelkit.kitfile import Kitfile | ||
```python | ||
from kitops.modelkit.kitfile import Kitfile | ||
``` | ||
|
||
After you've imported the class, you can use it | ||
to create a Kitfile object from an existing ModelKit's Kitfile: | ||
|
||
# your code | ||
from kitops.modelkit.kitfile import Kitfile | ||
```python | ||
from kitops.modelkit.kitfile import Kitfile | ||
|
||
my_kitfile = Kitfile(path='/path/to/Kitfile') | ||
print(my_kitfile.to_yaml()) | ||
|
||
# The output should match the contents of the Kitfile | ||
# located at: /path/to/Kitfile | ||
my_kitfile = Kitfile(path='/path/to/Kitfile') | ||
print(my_kitfile.to_yaml()) | ||
|
||
# The output should match the contents of the Kitfile | ||
# located at: /path/to/Kitfile | ||
``` | ||
|
||
You can also create an empty Kitfile from scratch: | ||
|
||
# your code | ||
from kitops.modelkit.kitfile import Kitfile | ||
```python | ||
from kitops.modelkit.kitfile import Kitfile | ||
|
||
my_kitfile = Kitfile() | ||
print(my_kitfile.to_yaml()) | ||
my_kitfile = Kitfile() | ||
print(my_kitfile.to_yaml()) | ||
|
||
# OUTPUT: {} | ||
# OUTPUT: {} | ||
``` | ||
|
||
Regardless of how you created the Kitfile, you can update its contents | ||
Regardless of how you created the Kitfile, you can update its contents | ||
like you would do with any other python dictionary: | ||
|
||
# your code | ||
my_kitfile.manifestVersion = "3.0" | ||
my_kitfile.package = { | ||
"name": "Another-Package", | ||
"version": "3.0.0", | ||
"description": "Another description", | ||
"authors": ["Someone"] | ||
} | ||
print(my_kitfile.to_yaml()) | ||
|
||
# OUTPUT: | ||
# manifestVersion: '3.0' | ||
# package: | ||
# name: Another-Package | ||
# version: 3.0.0 | ||
# description: Another description | ||
# authors: | ||
# - Someone | ||
```python | ||
my_kitfile.manifestVersion = "3.0" | ||
my_kitfile.package = { | ||
"name": "Another-Package", | ||
"version": "3.0.0", | ||
"description": "Another description", | ||
"authors": ["Someone"] | ||
} | ||
print(my_kitfile.to_yaml()) | ||
|
||
# OUTPUT: | ||
# manifestVersion: '3.0' | ||
# package: | ||
# name: Another-Package | ||
# version: 3.0.0 | ||
# description: Another description | ||
# authors: | ||
# - Someone | ||
``` |
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
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# `Kitfile` class | ||
## `Kitfile` class | ||
|
||
You can import the `Kitfile` class from `kitops.modelkit.kitfile`: | ||
|
||
```python | ||
from kitops.modelkit.kitfile import Kitfile | ||
``` | ||
|
||
::: kitops.modelkit.kitfile.Kitfile |
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# `ModelKitManager` class | ||
## `ModelKitManager` class | ||
|
||
You can import the `ModelKitManager` class from `kitops.modelkit.manager`: | ||
|
||
```python | ||
from kitops.modelkit.manager import ModelKitManager | ||
``` | ||
|
||
::: kitops.modelkit.manager.ModelKitManager |
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# `ModelKitReference` class | ||
## `ModelKitReference` class | ||
|
||
You can import the `ModelKitReference` class from `kitops.modelkit.reference`: | ||
|
||
```python | ||
from kitops.modelkit.reference import ModelKitReference | ||
``` | ||
|
||
::: kitops.modelkit.reference.ModelKitReference |
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# `UserCredentials` class | ||
## `UserCredentials` class | ||
|
||
You can import the `UserCredentials` class from `kitops.modelkit.user`: | ||
|
||
```python | ||
from kitops.modelkit.user import UserCredentials | ||
``` | ||
|
||
::: kitops.modelkit.user.UserCredentials |