Without installing pkg-config
before attempting to install mysqlclient
on Ubuntu 22 fails and subsequently breaks apt-pkg
.
To install it without issues, run the following commands:
sudo apt install pkg-config
pip install mysqlclient
Here we want to scrape product name, price and rating from ebay product pages:
url = 'https://www.ebay.com/itm/Sony-PlayStation-4-PS4-Pro-1TB-4K-Console-Black/203084236670'
wanted_list = ['Sony PlayStation 4 PS4 Pro 1TB 4K Console - Black', 'US $349.99', '4.8']
scraper.build(url, wanted_list)
When running FastAPI
app, all the logs in console are from Uvicorn
and they do not have timestamp and other useful information. As Uvicorn
applies python logging
module, we can override Uvicorn
logging formatter by applying a new logging configuration.
Meanwhile, it's able to unify the your endpoints logging with the Uvicorn
logging by configuring all of them in the config file log_conf.yaml
.
Before overriding:
uvicorn main:app --reload
SELECT dependent_ns.nspname as dependent_schema
, dependent_view.relname as dependent_view
, source_ns.nspname as source_schema
, source_table.relname as source_table
, pg_attribute.attname as column_name
FROM pg_depend
JOIN pg_rewrite ON pg_depend.objid = pg_rewrite.oid
import javax.crypto.Cipher; | |
import javax.crypto.CipherInputStream; | |
import javax.crypto.NoSuchPaddingException; | |
import javax.crypto.SecretKey; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.io.ByteArrayInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.nio.file.Files; |