-
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.
Add an option to set
apikey
via commandline argument
Add samples, and update runbook
- Loading branch information
1 parent
7b1ea5e
commit 9046ff0
Showing
16 changed files
with
108 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ doc_gen/_* | |
|
||
temp.py | ||
|
||
# work in progress | ||
samples/ | ||
logging.ini | ||
*.log | ||
|
||
!samples/* |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
This file was deleted.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
click==8.1.7 | ||
fastapi==0.112.0 | ||
psutil==6.0.0 | ||
pydantic==2.8.2 | ||
|
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,4 @@ | ||
NINJA_HOST="0.0.0.0" | ||
NINJA_PORT=8005 | ||
APIKEY="MySecreatAccessToken" | ||
WORKERS=3 |
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,31 @@ | ||
## Sample Environment Variables | ||
|
||
Environment variables can be sourced using any `plaintext` / `JSON` / `YAML` file. | ||
The filepath should be provided as an argument during object instantiation. | ||
|
||
⚠️ Sample values are randomly generated strings from https://pinetools.com/random-string-generator | ||
|
||
> By default, `PyNinja` will look for a `.env` file in the current working directory. | ||
### Examples | ||
|
||
- PlainText: [.env] | ||
- JSON: [secrets.json] | ||
- YAML: [secrets.yaml] | ||
|
||
[.env]: .env | ||
[secrets.json]: secrets.json | ||
[secrets.yaml]: secrets.yaml | ||
|
||
### Usage | ||
|
||
- **CLI** | ||
```shell | ||
pyninja --env "/path/to/env/file" start | ||
``` | ||
|
||
- **IDE** | ||
```python | ||
import pyninja | ||
pyninja.start(env_file='/path/to/env/file') | ||
``` |
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,27 @@ | ||
[loggers] | ||
keys=root | ||
|
||
[handlers] | ||
keys=logfile,logconsole | ||
|
||
[formatters] | ||
keys=logformatter | ||
|
||
[logger_root] | ||
level=INFO | ||
handlers=logfile, logconsole | ||
|
||
[formatter_logformatter] | ||
format=[%(asctime)s.%(msecs)03d] %(levelname)s [%(thread)d] - %(message)s | ||
|
||
[handler_logfile] | ||
class=handlers.RotatingFileHandler | ||
level=INFO | ||
args=('logfile.log','a') | ||
formatter=logformatter | ||
|
||
[handler_logconsole] | ||
class=handlers.logging.StreamHandler | ||
level=INFO | ||
args=() | ||
formatter=logformatter |
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,6 @@ | ||
{ | ||
"NINJA_HOST": "0.0.0.0", | ||
"NINJA_PORT": 8005, | ||
"APIKEY": "MySecreatAccessToken", | ||
"WORKERS": 3 | ||
} |
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,4 @@ | ||
APIKEY: MySecreatAccessToken | ||
NINJA_HOST: 0.0.0.0 | ||
NINJA_PORT: 8005 | ||
WORKERS: 3 |