Skip to main content

Python access to WRDS Data

Project description

WRDS-Py is a library for extracting data from WRDS data sources and getting it into Pandas. The library allows users to access data from WRDS and extract data using SQL statements. The data that is returned is read into a Pandas data frame.

Installation

Mac OS/Linux

$ python setup.py install

Windows

The WRDS-PY package requires Pandas and Psycopg2. Binaries of these can be found here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg

Once the two required packages are installed, you can run $ python setup.py install

For more information please consult the WRDS Support section at https://wrds-web.wharton.upenn.edu/wrds/support/.

Usage

>>> import wrds
>>> db = wrds.Connection()
Enter your credentials.
Username: <your_username>
Password: <your_password>
>>> db.list_libraries()
['audit', 'bank', 'block', 'bvd', 'bvdtrial', 'cboe', ...]
>>> db.list_tables(library='crsp')
['aco_amda', 'aco_imda', 'aco_indfnta', 'aco_indfntq', ...]
>>> db.describe_table(library='crsp', table='stocknames')
Approximately 58957 rows in crsp.stocknames.
       name    nullable              type
0      permno      True  DOUBLE PRECISION
1      permco      True  DOUBLE PRECISION
2      namedt      True              DATE
...
>>> stocknames = db.get_table(library='crsp', table='stocknames', obs=10)
>>> stocknames.head()
   permno  permco      namedt   nameenddt     cusip    ncusip ticker  \
0  10000.0  7952.0  1986-01-07  1987-06-11  68391610  68391610  OMFGA
1  10001.0  7953.0  1986-01-09  1993-11-21  36720410  39040610   GFGC
2  10001.0  7953.0  1993-11-22  2008-02-04  36720410  29274A10   EWST
3  10001.0  7953.0  2008-02-05  2009-08-03  36720410  29274A20   EWST
4  10001.0  7953.0  2009-08-04  2009-12-17  36720410  29269V10   EGAS
>>> db.close()  # Close the connection to the database...
>>> with wrds.Connection() as db:  # You can use a context manager
...    stocknames = db.get_table(library='crsp', table='stocknames', obs=10)
>>> stocknames.head()
   permno  permco      namedt   nameenddt     cusip    ncusip ticker  \
0  10000.0  7952.0  1986-01-07  1987-06-11  68391610  68391610  OMFGA
1  10001.0  7953.0  1986-01-09  1993-11-21  36720410  39040610   GFGC
2  10001.0  7953.0  1993-11-22  2008-02-04  36720410  29274A10   EWST
3  10001.0  7953.0  2008-02-05  2009-08-03  36720410  29274A20   EWST
4  10001.0  7953.0  2009-08-04  2009-12-17  36720410  29269V10   EGAS

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wrds-3.0.7.tar.gz (10.9 kB view details)

Uploaded Source

Built Distributions

wrds-3.0.7-py3.7.egg (22.5 kB view details)

Uploaded Source

wrds-3.0.7-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

wrds-3.0.7-py2.7.egg (22.4 kB view details)

Uploaded Source

wrds-3.0.7-py2-none-any.whl (12.6 kB view details)

Uploaded Python 2

File details

Details for the file wrds-3.0.7.tar.gz.

File metadata

  • Download URL: wrds-3.0.7.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for wrds-3.0.7.tar.gz
Algorithm Hash digest
SHA256 931dc3a1963ec373052c8baf769eeaf5f8c6ab000f1937a4c8b3184af1014792
MD5 bc5de6fa076aeecc8b71812f6c6dda79
BLAKE2b-256 94e77e7690cadb220af99b50cf5500b6ce9a5043e71e34de4cae55baa1a1a4fe

See more details on using hashes here.

File details

Details for the file wrds-3.0.7-py3.7.egg.

File metadata

  • Download URL: wrds-3.0.7-py3.7.egg
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for wrds-3.0.7-py3.7.egg
Algorithm Hash digest
SHA256 e2eee483d7c54a6de580ccabddebf330581325a4ed5b17f19a0333f8d3d763e7
MD5 31f8f7a0efe12121613d3953884babec
BLAKE2b-256 ecdb24670ef1dbed33f88d9959eab61708b3fa78f227aa0a58089af9fae6162b

See more details on using hashes here.

File details

Details for the file wrds-3.0.7-py3-none-any.whl.

File metadata

  • Download URL: wrds-3.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for wrds-3.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fa689f85368965789ba5bb1bfdb269caa70e4073a024c6bcac199db964528738
MD5 6a7b2df9c02f32cc53ad7af0b5e3fd36
BLAKE2b-256 e78d4c2d0e9793a0dc2f443727cf2586a5dca78762902208aeea0e68246f93ee

See more details on using hashes here.

File details

Details for the file wrds-3.0.7-py2.7.egg.

File metadata

  • Download URL: wrds-3.0.7-py2.7.egg
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for wrds-3.0.7-py2.7.egg
Algorithm Hash digest
SHA256 218c4478cb281d1434183c97296f76c0dd261753edd0f0716343c15de6af0076
MD5 f08ad2ce4a51b2f3882b14e238343c30
BLAKE2b-256 27e30b8ec098a5cc3bb072d370a16c47c6eab5eb26d50609f7d42a8242cb50c3

See more details on using hashes here.

File details

Details for the file wrds-3.0.7-py2-none-any.whl.

File metadata

  • Download URL: wrds-3.0.7-py2-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.8

File hashes

Hashes for wrds-3.0.7-py2-none-any.whl
Algorithm Hash digest
SHA256 e786121454e62a718e674924827fad1ad6d99df475c45ba90c9e2d4a07fb5de9
MD5 0b09f5dfb6dedf80b189aa7de4ed7340
BLAKE2b-256 f23eb1f40346fe02134d71293d309f9ebac6e38f3a2d4ab5fec45ec5f8acd3e9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page