Chapter 6 Further Reading
Python Environment and Tooling
-
"The Hitchhiker's Guide to Python" by Kenneth Reitz and Tanya Schlusser (O'Reilly, 2016). The definitive guide to Python best practices, project structure, and environment management. The sections on virtual environments and project layout are particularly relevant.
-
"Python Packaging User Guide" — packaging.python.org. The official guide to packaging Python projects, including
setup.py,pyproject.toml, virtual environments, and dependency management. Essential reference material. -
"Effective Python: 90 Specific Ways to Write Better Python" by Brett Slatkin (Addison-Wesley, 3rd edition, 2024). Covers many of the code patterns used in this chapter: dataclasses, type hints, logging, and testing idioms.
API Design and HTTP
-
"RESTful Web APIs" by Leonard Richardson and Mike Amundsen (O'Reilly, 2013). While focused on API design rather than consumption, understanding how APIs are designed helps you use them more effectively. The discussion of hypermedia, status codes, and authentication patterns is directly applicable.
-
"requests" library documentation — docs.python-requests.org. The official documentation for the
requestslibrary. The advanced usage section covers session objects, retry adapters, and authentication hooks. -
"httpx" library documentation — www.python-httpx.org. Documentation for
httpx, the async-capable HTTP library. The sections on async usage, connection pooling, and timeouts are relevant to our concurrent API access patterns. -
"HTTP: The Definitive Guide" by David Gourley and Brian Totty (O'Reilly, 2002). If you want to understand HTTP deeply — status codes, headers, caching, authentication — this is the comprehensive reference.
Data Analysis with Python
-
"Python for Data Analysis" by Wes McKinney (O'Reilly, 3rd edition, 2022). Written by the creator of pandas, this book is the authoritative guide to data manipulation in Python. The chapters on DataFrame operations, time series, and data cleaning are directly applicable to prediction market data.
-
"NumPy documentation" — numpy.org/doc. The official NumPy documentation, including the user guide and API reference. The sections on array operations and broadcasting are essential background.
-
"Pandas documentation" — pandas.pydata.org/docs. Comprehensive documentation including the "10 Minutes to pandas" tutorial, user guide, and API reference.
Visualization
-
"Fundamentals of Data Visualization" by Claus O. Wilke (O'Reilly, 2019). A principles-first guide to creating effective visualizations. While not Python-specific, the discussion of chart selection, color use, and annotation applies directly to our market visualization work.
-
"Matplotlib documentation" — matplotlib.org/stable. The official documentation includes tutorials, examples, and a comprehensive gallery. The "Customizing Matplotlib" section is particularly useful for establishing consistent visual styles.
-
"Seaborn documentation" — seaborn.pydata.org. Documentation for seaborn, including its tutorial on statistical visualization and the distribution, regression, and categorical plotting functions.
Databases and Data Storage
-
"SQLite documentation" — sqlite.org/docs.html. The official SQLite documentation. The "SQL As Understood By SQLite" section and the documentation on pragmas (like
journal_mode=WAL) are useful references. -
"Using SQLite" by Jay Kreibich (O'Reilly, 2010). A practical guide to SQLite, covering schema design, indexing, performance tuning, and Python integration.
-
"Apache Parquet format" — parquet.apache.org. Documentation for the Parquet columnar storage format. Understanding the format helps you make informed decisions about compression and partitioning for larger datasets.
Testing and Quality
-
"Python Testing with pytest" by Brian Okken (Pragmatic Bookshelf, 2nd edition, 2022). The comprehensive guide to pytest, covering fixtures, parametrization, mocking, and test organization. Directly applicable to testing our
pmtoolsmodule. -
"Architecture Patterns with Python" by Harry Percival and Bob Gregory (O'Reilly, 2020). Goes beyond unit testing to discuss how to structure Python applications for testability, including dependency injection and the repository pattern we use in our database layer.
Version Control
- "Pro Git" by Scott Chacon and Ben Straub (Apress, 2nd edition, 2014). Available free online at git-scm.com/book. The definitive Git reference, from basics to advanced topics like rebasing, bisecting, and hooks.
Security and Configuration
-
"12 Factor App" — 12factor.net. The twelve-factor methodology for building software-as-a-service applications. Factor III (Config) directly addresses our approach to environment variables and secrets management.
-
"python-dotenv documentation" — pypi.org/project/python-dotenv. Documentation for the
python-dotenvlibrary used for loading.envfiles.
Prediction Market APIs
-
Polymarket API documentation — docs.polymarket.com. The official API documentation for Polymarket, including endpoint references, authentication guides, and WebSocket documentation for real-time data.
-
Kalshi API documentation — trading-api.readme.io. Kalshi's API documentation covering market data, order placement, and portfolio management endpoints.
-
Metaculus API — metaculus.com/api. API documentation for Metaculus, a forecasting platform that provides probability estimates and community predictions.
-
PredictIt API — Market data from PredictIt is accessible via their public API endpoints, though formal documentation is limited. Community-maintained Python wrappers exist on GitHub.
Relevant Academic Papers
-
Brier, G.W. (1950). "Verification of Forecasts Expressed in Terms of Probability." Monthly Weather Review, 78(1), 1-3. The original paper introducing the Brier score, which we implement in our probability module.
-
Kelly, J.L. (1956). "A New Interpretation of Information Rate." Bell System Technical Journal, 35(4), 917-926. The foundational paper for the Kelly criterion, which we implement for bet sizing.
-
Gneiting, T., and Raftery, A.E. (2007). "Strictly Proper Scoring Rules, Prediction, and Estimation." Journal of the American Statistical Association, 102(477), 359-378. A comprehensive treatment of scoring rules for probabilistic forecasts, including the Brier score and logarithmic score.
Online Resources
-
Python.org official tutorial — docs.python.org/3/tutorial. If you need to brush up on Python fundamentals, the official tutorial is clear and authoritative.
-
Real Python — realpython.com. High-quality Python tutorials covering many of the topics in this chapter, including virtual environments, logging, testing, and API interaction.
-
Stack Overflow — stackoverflow.com/questions/tagged/python. When you encounter specific error messages or unexpected behavior, searching Stack Overflow often provides solutions faster than reading documentation.