Skip to content

Commit 8bf7d8f

Browse files
author
Jordan Mance
committed
Improving comments
1 parent 5642da4 commit 8bf7d8f

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Demonstration & Walkthrough of how to use this library: https://github.com/mance
1010
## Using figgy.lib
1111

1212
This library greatly simplifies the process of fetching / using configurations from ParameterStore. It is designed
13-
to be used alongside the larger figgy ecosystem and will help you. For more details on why Figgy offers check out
13+
to be used alongside the larger figgy ecosystem and will help you. For more details on what Figgy offers check out
1414
the [Figgy Website.](https://www.figgy.dev)
1515

1616

1717
To the this lib to import parameters from parameter store:
1818

1919
### Define your configurations
20-
20+
[What's a Fig?](https://www.figgy.dev/docs/getting-started/concepts.html)
2121
```python
2222

2323
# config.py
@@ -75,8 +75,8 @@ print(f"Found Merged SQL Connection String: {FIGS.SQL_CONNECTION_STRING}")
7575

7676
```
7777

78-
If you run your APP and receive an error indicating a paramter is missing, run `figgy config sync --config figgy.json` where
79-
the `figgy.json`
78+
If you run your APP and receive an error indicating a parameter is missing, run `figgy config sync --config figgy.json` where
79+
the `figgy.json` is the path to the generated `figgy.json` file.
8080

8181
### Override with ENV variables
8282
Any and all configurations can be overridden locally through ENV variables.

src/figgy/figs.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def __str__(self):
9191

9292

9393
class AppFig(Fig):
94+
"""
95+
Represents a single configuration that is specific to your application.
96+
"""
9497
default: Optional[str] = None
9598

9699
def __init__(self, name: str, default: Optional[str] = None):
@@ -99,6 +102,10 @@ def __init__(self, name: str, default: Optional[str] = None):
99102

100103

101104
class ReplicatedFig(Fig):
105+
"""
106+
Defines a parameter that is a global, shared, configuration that you want our application to have
107+
access to in its FigStore.
108+
"""
102109
source: str
103110

104111
def __init__(self, name: str, source: str):
@@ -107,11 +114,20 @@ def __init__(self, name: str, source: str):
107114

108115

109116
class SharedFig(Fig):
117+
"""
118+
Defines a parameter owned by an outside party that must be shared with your application for it to run.
119+
120+
E.G - DB Credentials, API Keys, etc.
121+
"""
110122
def __init__(self, name: str):
111123
super().__init__(name=name)
112124

113125

114126
class MergeFig(Fig):
127+
"""
128+
Creates a single parameter by combining a group of parameters into an "uber-parameter". This is ideal for
129+
building out DB Connection URLs, etc.
130+
"""
115131
pattern: List[Union[str, Fig]]
116132

117133
def __init__(self, name: str, pattern: List[Union[str, Fig]]):

src/figgy/writer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ class ConfigWriter:
1818

1919
@staticmethod
2020
def write(fig_store: FigStore, file_name: str = "figgy.json", destination_dir=""):
21+
"""
22+
Writes a figgy-compatible declarative configuration file to disk.
23+
24+
@param: fig_store - A hydrated FigStore object used by your application to fetch configurations
25+
@param: file_name - Default: `figgy.json` (recommended). The name of the file that will be written.
26+
@param: destination_dir - Default: Current Directory.. The directory to write the `figgy.json` file to.
27+
"""
2128
destination_dir = destination_dir.rstrip("/")
2229

2330
figgy_config: OrderedDict = OrderedDict()

0 commit comments

Comments
 (0)