Publish public or private python libraries - using the modern python stack
Clean Code:
- ✔️ poetry for dependency management
- ✔️ pre-commit hooks for code formatting, linting, and testing
- ✔️ unittest for testing
- ✔️ gitleaks for secrets scanning
Deployment:
- ✔️ github actions for CI/CD
- ✔️ docker for building containers
- ✔️ twine for publishing to pypi or private repositories
- 🔲 gcloud for publishing to private repositories
There are two ways to install:
It is best to install as a template using gh
pip install quantready
# Create a new repo
quantready create <your-repo> --template quantready/quantready-base
To install and configure yourself using gh
gh template copy quantready/quantready-base <your-repo>
pip install typer
python configure.py
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
poetry install
# Install pre-commit hooks
pre-commit install --install-hooks
# Create a .env file and modify it's contents
cp .env.example .env
The best way is to use quantready cli
# Configure the project and cloud providers
quantready configure
This will create a .quantready file in the root of the project.
Github actions are configured to run on push to main. It will read the config from .quantready file and publish the library to pypi or private repository as well as build the docker image and push it to docker hub or gcr.
# Build the image
docker build -t quantready/quantready-base .
# Run the image
docker run -it --rm quantready/quantready-base
# Push the image to docker hub
docker push quantready/quantready-base
# Push the image to gcr
docker tag quantready/quantready-base gcr.io/<your-project>/quantready-base
# Build the package
poetry build
poetry run twine upload dist/*
Get PYPI_API_TOKEN
from https://pypi.org/manage/account/token/
And set it as a github secret https://github.com///settings/secrets/actions
# Build the package
poetry build
poetry run twine upload --repository-url https://pypi.yourdomain.com dist/*
This project is licensed under the terms of the MIT license.
- quantready
- CLI for creating and configuring projects and using the quantready-* templates
- quantready-base
- This template - build and publish python libraries and docker images
- quantready-api - A template to build and deploy fastapi applications
- authentication - api key or oauth
- authorization - RBAC via OSO
- rate limiting - via redis
- job-queues to support long-running tasks
- workers
- caching
- github actions to deploy to gcloud
- all other features of quantready-base
- quantready-vendor - A template to sell and meter access to your APIs. Supports time-based and usage-based pricing.
- supports free and paid endpoints
- billing per API call or per time-period
- stripe-cli integration for managing products and billing
- pricing-tables, account management and checkout
- usage tracking api
- all other features of quantready-api
- [quantready-chat]
- A template to build and deploy chatbots
- Supports Websockets
- Slack Integration
- all other features of quantready-vendor