{"id":19874267,"url":"https://github.com/alimghmi/bdlc","last_synced_at":"2026-06-10T19:31:44.990Z","repository":{"id":259720779,"uuid":"879005978","full_name":"alimghmi/bdlc","owner":"alimghmi","description":"Bloomberg API integration, handling data requests, processing, and SQL database insertion.","archived":false,"fork":false,"pushed_at":"2025-05-11T16:55:01.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-11T17:28:24.756Z","etag":null,"topics":["api-client","bloomberg","data","data-processing","financial-data","oauth2","python","sql-database","transformation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alimghmi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-26T17:47:09.000Z","updated_at":"2025-05-11T16:55:04.000Z","dependencies_parsed_at":"2024-10-27T15:30:12.996Z","dependency_job_id":"5eeaf6a2-b60d-4277-a7eb-5aad4af194a9","html_url":"https://github.com/alimghmi/bdlc","commit_stats":null,"previous_names":["alimghmi/bbg-client","alimghmi/bdlc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alimghmi/bdlc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimghmi%2Fbdlc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimghmi%2Fbdlc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimghmi%2Fbdlc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimghmi%2Fbdlc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alimghmi","download_url":"https://codeload.github.com/alimghmi/bdlc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimghmi%2Fbdlc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34168086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","bloomberg","data","data-processing","financial-data","oauth2","python","sql-database","transformation"],"created_at":"2024-11-12T16:22:34.638Z","updated_at":"2026-06-10T19:31:44.985Z","avatar_url":"https://github.com/alimghmi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bloomberg Data License Client (BDLC)\n\nThis project provides a scalable and automated client to request, retrieve, and store financial data from the **Bloomberg Data License (DL)** REST API. It is engineered to integrate with enterprise data workflows, fetching instrument data, applying transformation logic, and persisting results into a Microsoft SQL Server database.\n\n## Overview\n\n### Purpose\n\nThis project automates the end-to-end process of:\n- Authenticating with Bloomberg’s OAuth2-secured DL API.\n- Building and submitting data requests for a universe of financial instruments.\n- Listening for Bloomberg’s asynchronous delivery and downloading structured datasets.\n- Transforming the data into a usable tabular format.\n- Persisting it into a designated SQL Server table.\n\nThis client enables quantitative analysts, portfolio managers, and data engineers to automate ingestion of Bloomberg-licensed content into their internal databases.\n\n## Source of Data\n\nThis project uses the **[Bloomberg Data License REST API](https://www.bloomberg.com/professional/support/api-library/)** which provides access to high-quality financial data including:\n\n- Historical and current pricing\n- Fundamental fields\n- Descriptive security information\n- Bloomberg-specific identifiers\n\nBloomberg credentials and terminal identity parameters are required for authentication and data entitlement.\n\n## Application Flow\n\nThe main orchestration logic is encapsulated in `main.py` and includes:\n\n1. **Initialize Client**:\n   - Queries Bloomberg-entitled tickers via a SQL query using `TickerLoader`.\n   - Establishes a secure OAuth2 session via `Session`.\n\n2. **Data Request Lifecycle**:\n   - A `Client` object composes and sends a data request payload.\n   - The request is submitted to the Bloomberg catalog (configured as “scheduled”).\n   - A listener polls for asynchronous results and downloads them once ready.\n\n3. **Data Transformation**:\n   - The `Agent` class applies transformations to the downloaded data.\n   - Unwanted or redundant fields are dropped based on the configured ignore list.\n\n4. **Database Insertion**:\n   - Transformed data is inserted into the specified SQL Server table.\n   - Options allow for overwriting or appending data with de-duplication logic.\n\n## Project Structure\n\n```\nbdlc-main/\n├── app/                   # Core Bloomberg DL interaction logic\n│   ├── client.py          # Data request and download handling\n│   ├── loader.py          # SQL ticker loader\n│   └── session.py         # OAuth2 session manager\n├── config/                # Logger and environment settings\n├── database/              # MSSQL interface\n├── transformer/           # Data transformation logic\n├── main.py                # Entry point and process orchestrator\n├── .env.sample            # Example environment variable template\n├── Dockerfile             # Docker setup for containerized execution\n```\n\n## Environment Variables\n\nYou must provide a `.env` file based on `.env.sample`. The following environment variables are required:\n\n| Variable | Description |\n|----------|-------------|\n| `LOG_LEVEL` | Logging verbosity level (`INFO`, `DEBUG`, etc.) |\n| `CREDENTIALS` | Path or JSON string with Bloomberg OAuth credentials |\n| `TI_USERNUMBER`, `TI_SERIALNUMBER`, `TI_WORKSTATION` | Bloomberg terminal identity values |\n| `IDENTIFIER_TYPE` | Type of identifier (e.g., `ISIN`, `BBGID`, `CUSIP`) |\n| `DB_IDS_QUERY` | SQL query to retrieve instrument identifiers |\n| `FIELDS` | Comma-separated list of Bloomberg field mnemonics |\n| `BBG_REPLY_TIMEOUT_MIN` | Timeout (in minutes) to wait for a data response |\n| `IGNORE_COLUMNS` | Fields to drop during data transformation |\n| `OUTPUT_TABLE` | Destination MSSQL table |\n| `MSSQL_*` | SQL Server connection credentials and parameters |\n| `INSERTER_MAX_RETRIES`, `REQUEST_MAX_RETRIES`, `REQUEST_BACKOFF_FACTOR` | Retry behavior settings for resiliency |\n\nThese values are consumed by the client and injected into the API request payloads and SQL connection logic.\n\n## Docker Support\n\nThe project is fully containerized for portability.\n\n### Build the Image\n```bash\ndocker build -t bdlc-client .\n```\n\n### Run the Client\n```bash\ndocker run --env-file .env bdlc-client\n```\n\n## Requirements\n\nInstall the required Python dependencies using pip:\n```bash\npip install -r requirements.txt\n```\n\nThe project uses `requests-oauthlib`, `SQLAlchemy`, and `pandas` for API access, SQL integration, and data manipulation.\n\n## Running the App\n\nEnsure that your `.env` is configured correctly and contains valid Bloomberg API credentials.\n\n```bash\npython main.py\n```\n\nProgress will be logged to the console, including request IDs, catalog lookups, and download status.\n\n## License\n\nThis project is MIT licensed. Bloomberg API usage is subject to their licensing and compliance requirements. Ensure that your credentials and entitlement allow for the requested data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falimghmi%2Fbdlc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falimghmi%2Fbdlc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falimghmi%2Fbdlc/lists"}