Package Setup and Distribution
Relevant source files
The following files were used as context for generating this wiki page:
Stolgo is a Price Action Trading Analysis Library designed to automate price action rules and facilitate backtesting for financial data. The package setup and distribution infrastructure ensures that the library is correctly packaged, versioned, and equipped with the necessary dependencies to handle financial data requests from various exchanges and brokers.
The project uses standard Python packaging tools, specifically setuptools, to manage its distribution. It is primarily distributed via the Python Package Index (PyPI), allowing users to install it using common package managers like pip.
Sources: README.md:1-12, setup.py:1-7
Distribution Configuration
The core of the distribution process is defined in setup.py. This file configures the package metadata, supported environments, and structural mapping of the library.
Metadata and Package Information
The package is named stolgo and is currently positioned in the Production/Stable development status. It is licensed under the MIT license and maintained by the stolgo Developers.
| Attribute | Value |
|---|---|
| Name | stolgo |
| Version | 0.1.2.post1 |
| License | MIT |
| Author | stolgo Developers |
| Download URL | https://github.com/stockalgo/stolgo/archive/v_0_1_2.tar.gz |
Sources: setup.py:7-17, setup.py:34-45
Requirements and Dependencies
Stolgo relies on several third-party libraries for data processing, web scraping, and network requests.
- Data Handling:
pandas,openpyxl - Networking:
requests - Parsing:
beautifulsoup4,lxml - Concurrency:
futures - Time Management:
datetime
Sources: setup.py:23-30
Project Structure and Mapping
Stolgo utilizes a lib directory for its source code, which is mapped to the package namespace using setuptools. The following diagram illustrates the package discovery and directory mapping defined in the setup configuration.
The diagram shows how setup.py directs the installer to look into the lib folder for the package contents.
Sources: setup.py:19-20, lib/stolgo/samco.py, lib/stolgo/nasdaq.py
Installation and Environment Support
The library is designed for compatibility with Python 3 environments, specifically versions 3.5 through 3.8. Users can install the package directly from PyPI.
pip install stolgo
Sources: README.md:14-18, setup.py:38-43
Integration with Data Feeds
While Stolgo provides the analysis logic, it depends on external data feeds. The documentation highlights a close relationship with bandl.io for fetching data from brokers, exchanges, or Yahoo Finance. This external dependency is often used in conjunction with Stolgo's internal modules like Samco or Nasdaq.
This diagram illustrates the flow from a user calling a data retrieval function to the internal request handling.
Sources: README.md:20-22, lib/stolgo/request.py:68-85, lib/stolgo/samco.py:133-140
Internal Infrastructure Components
The distribution includes several utility modules that support the core functionality:
- Request Handling:
lib/stolgo/request.pyprovidesRequestUrlandCurlclasses with built-in retry logic and timeout management usingHTTPAdapter. - Date Utilities:
lib/stolgo/helper.pymanages date formatting and range calculations, which are critical for financial time-series data. - Exception Mapping: Custom exceptions like
BadDataErrorare defined inlib/stolgo/exception.pyto handle specific data validation failures.
Sources: lib/stolgo/request.py:10-25, lib/stolgo/helper.py:27-36, lib/stolgo/exception.py:1-3
Summary
The package setup of Stolgo follows standard Pythonic distribution practices, ensuring a stable and predictable installation process via pip. By defining clear dependencies and providing a robust internal request and helper infrastructure, the library provides a reliable foundation for price action trading analysis across multiple Python 3.x versions.