This is the backend for the search module of BioTablero. It's build with Python.
V.0.1.0
Required Python version: 3.10+
-
[Optional], create and/or activate the virtual env for the project
[WIP] Change or add the option to use conda, in that case, include the .yml file in the repo (it might be necessary in case we need to use gdal)
-
Install dependencies
pip install -r requirements.txt
-
Create an env mirror file of env.sample and update the values of the existing variables.
STAC_URL="" # STAC server URL ENV="" # Execution Environment SECRET_KEY="" # Secret Key for Token Validation ALGORITHM="" # Encryption Algorithm ACCESS_TOKEN_EXPIRE_MINUTES="" # Number of Expiration Minutes USER_USERNAME="" # authentication user USER_HASHED_PASSWORD="" # authentication password CORS_ORIGIN="" # CORS origin values
-
Run the the development server
uvicorn app.main:app --reload
The documentation is automatically generated at /docs
and /redoc
. For production /docs
is disabled
This guide explains how to use black
for code formatting and pyright
for type checking.
If black
or pyright
is not installed, you can add them using pip
:
pip install black pyright
Alternatively, for pyright
, you can install it globally with npm
:
npm install -g pyright
To check if the code conforms to black
's style guide without making changes:
black --check .
--check
: Ensuresblack
only verifies the style and does not modify files..
: Specifies the current directory as the target. Replace.
with the specific path if needed.
If the code passes the check, you will see:
All done!
N files would be left unchanged.
If there are style issues, black
will list the files and lines that need formatting.
To automatically reformat the code to conform to black
's style guide:
black .
- Running
black
without--check
will directly modify the files in place to match the style guide.
After running, you will see:
All done!
N files reformatted, M files left unchanged.
To check your code for type errors using pyright
:
pyright
pyright
automatically scans your code for type issues.
To focus on a specific file or directory:
pyright path/to/file_or_directory
To run GitHub Actions workflows locally, you can use the act
tool. This allows you to test your workflows without pushing changes to GitHub.
If you prefer using Scoop on Windows:
- Open PowerShell.
- Install Scoop by running:
iwr -useb get.scoop.sh | iex
- Close and reopen your terminal.
- Verify Scoop installation:
scoop --version
- Install
act
:scoop install act
- Verify installation:
act --version
- Install Homebrew if not already installed. See the Homebrew installation guide.
- Install
act
:brew install act
- Verify installation:
act --version
- Verify installation:
act --version
- Navigate to your repository's root directory where the
.github/workflows
folder is located. - Run
act
to execute the default workflow in terminal:When running GitHub Actions workflows locally withact
act
, you will be given the option to choose from several images. It is recommended to use the Medium image for most cases.
-
Large Image (Large):
- Size: 17GB download, 53.1GB storage.
- Recommendation: Only if additional tools are needed, as it is heavier.
-
Medium Image (Medium) (Recommended):
- Size: 500MB.
- Description: Contains the basic tools needed for most actions.
- Recommendation: Ideal for most workflows.
-
Micro Image (Micro):
- Size: Less than 200MB.
- Description: Contains only NodeJS and does not work with all actions.
- Recommendation: Only for very lightweight workflows.
- To specify a specific event, use:
Replace
act <event>
<event>
with events likepush
,pull_request
, etc.
To simulate a push
event:
act push
[WIP]
Línea de Desarrollo - Gerencia de Información Científica - Dirección de conocimiento - Instituto de Investigación de Recursos Biológicos Alexander von Humboldt - Colombia
See also the list of contributors who participated in this project.
This project is licensed under the MIT License.