• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    Python
  • Created almost 9 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Read WRDS datasets remotely (from wrds-cloud) into a Pandas dataframe. For any issues with this package, please contact [email protected].

WRDS Python Data Access Library

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

For detailed information on installation of the module, please see PYTHON: From Your Computer (Jupyter/Spyder)

Using pip

The easiest way to install WRDS-Py on any supported platform is to use pip, the Python package manager, to install from the Python package index (pypi).

$ pip install wrds

Windows

WRDS-Py requires the Pandas and Psycopg2 Python packages. Binaries of these can be found here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg

Once the two required packages are installed, use pip to install.

Usage

For detailed information on use of the module, please see Querying WRDS Data using Python

>>> 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

More Repositories

1

drf-excel

An XLSX spreadsheet renderer for Django REST Framework.
Python
207
star
2

wagtailgridder

Wagtail Gridder is a Bootstrap 4 enabled layout for the Wagtail CMS. Grid Items are created within categories, and displayed on a Grid Index Page. The JavaScript libraries Gridder and MixItUp are included.
Python
67
star
3

automagic-rest

Django REST Framework PostgreSQL Builder: automagically creates DRF endpoints by introspecting PostgreSQL.
Python
37
star
4

python-vagrant-centos7

A Vagrant box for development on Python 3.6, with many extras for Django 2.x development.
Jinja
30
star
5

django-base-theme

A responsive, mobile-first front-end framework designed for Wharton Django applications.
CSS
23
star
6

chef-coldfusion10

Chef cookbook to install ColdFusion 10.
Ruby
19
star
7

django-flexbox-theme

A modern, lightweight & responsive CSS styleguide based on Flexbox.
CSS
13
star
8

chef-shibboleth-sp

Chef Shibboleth Service Provider Cookbook
Ruby
7
star
9

chef-jbossas7

Chef Cookbook for JBoss AS 7
Ruby
7
star
10

chef-coldfusion9

A Chef cookbook to install ColdFusion 9.0.1 CHF 2.
Ruby
6
star
11

chef-coldfusion902

Chef cookbook to install ColdFusion 9.0.2.
Ruby
6
star
12

django-cybersource-hosted-checkout

This package provides utilities for using CyberSource Secure Acceptance Hosted Checkout.
Python
6
star
13

django-data-tables-tags

Django template tags for jQuery DataTables.
Python
5
star
14

mfnbc

Naive Bayes Classifier Multiple Features
Python
4
star
15

inlinesas

Run SAS code from within a Python script.
Python
4
star
16

Envelope

A C# .NET wrapper for EWS (Exchange Web Services), and a companion ColdFusion CFC, which together try to restore some of the CFExchange functionality lost when Exchange 2010 was released between versions of ColdFusion
C#
3
star
17

sasdataframe

Import a SAS dataset into a Pandas dataframe
Python
3
star
18

chef-shibboleth-idp

Chef Cookbook for Shibboleth Identity Provider
HTML
3
star
19

penndjangosaml2

Penn Version of djangosaml2
Python
3
star
20

wharton-cosign-auth

Python
2
star
21

cf-remoteaddr

ColdFusion custom tag to get a client's remote address based on the X-Forwarded-For HTTP request header.
ColdFusion
1
star
22

chef-javaloader

Installs JavaLoader framework for ColdFusion 10
Ruby
1
star
23

django-user-emulation

emulate another user's login within your app
JavaScript
1
star
24

stash-reject-all

An Atlassian Stash plugin to reject all pushes to a repository.
Java
1
star
25

chef-cfsolr

Chef Cookbook for Apache Solr for ColdFusion
Ruby
1
star
26

chef-mxunit

Chef cookbook to install the MXUnit framework for ColdFusion.
Ruby
1
star
27

chef-unzip

Chef cookbook to install unzip tool.
Ruby
1
star
28

DiscoverPagination

A python package for discovering numbered page delineation in documents.
Python
1
star