Skip to content

Commit f1cca74

Browse files
avara1986ylcumberbirchalexppg
authored
Check english in docs (#128)
* Check english in docs * fix typo Co-authored-by: Yazmin Cumberbirch <yl.cumberbirch@gmail.com> Co-authored-by: Àlex Pérez <alexperezpujol@disroot.org>
1 parent 983847e commit f1cca74

File tree

11 files changed

+88
-90
lines changed

11 files changed

+88
-90
lines changed

docs/command_line.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Commnand line
22

3-
PyMS has some command to make easy your developments:
3+
PyMS comes with some commands to make your developments easier:
44

55
```bash
66
pyms -h
77
```
8-
Show you a list of options and help instructions to use this command like:
8+
Lists the options and help instructions to use this command:
99

1010
```bash
1111
usage: main.py [-h] [-v VERBOSE]
@@ -37,11 +37,11 @@ Command:
3737
pyms startproject
3838
```
3939

40-
This command create a project template like [Microservices Scaffold](https://github.com/python-microservices/microservices-scaffold).
41-
This command use [cookiecutter](https://github.com/cookiecutter/cookiecutter) to download and install this [template](https://github.com/python-microservices/microservices-template)
40+
This command creates a project template like the one defined in [Microservices Scaffold](https://github.com/python-microservices/microservices-scaffold).
41+
This command uses [cookiecutter](https://github.com/cookiecutter/cookiecutter) to download and install this [template](https://github.com/python-microservices/microservices-template)
4242

4343
!!! warning
44-
You must run first `pip install cookiecutter==1.7.0`
44+
First, you must run `pip install cookiecutter==1.7.0`
4545

4646
## Create a key encrypt/decrypt file
4747

docs/configuration.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
## Environments variables of PyMS:
44

5-
**CONFIGMAP_FILE**: The path to the configuration file. By default, PyMS search the configuration file in your
6-
actual folder with the name "config.yml"
7-
**KEY_FILE**: The path to the key file to decrypt your configuration. By default, PyMS search the configuration file in your
8-
actual folder with the name "key.key"
5+
**CONFIGMAP_FILE**: The path to the configuration file. By default, PyMS searches for the configuration file in your
6+
current folder with the name "config.yml"
7+
**KEY_FILE**: The path to the key file to decrypt your configuration. By default, PyMS searches for the configuration file in your
8+
current folder with the name "key.key"
99

1010
## Create configuration
11-
Each microservice needs a config file in yaml or json format to work with it. This configuration contains
12-
the Flask settings of your project and the [Services](services.md). With this way to create configuration files, we
11+
Each microservice needs a config file in yaml or json format for it to work with. This configuration contains
12+
the Flask settings of your project and the [Services](services.md). With this way of creating configuration files, we
1313
solve two problems of the [12 Factor apps](https://12factor.net/):
1414

1515
- Store config out of the code
16-
- Dev/prod parity: the configuration could be injected and not depends of our code, for example, Kubernetes configmaps
16+
- Dev/prod parity: the configuration could be injected and doesn't depend on our code, for example, Kubernetes configmaps
1717

18-
a simple configuration file could be a config.yaml:
18+
A simple configuration file could be a config.yaml:
1919

2020
```yaml
2121
pyms:
@@ -60,32 +60,32 @@ or in a config.json:
6060
}
6161
```
6262

63-
This file could contains this keywords:
63+
This file can contain the following keywords:
6464

6565
## pyms - services block
6666

6767
```pyms```: all subsets inside this keyword are the settings of this library. Each keyword will be a service of our
68-
[Microservice class](ms_class.md). For example, we declare our microservice class as:
68+
[Microservice class](ms_class.md). For example, if we declare our microservice class as:
6969

7070
```python
7171
from pyms.flask.app import Microservice
7272
ms = Microservice(path=__file__)
7373
```
74-
and a `config.yaml` file:
74+
and have a `config.yaml` file such as:
7575

7676
```yaml
7777
pyms:
7878
services:
7979
requests: true
8080
```
8181
82-
our object `ms` has an attribute `requests` that is a instance of our service [requests](services.md).
82+
our `ms` object will have an attribute `requests` that is a instance of our service [requests](services.md).
8383

8484
## pyms - config block
85-
This part contains all keywords of a [Flask Configuration Handling](http://flask.pocoo.org/docs/1.0/config/) and our
86-
constants of the enviroments (local configuration, staging configuration...). Keep in mind that a Flask configuration needs
87-
the keywords to be declared as uppercase. If you defined a variable like `app_name`, you will get this with
88-
`current_app.config["APP_NAME"]`
85+
This section contains all keywords used for general [Flask Configuration Handling](http://flask.pocoo.org/docs/1.0/config/), along
86+
with our constants for the different enviroments (local configuration, staging configuration...). Keep in mind that
87+
a Flask app configuration needs the keywords to be declared as uppercase. If you defined a variable like `app_name`,
88+
you will be able to retrieve it with `current_app.config["APP_NAME"]`
8989

9090

9191
## Import Configuration
@@ -98,7 +98,7 @@ def my_endpoint():
9898
print(current_app.config["DEBUG"])
9999
```
100100

101-
But, what happend if you need the configuration BEFORE Flask class is instanced? Imagine this case:
101+
But, what happens if you need to access the configuration BEFORE Flask class is instanced? Imagine this case:
102102

103103
```python
104104
from flask import Blueprint, current_app
@@ -115,7 +115,7 @@ API = Api(
115115
)
116116
```
117117

118-
This raise a `'working outside of application context` error. Who can solve this problem?
118+
This raises a `'working outside of application context` error. Who can solve this problem?
119119

120120
```python
121121
from flask import Blueprint, current_app
@@ -135,10 +135,10 @@ API = Api(
135135

136136

137137
## Looking for Configuration file with Kubernetes Configmaps
138-
By default, Microservice class search a config.yml in the same path. You can set a different route or set a json file.
139-
To change this path, define a environment variable `CONFIGMAP_FILE`.
138+
By default, the Microservice class searches for a config.yml in the same path. You can set a different route or set a json file.
139+
To change this path, you must define an environment variable called `CONFIGMAP_FILE`.
140140

141-
This way of looking for the configuration is useful when you work with Docker and Kubernetes. For example, you can integrate
141+
This way of looking for the configuration is useful when you work with Docker and Kubernetes. For example, you could integrate
142142
a configmap of Kubernetes, with this microservice and a deployment with:
143143

144144
```yaml
@@ -166,4 +166,4 @@ spec:
166166
name: my-microservice-configmap
167167
```
168168

169-
See [Routing](routing.md) and [Examples](examples.md) to continue with this tutorial
169+
See [Routing](routing.md) and [Examples](examples.md) to continue with this tutorial

docs/encrypt_decryt_configuration.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
When you work in multiple environments: local, dev, testing, production... you must set critical configuration in your
9-
variables, like:
9+
variables, such as:
1010

1111
config.yml, for local propose:
1212
```yaml
@@ -32,8 +32,8 @@ pyms:
3232
3333
You can move this file to a [Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/),
3434
use [Vault](https://learn.hashicorp.com/vault) or encrypt the configuration with [AWS KMS](https://aws.amazon.com/en/kms/)
35-
or [Google KMS](https://cloud.google.com/kms). We strongly recommended this ways to encrypt/decrypt your configuration,
36-
but if you want a no vendor locking option or you haven`t the resources to use this methods, we create a way to encrypt
35+
or [Google KMS](https://cloud.google.com/kms). We strongly recommend these way of encrypting/decrypting your configuration,
36+
but if you don't want a vendor locking option or you don't have the resources to use these methods, we provide a way to encrypt
3737
and decrypt your variables.
3838
3939
## 1. Generate a key
@@ -47,20 +47,20 @@ pyms create-key
4747
Then, type a password and it will create a file called `key.key`. This file contains a unique key. If you loose this file
4848
and re-run the create command, the key hash will be different and your code encrypted with this key won't be able to be decrypted.
4949

50-
Store the key in a secure site, and NOT COMMIT this key to your repository.
50+
Store this key in a secure site, and DO NOT COMMIT it to your repository.
5151

5252

5353
## 2. Add your key to your environment
5454

55-
Move, for example, your key to `mv key.key /home/my_user/keys/myproject.key`
55+
Move your key, for example, to `mv key.key /home/my_user/keys/myproject.key`
5656

57-
then, store this key in a environment variable with:
57+
then, store the key in a environment variable with:
5858

5959
```bash
6060
export KEY_FILE=/home/my_user/keys/myproject.key
6161
```
6262

63-
## 3. Encrypt your information and put in config
63+
## 3. Encrypt your information and store it in config
6464

6565
Do you remember the example file `config_pro.yml`? Now you can encrypt and decrypt the information, you can run the command
6666
`pyms encrypt [string]` to generate a crypt string, for example:
@@ -70,7 +70,7 @@ pyms encrypt 'mysql+mysqlconnector://important_user:****@localhost/my_schema'
7070
>> Encrypted OK: b'gAAAAABeSwBJv43hnGAWZOY50QjBX6uGLxUb3Q6fcUhMxKspIVIco8qwwZvxRg930uRlsd47isroXzkdRRnb4-x2dsQMp0dln8Pm2ySHH7TryLbQYEFbSh8RQK7zor-hX6gB-JY3uQD3IMtiVKx9AF95D6U4ydT-OA=='
7171
```
7272

73-
And put this string in your `config_pro.yml`:
73+
And store this string in your `config_pro.yml`:
7474
```yaml
7575
pyms:
7676
crypt:
@@ -88,9 +88,9 @@ can find the answer
8888

8989
## 4. Decrypt from your config file
9090

91-
Pyms knows if a variable is encrypted if this var start with the prefix `enc_` or `ENC_`. PyMS searchs for your key file
92-
in the `KEY_FILE` env variable and decrypt this value and store it in the same variable without the `enc_` prefix,
93-
por example,
91+
Pyms knows if a variable is encrypted if this var start with the prefix `enc_` or `ENC_`. PyMS searches for your key file
92+
in the `KEY_FILE` env variable and decrypts this value to store it in the same variable without the `enc_` prefix,
93+
for example,
9494

9595
```yaml
9696
ENC_SQLALCHEMY_DATABASE_URI: gAAAAABeSwBJv43hnGAWZOY50QjBX6uGLxUb3Q6fcUhMxKspIVIco8qwwZvxRg930uRlsd47isroXzkdRRnb4-x2dsQMp0dln8Pm2ySHH7TryLbQYEFbSh8RQK7zor-hX6gB-JY3uQD3IMtiVKx9AF95D6U4ydT-OA==
@@ -102,7 +102,7 @@ Will be stored as
102102
SQLALCHEMY_DATABASE_URI: mysql+mysqlconnector://user_of_db:user_of_db@localhost/my_schema
103103
```
104104

105-
And you can access to this var with `current_app.config["SQLALCHEMY_DATABASE_URI"]`
105+
And you can access this var with `current_app.config["SQLALCHEMY_DATABASE_URI"]`
106106

107107
# Method 2: Encrypt and decrypt with AWS KMS
108108

@@ -143,5 +143,3 @@ pyms:
143143
ENC_SQLALCHEMY_DATABASE_URI: "AQICAHiALhLQv4eW8jqUccFSnkyDkBAWLAm97Lr2qmdItkUCIAF+P4u/uqzu8KRT74PsnQXhAAAAoDCBnQYJKoZIhvcNAQcGoIGPMIGMAgEAMIGGBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDPo+k3ZxoI9XVKtHgQIBEIBZmp7UUVjNWd6qKrLVK8oBNczY0CfLH6iAZE3UK5Ofs4+nZFi0PL3SEW8M15VgTpQoC/b0YxDPHjF0V6NHUJcWirSAqKkP5Sz5eSTk91FTuiwDpvYQ2q9aY6w=
144144
"
145145
```
146-
147-

docs/examples.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Open in your browser http://localhost:5000/
4242

4343
## Example 2: Create your Microservice class
4444

45-
Create a class that inherit from `pyms.flask.app.Microservice` and override methods with your own configuration.
45+
Create a class that inherits from `pyms.flask.app.Microservice` and overrides methods with your own configuration.
4646
The next example show how to innit a lib like [Flask Babel](https://pythonhosted.org/Flask-Babel/)
4747

4848
main.py:
@@ -63,7 +63,7 @@ app = ms.create_app()
6363

6464
## Example 2: Initialize SQLAlchemy
6565

66-
The next example show how to innit a lib like [Flask SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com/en/2.x/)
66+
The next example shows us how to innit a lib like [Flask SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com/en/2.x/)
6767

6868
config.yml:
6969

@@ -99,7 +99,7 @@ app = ms.create_app()
9999

100100
## Example 3: Create your logger
101101

102-
The next example show how to create a personal logger for your application
102+
The next example shows us how to create a personal logger for your application
103103

104104
```python
105105
import logging.config
@@ -146,4 +146,4 @@ ms = MyMicroservice(path=__file__)
146146
app = ms.create_app()
147147
```
148148

149-
See [this Github page](https://github.com/python-microservices/pyms/tree/master/examples) to see a examples
149+
See [this Github page](https://github.com/python-microservices/pyms/tree/master/examples) to see more examples

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ Get started with [Installation](installation.md) and then get an overview with t
1717

1818
## Motivation
1919

20-
When we started to create microservice with no idea, we were looking for tutorials, guides, best practices, but we found
20+
When we started to create a microservice with no previous knowledge, we started looking for tutorials, guides, best practices, but we found
2121
nothing to create professional projects. Most articles say:
2222

2323
- "Install flask"
2424
- "Create routes"
2525
- (Sometimes) "Create a swagger specs"
2626
- "TA-DA! you have a microservice"
2727

28-
But... what happens with our configuration out of code like Kubernetes configmap? what happens with transactionality?
28+
But... what happens when we want our configuration out of the code, such as a Kubernetes configmap? what happens with transactionality?
2929
If we have many microservices, what happens with traces?.
3030

31-
There are many problems around Python and microservices and we can`t find anyone to give a solution.
31+
There are many problems around Python and microservices and we couldn't find anyone to give us a solution.
3232

3333
We start creating these projects to try to solve all the problems we have found in our professional lives about
3434
microservices architecture.

docs/ms_class.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Microservices class
22

3-
The class Microservice is the core of all microservices built with PyMS.
3+
The Microservice class is the core of all microservices built with PyMS.
44

55

66
You can create a simple microservice such as:
@@ -30,9 +30,9 @@ pyms:
3030
config:
3131
APP_NAME: "Python Microservice"
3232
```
33-
Check [Configuration](configuration.md) section to know how to create a configuration file.
33+
Check the [Configuration](configuration.md) section to learn how to create a configuration file.
3434
35-
`Microservice` class search for a `config.yml` in the directory you pass in `path` parameter or search the file in
35+
The `Microservice` class searches for a `config.yml` in the directory you pass in `path` parameter or looks for the file in
3636
`CONFIGMAP_FILE` env var.
3737

3838
Each keyword in our configuration block, can be accessed in our Microservice object through the attribute `config`.
@@ -67,7 +67,7 @@ print(ms.config.multiplevars.config2)
6767

6868
## Personalize your microservices
6969

70-
Microservice class initialize the libraries and other process by this way:
70+
The Microservice class initializes libraries and other process in the following way:
7171

7272
```python
7373
...
@@ -97,4 +97,4 @@ Microservice class initialize the libraries and other process by this way:
9797
```
9898

9999

100-
Check more examples in [this Github page](https://github.com/python-microservices/pyms/tree/master/examples)
100+
Check for more examples in [this Github page](https://github.com/python-microservices/pyms/tree/master/examples)

docs/quickstart.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This page gives a good introduction to PyMS. It assumes you already have PyMS installed. If you do not, head over to the [Installation](installation.md) section.
44

5-
You need to create 2 files: main.py and config.yml:
5+
To start out, you need to create 2 files: main.py and config.yml:
66

77
main.py
88
```python
@@ -38,20 +38,20 @@ pyms:
3838
3939
## So what did that code do?
4040
41-
1. Create a instance of PyMS Microservice class (#1.1). This initialization inject the configuration defined in the
42-
1.3 block and could be accessed through current_app.config. Then, initialize the service defined in the 1.2 block. See [Services](services.md) for more details.
41+
1. Create a instance of PyMS Microservice class (#1.1). This initialization injects the configuration defined in the
42+
1.3 block, so it could be accessed through current_app.config. Then, it initializes the service defined in the 1.2 block. See [Services](services.md) for more details.
4343
2. Initialize [Flask](https://flask.palletsprojects.com/en/1.1.x/) instance, [Connexion](https://github.com/zalando/connexion)
4444
if it was defined in the pyms configuration block, create a tracer, add health-check blueprint, initialize libs and set the PyMS Microservice in
45-
`ms` attribute and you can access to it with `current_app.ms`. This steps has their each functions and you can easy override it.
46-
3. `create_app` return the flask instance and you can interact with it as a typical flask app
45+
`ms` attribute and you can access to it with `current_app.ms`. These steps all have their own functions and you can easy override any of them.
46+
3. `create_app` returns the flask instance and you can interact with it as a typical flask app
4747

4848
# Create a project from scaffold
4949

5050
PyMS has a command line option to create a project template like [Microservices Scaffold](https://github.com/python-microservices/microservices-scaffold).
51-
This command use [cookiecutter](https://github.com/cookiecutter/cookiecutter) to download and install this [template](https://github.com/python-microservices/microservices-template)
51+
This command uses [cookiecutter](https://github.com/cookiecutter/cookiecutter) to download and install this [template](https://github.com/python-microservices/microservices-template)
5252

5353
!!! warning
54-
You must run first `pip install cookiecutter==1.7.0`
54+
First, you must run `pip install cookiecutter==1.7.0`
5555

5656
## Installation
5757

@@ -60,7 +60,7 @@ pyms startproject
6060
`
6161
``
6262

63-
this output a lot of options step by step
63+
this outputs a lot of options step by step
6464

6565
```bash
6666
project_repo_url [https://github.com/python-microservices/microservices-scaffold]:
@@ -82,6 +82,6 @@ Select open_source_license:
8282
Choose from 1, 2, 3, 4, 5, 6 [1]:
8383
```
8484

85-
When you finish to introduce the options, a project will be created in `[project_folder]` folder
85+
When you finish introducing the options, a project will be created in `[project_folder]` folder
8686

87-
See [Configuration](configuration.md), [Routing](routing.md) and [Examples](examples.md) to continue with this tutorial
87+
See [Configuration](configuration.md), [Routing](routing.md) and [Examples](examples.md) to continue with this tutorial

docs/routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Now, you can create a `swagger.yaml` file with [OpenAPI Specification](https://s
1919

2020
# Examples of routing
2121

22-
You can see how structure a project or OpenAPI Specification in
22+
You can see how to structure a project or OpenAPI Specification in
2323
[PyMS examples](https://github.com/python-microservices/pyms/tree/master/examples/microservice_swagger) or in
2424
[Microservice Scaffold](https://github.com/python-microservices/microservices-scaffold)
2525

2626
## Routing to files
2727

28-
This section is equal from [Zalando Connexion](https://github.com/zalando/connexion#automatic-routing), because PyMS use
28+
This section is equal to [Zalando Connexion](https://github.com/zalando/connexion#automatic-routing), because PyMS uses
2929
this library to route endpoints to functions:
3030

3131
**Explicit Routing**:

0 commit comments

Comments
 (0)