Skip to content

Commit

Permalink
feat: Add 'data_sources' variable in __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
esloch committed Dec 5, 2023
1 parent 4e707bf commit 627d059
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pysus/online_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,27 @@ def str_to_date(string: str) -> datetime.date:
df = df.convert_dtypes()
return df

def list_data_sources() -> str:
"""
List all databases supported by PySUS.
Returns:
- A formatted string listing the supported databases.
"""

databases_directory = (
Path(__file__).resolve(strict=True).parent / "ftp" / "databases"
)

supported_databases = [
file
for file in databases_directory.glob("*.py")
if file.name != "__init__.py"
]

return f"""Currently, the supported databases are: {', '.join(
file.stem.upper() for file in supported_databases)
}"""

class FTP_Inspect:
"""
Expand Down

0 comments on commit 627d059

Please sign in to comment.