{"id":22311797,"url":"https://github.com/dhruvan2006/pytlx","last_synced_at":"2025-10-14T04:30:21.451Z","repository":{"id":265130610,"uuid":"894429591","full_name":"dhruvan2006/pytlx","owner":"dhruvan2006","description":"Download leveraged token data from TLX Fi","archived":false,"fork":false,"pushed_at":"2024-12-07T21:58:31.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T04:22:21.918Z","etag":null,"topics":["cryptocurrency","leverage","tlx"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pytlx","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhruvan2006.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-11-26T10:45:12.000Z","updated_at":"2024-12-07T21:58:35.000Z","dependencies_parsed_at":"2024-11-27T20:45:22.651Z","dependency_job_id":null,"html_url":"https://github.com/dhruvan2006/pytlx","commit_stats":null,"previous_names":["dhruvan2006/pytlx"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dhruvan2006/pytlx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvan2006%2Fpytlx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvan2006%2Fpytlx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvan2006%2Fpytlx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvan2006%2Fpytlx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhruvan2006","download_url":"https://codeload.github.com/dhruvan2006/pytlx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvan2006%2Fpytlx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017942,"owners_count":26086213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"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":["cryptocurrency","leverage","tlx"],"created_at":"2024-12-03T21:28:58.138Z","updated_at":"2025-10-14T04:30:21.209Z","avatar_url":"https://github.com/dhruvan2006.png","language":"Python","readme":"# PyTLX\n\nDownload leveraged token data from [TLX Fi](https://tlx.fi)\n\n[![Build Status](https://github.com/dhruvan2006/pytlx/actions/workflows/ci.yml/badge.svg)](https://github.com/dhruvan2006/pytlx)\n[![PyPI Version](https://img.shields.io/pypi/v/pytlx)](https://github.com/dhruvan2006/pytlx)\n[![codecov](https://codecov.io/gh/dhruvan2006/pytlx/graph/badge.svg?token=GVWV3STI3C)](https://codecov.io/gh/dhruvan2006/pytlx)\n[![Monthly Downloads](https://img.shields.io/pypi/dm/pytlx)](https://github.com/dhruvan2006/pytlx)\n[![License](https://img.shields.io/github/license/dhruvan2006/pytlx)](https://github.com/dhruvan2006/pytlx)\n\n## Installation\n\nInstall PyTLX using pip:\n```bash\npip install pytlx\n```\n\n## Quick Start\n\n### Example Usage\n```python\nimport pytlx as tlx\n\n# Initialize a token by its ticker\ntoken = tlx.Token(\"BTC5L\")\n\n# Fetch historical data for the token\ndata = token.history()\nprint(data)\n```\n\n# API Documentation\n\n## Token Class\n\n### Description\nThe `Token` class provides a Python interface for interacting with the TLX platform, fetching token data, contract information, and historical prices.\n\n---\n\n### Initialization\n\n#### `Token(ticker: str)`\n- **Parameters**:\n  - `ticker` (str): The token's identifier (e.g., `BTC5L`).\n- **Description**:\n  Initializes the `Token` object for fetching leveraged token data.\n\n---\n\n### Methods\n\n#### `get_contract_addresses() -\u003e List[Dict[str, Any]]`\n- **Description**:\n  Fetches all leveraged token contract addresses and related metadata from the smart contract on the Optimism blockchain.\n- **Returns**:\n  A list of dictionaries containing contract address data:\n  - `addr` (str): Contract address.\n  - `symbol` (str): Token symbol.\n  - Other metadata fields as provided by the contract.\n\n---\n\n#### `get_contract_address() -\u003e Optional[str]`\n- **Description**:\n  Retrieves the specific contract address associated with the initialized token's ticker.\n- **Returns**:\n  - `str`: Contract address if the ticker is found.\n  - `None`: If the ticker does not exist in the metadata.\n\n---\n\n#### `history(granularity: str = \"1d\", start: str = \"1900-01-01\") -\u003e pd.DataFrame`\n- **Description**:\n  Fetches historical price data for the token using the TLX API.\n- **Parameters**:\n  - `granularity` (str): Data interval (e.g., `1d`, `6h`).\n  - `start` (str): Start date in `YYYY-MM-DD` format (default: `\"1900-01-01\"`).\n- **Returns**:\n  A `pandas.DataFrame` with the following columns:\n  - `Date`: The timestamp of the data point (index).\n  - `Price`: The historical price of the token.\n\n- **Raises**:\n  - `ValueError`: If the ticker is invalid.\n  - `HTTPError`: If the API call fails.\n\n---\n\n#### `get_contract_addresses() -\u003e List[Dict[str, Any]]`\n- **Description**:\n  Retrieves all contract addresses and metadata for leveraged tokens by interacting with the Optimism smart contract.\n- **Returns**:\n  A list of dictionaries with details:\n  - `addr` (str): Token contract address.\n  - `symbol` (str): Token ticker.\n  - Additional metadata like `totalSupply`, `targetLeverage`, and `isActive`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvan2006%2Fpytlx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhruvan2006%2Fpytlx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvan2006%2Fpytlx/lists"}