https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-service
- Prepare project and dockerfile
- Prepare requirements.txt
from datatable import fread | |
import pandas as pd | |
excel_path = "my_excel_file.xlsx" | |
df = fread(excel_path+"/sheet_name").to_pandas() |
--- | |
output: | |
html_fragment: | |
self_contained: false | |
always_allow_html: true | |
--- | |
```{=html} | |
<!DOCTYPE html> | |
``` |
ui <- fluidPage( | |
tags$head( | |
#Using ionRangeSlider's javascript options you can hide/show selector labels and min/max labels | |
HTML(" | |
<script> | |
$(document).ready(function(){ | |
$(\".js-range-slider\").ionRangeSlider({ | |
hide_min_max: false, | |
hide_from_to: true |
import pandas as pd | |
def pd_reorder_cols(df, d): | |
""" | |
Reorders the position of columns with the given specs dictionary. | |
""" | |
cl = list(df.columns) | |
for k1, v1 in d.items(): | |
k1_ix = cl.index(k1) | |
cl.pop(k1_ix) |
## Skip failing installations on requirements.txt | |
## https://stackoverflow.com/a/54053100/3608936 | |
cat requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 pip install | |
### Jupyter Notebook not working | |
## https://stackoverflow.com/a/59571314/3608936 | |
python3 -m notebook |
####### | |
### This is a minimal example of using HiGHS solver in R with the help of ROI and ompr packages. | |
####### | |
## SETUP BEGIN | |
pti <- c("ompr.roi","ompr","highs","devtools") | |
pti <- pti[!(pti %in% installed.packages())] | |
if(length(pti) > 0){ | |
install.packages(pti) | |
} |
### This gist gives you the code snippet to reach upper directories | |
### so you can reach other functions in the document | |
### e.g. from mainfolder.subfolder.subfolder.examplefile import example_function | |
#### Include upper dirs start | |
dpath = os.path.dirname(os.path.abspath(__file__)) | |
for i in range(4): | |
dpath = os.path.dirname(dpath) | |
sys.path.insert(1, dpath) | |
#### Include upper dirs end |
## Önce aşağıdakiler linklerinden programlar indirilerek kurulmalı | |
# R https://cran.r-project.org/ | |
# RStudio Desktop https://www.rstudio.com/products/rstudio/download/ | |
# Pandoc https://pandoc.org/installing.html | |
# LaTeX https://www.latex-project.org/get/ | |
# Kurulması gereken paket listesi | |
# Bütün kodu kopyala yapıştır ile R'a koyun Hata alınan paketler olursa bazı başka kütüphanelerin yüklenmesi gerekebilir (ör. openssl) | |
pti <- c("devtools","tidyverse","shiny","shinydashboard","readxl","writexl","lubridate","reticulate","stringr","openxlsx","ggiraph","rhandsontable","shinycssloaders","rmarkdown","DBI","RMySQL","shinyjs","promises","future","ggmap","rlist","anytime","xml2","jsonlite","data.table") | |
pti<-pti[!(pti %in% installed.packages())] |
https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-service
pip install --editable /path/to/package
You need to include a minimal setup.py
from setuptools import setup, find_packages
setup(