Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove un-used dependencies (scipy, numpy); let numpy cascade from pandas. Fix escaping issues; fixes #57 and #58 #59

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__
docs/build/
build/
dist/
venv/
*egg-info*
*.ipynb
.ipynb_checkpoints
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ keywords = ["wrds", "finance", "research", "crsp", "compustat"]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
Expand All @@ -36,11 +36,9 @@ classifiers = [
"License :: OSI Approved :: BSD License",
]
dependencies = [
"numpy>=1.26,<1.27",
"packaging<23.3",
"packaging<=24.2",
"pandas>=2.2,<2.3",
"psycopg2-binary>=2.9,<2.10",
"scipy>=1.12,<1.13",
"sqlalchemy>=2,<2.1",
]
dynamic = ["version"]
Expand Down
8 changes: 4 additions & 4 deletions wrds/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def __get_user_credentials(self):
return username, passwd

def create_pgpass_file(self):
"""
r"""
Create a .pgpass file to store WRDS connection credentials.

Use the existing username and password if already connected to WRDS,
Expand All @@ -245,7 +245,7 @@ def create_pgpass_file(self):
self.__create_pgpass_file_unix()

def __create_pgpass_file_win32(self):
"""
r"""
Create a pgpass.conf file on Windows.

Windows is different enough from everything else
Expand Down Expand Up @@ -294,7 +294,7 @@ def __write_pgpass_file(self, pgfile):
"""
pgpass = "{host}:{port}:{dbname}:{user}:{passwd}\n"
passwd = self._password
passwd = passwd.replace(":", "\:")
passwd = passwd.replace(":", r"\:")
# Avoid clobbering the file if it exists
if os.path.isfile(pgfile):
with open(pgfile, "r") as fd:
Expand All @@ -305,7 +305,7 @@ def __write_pgpass_file(self, pgfile):
# split() from splitting on them.
# Saving to a new variable here absolves us
# of having to re-replace the substituted ##COLON## later.
oldline = line.replace("""\:""", "##COLON##")
oldline = line.replace(r"\:", "##COLON##")
fields = oldline.split(":")
# On finding a line matching the hostname, port and dbname
# we replace it with the new pgpass line.
Expand Down