<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on Antoine Boucher</title><link>https://antoineboucher.info/CV/blog/tags/python/</link><description>Recent content in Python on Antoine Boucher</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 13 Apr 2026 12:00:00 -0400</lastBuildDate><atom:link href="https://antoineboucher.info/CV/blog/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Exploring movie similarities with vector search algorithms</title><link>https://antoineboucher.info/CV/blog/posts/vector-databases-similar-movies/</link><pubDate>Mon, 13 Apr 2026 12:00:00 -0400</pubDate><guid>https://antoineboucher.info/CV/blog/posts/vector-databases-similar-movies/</guid><description>&lt;p&gt;This is a single walkthrough of a &lt;strong&gt;movie similarity&lt;/strong&gt; thread: &lt;strong&gt;Part 1&lt;/strong&gt; stores embeddings in &lt;strong&gt;PostgreSQL + pgvector&lt;/strong&gt; and runs nearest-neighbor search in SQL; &lt;strong&gt;Part 2&lt;/strong&gt; uses &lt;strong&gt;Qdrant&lt;/strong&gt; with &lt;strong&gt;MovieLens&lt;/strong&gt; (dense text vectors for semantic search and sparse rating vectors for collaborative-style recommendations); &lt;strong&gt;Part 3&lt;/strong&gt; turns the same pgvector-backed catalog into the retrieval layer for a small &lt;strong&gt;RAG&lt;/strong&gt; pipeline with &lt;strong&gt;LangChain&lt;/strong&gt; and &lt;strong&gt;Ollama&lt;/strong&gt;. Below are short GIFs from that work (&lt;code&gt;movie-similarities-1.gif&lt;/code&gt; … &lt;code&gt;3.gif&lt;/code&gt; in this page bundle).&lt;/p&gt;</description></item><item><title>Python library for MarketWatch virtual trading</title><link>https://antoineboucher.info/CV/blog/posts/marketwatch-python-trading/</link><pubDate>Mon, 13 Apr 2026 10:00:00 -0400</pubDate><guid>https://antoineboucher.info/CV/blog/posts/marketwatch-python-trading/</guid><description>&lt;p&gt;I published &lt;strong&gt;&lt;a href="https://pypi.org/project/marketwatch/"&gt;marketwatch&lt;/a&gt;&lt;/strong&gt; on PyPI: a small Python client for the &lt;a href="https://www.marketwatch.com"&gt;MarketWatch&lt;/a&gt; &lt;strong&gt;virtual stock game&lt;/strong&gt; (paper trading), not live brokerage access. If you want to script watchlists, pull game or portfolio data, or experiment with automation against the game, it wraps the flows in a straightforward API.&lt;/p&gt;
&lt;h2 id="links"&gt;Links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Package:&lt;/strong&gt; &lt;a href="https://pypi.org/project/marketwatch/"&gt;pypi.org/project/marketwatch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Documentation:&lt;/strong&gt; &lt;a href="https://antoinebou12.github.io/marketwatch/"&gt;antoinebou12.github.io/marketwatch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Source &amp;amp; issues:&lt;/strong&gt; &lt;a href="https://github.com/antoinebou12/marketwatch"&gt;github.com/antoinebou12/marketwatch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="what-it-can-do"&gt;What it can do&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Create and manage &lt;strong&gt;watchlists&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Read &lt;strong&gt;game&lt;/strong&gt; details and settings&lt;/li&gt;
&lt;li&gt;Inspect &lt;strong&gt;portfolio&lt;/strong&gt;, positions, and pending orders&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Buy&lt;/strong&gt; and &lt;strong&gt;sell&lt;/strong&gt; (in-game)&lt;/li&gt;
&lt;li&gt;Fetch the &lt;strong&gt;leaderboard&lt;/strong&gt; for a game&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Useful if you are exploring automated strategies or small bots &lt;strong&gt;inside the game’s rules&lt;/strong&gt;—see the docs for method names and return shapes.&lt;/p&gt;</description></item><item><title>A Method to Install Python Packages for Add-ons &amp; Plugins in Blender (Windows, Blender 4.2+)</title><link>https://antoineboucher.info/CV/blog/posts/blender-python-packages/</link><pubDate>Sat, 08 Feb 2025 12:00:00 -0400</pubDate><guid>https://antoineboucher.info/CV/blog/posts/blender-python-packages/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Blender is a powerhouse for 3D creation, offering a Python API that allows users to extend its functionality with scripts, add-ons, and plugins. However, one challenge developers face is &lt;strong&gt;installing external Python packages&lt;/strong&gt; within Blender’s &lt;strong&gt;isolated Python environment&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Unlike system-wide Python installations, Blender bundles its own Python interpreter, making standard package installations tricky. This article presents &lt;strong&gt;a more general and robust method&lt;/strong&gt; to install Python dependencies for Blender add-ons and plugins — ensuring a smooth workflow across different versions.&lt;/p&gt;</description></item><item><title>ChatGPT plugin with FastAPI — implementation outline</title><link>https://antoineboucher.info/CV/blog/posts/fastapi-chatgpt-plugin-overview/</link><pubDate>Sat, 01 Jun 2024 10:00:00 -0400</pubDate><guid>https://antoineboucher.info/CV/blog/posts/fastapi-chatgpt-plugin-overview/</guid><description>&lt;p&gt;OpenAI-style &lt;strong&gt;plugins&lt;/strong&gt; expose an HTTP API described by an &lt;strong&gt;OpenAPI&lt;/strong&gt; document so ChatGPT can call your tools safely. &lt;strong&gt;FastAPI&lt;/strong&gt; generates OpenAPI for you, which fits this model well.&lt;/p&gt;
&lt;h2 id="1-define-the-api-in-fastapi"&gt;1. Define the API in FastAPI&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Routes return &lt;strong&gt;JSON&lt;/strong&gt; with stable shapes (no ambiguous free text where structure matters).&lt;/li&gt;
&lt;li&gt;Add &lt;strong&gt;summaries and descriptions&lt;/strong&gt; on paths and fields — they help the model choose the right tool.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="2-publish-openapijson"&gt;2. Publish &lt;code&gt;openapi.json&lt;/code&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;FastAPI serves &lt;strong&gt;&lt;code&gt;/openapi.json&lt;/code&gt;&lt;/strong&gt; by default; the plugin manifest points at this URL (or a static copy you version).&lt;/li&gt;
&lt;li&gt;Keep schemas &lt;strong&gt;tight&lt;/strong&gt;: enums, required fields, and examples reduce bad calls.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="3-plugin-manifest"&gt;3. Plugin manifest&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Host &lt;strong&gt;&lt;code&gt;ai-plugin.json&lt;/code&gt;&lt;/strong&gt; (or the format required by the current OpenAI developer docs) over &lt;strong&gt;HTTPS&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Manifest references your API base URL and OpenAPI location.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="4-auth"&gt;4. Auth&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Prefer &lt;strong&gt;OAuth&lt;/strong&gt; or &lt;strong&gt;API keys&lt;/strong&gt; as documented for your integration; never commit secrets.&lt;/li&gt;
&lt;li&gt;Validate tokens inside FastAPI dependencies or middleware.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="5-deploy"&gt;5. Deploy&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;HTTPS&lt;/strong&gt; endpoint reachable from OpenAI’s servers.&lt;/li&gt;
&lt;li&gt;Logging and &lt;strong&gt;idempotency&lt;/strong&gt; for side-effecting routes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="6-test-manually"&gt;6. Test manually&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Call routes with &lt;code&gt;curl&lt;/code&gt; or HTTPie using the same payloads the model will send.&lt;/li&gt;
&lt;li&gt;Iterate on descriptions and constraints before exposing wide traffic.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Details change with OpenAI’s platform updates — always follow the latest &lt;strong&gt;plugin / tools / actions&lt;/strong&gt; documentation when wiring production apps.&lt;/p&gt;</description></item><item><title>Multiple Technical Indicators Backtesting on Multiple Tickers using Python</title><link>https://antoineboucher.info/CV/blog/posts/multiple-indicators-backtesting/</link><pubDate>Thu, 30 May 2024 15:00:00 -0400</pubDate><guid>https://antoineboucher.info/CV/blog/posts/multiple-indicators-backtesting/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this report, we present an experiment with technical indicators using the BatchBacktesting project available on GitHub at the following link: &lt;a href="https://github.com/AlgoETS/BatchBacktesting"&gt;BatchBacktesting&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="installing-dependencies"&gt;Installing Dependencies&lt;/h2&gt;
&lt;p&gt;To get started, install the necessary libraries:&lt;/p&gt;
&lt;p&gt;!pip install numpy httpx richp&lt;/p&gt;
&lt;h2 id="importing-modules"&gt;Importing Modules&lt;/h2&gt;
&lt;p&gt;Here are the modules to import for the script:&lt;/p&gt;
&lt;p&gt;import pandas as pd&lt;br&gt;
import numpy as np&lt;br&gt;
from datetime import datetime&lt;br&gt;
import httpx&lt;br&gt;
import concurrent.futures&lt;br&gt;
import glob&lt;br&gt;
import warnings&lt;br&gt;
from rich.progress import track&lt;/p&gt;</description></item><item><title>Experimenting with technical indicators using Python and backtesting</title><link>https://antoineboucher.info/CV/blog/posts/experimentation-indicateurs-backtesting/</link><pubDate>Tue, 14 May 2024 20:00:00 -0400</pubDate><guid>https://antoineboucher.info/CV/blog/posts/experimentation-indicateurs-backtesting/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this report, we present an experiment with technical indicators using the BatchBacktesting project available on GitHub at the following link: &lt;a href="https://github.com/AlgoETS/BatchBacktesting"&gt;BatchBacktesting&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="installing-dependencies"&gt;Installing Dependencies&lt;/h2&gt;
&lt;p&gt;To get started, install the necessary libraries:&lt;/p&gt;
&lt;p&gt;!pip install numpy httpx richp&lt;/p&gt;
&lt;h2 id="importing-modules"&gt;Importing Modules&lt;/h2&gt;
&lt;p&gt;Here are the modules to import for the script:&lt;/p&gt;
&lt;p&gt;import pandas as pd&lt;br&gt;
import numpy as np&lt;br&gt;
from datetime import datetime&lt;br&gt;
import httpx&lt;br&gt;
import concurrent.futures&lt;br&gt;
import glob&lt;br&gt;
import warnings&lt;br&gt;
from rich.progress import track&lt;/p&gt;</description></item><item><title>Predicting Stock Prices with Monte Carlo Simulations</title><link>https://antoineboucher.info/CV/blog/posts/predicting-stock-prices-monte-carlo/</link><pubDate>Tue, 14 May 2024 09:00:00 -0400</pubDate><guid>https://antoineboucher.info/CV/blog/posts/predicting-stock-prices-monte-carlo/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In finance, decisions are rarely about a single “forecast” price: they are about &lt;strong&gt;ranges&lt;/strong&gt;, &lt;strong&gt;tail risk&lt;/strong&gt;, and &lt;strong&gt;how wrong&lt;/strong&gt; simple models can be. This article walks through a &lt;strong&gt;Monte Carlo path simulation&lt;/strong&gt; in Python: we estimate drift and volatility from historical closes, simulate many future price paths (a geometric Brownian–style discrete step), and summarize the result as a &lt;strong&gt;distribution&lt;/strong&gt;—the right object for risk-style questions (bands, percentiles, coverage against a hold-out period).&lt;/p&gt;</description></item></channel></rss>