# \[ANN\] FamaFrenchData.jl - easy access to Fama-French data

**URL:** <https://discourse.julialang.org/t/ann-famafrenchdata-jl-easy-access-to-fama-french-data/36030>\
**Category:** Package Announcements\
**Tags:** package, announcement, finance\
**Created:** [March 15, 2020, 11:55pm UTC](https://discourse.julialang.org/t/ann-famafrenchdata-jl-easy-access-to-fama-french-data/36030 "2020-03-15T23:55:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Yifan\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/4da419/32.png) [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Post date:** [March 18, 2020, 3:34am UTC](https://discourse.julialang.org/t/ann-famafrenchdata-jl-easy-access-to-fama-french-data/36030/2 "2020-03-18T03:34:47Z")

</div>

Nice work. You can also retrieve fama french factor data via wrds following this thread:

> [@Querying WRDS Data using Julia](https://discourse.julialang.org/t/querying-wrds-data-using-julia/31835):
>
> I have written a short tutorial about querying WRDS data using Julia. A user only needs to input her username and password to work with WRDS remotely in Julia. Basically, I translated the existing tutorial about querying WRDS data using R to Julia. [https://wrds-www.wharton.upenn.edu/pages/support/programming-wrds/programming-r/querying-wrds-data-r/](https://wrds-www.wharton.upenn.edu/pages/support/programming-wrds/programming-r/querying-wrds-data-r/) WRDS is the standard data source used by many finance and accounting departments. If you have a wrds account, please go ahead and try my tutorial. …

Below is a snippet of the codes:

```julia
#Querying WRDS Data using Julia

#load required packages
################################################################
using LibPQ, Tables, DataFrames 
################################################################

#1. connect to wrds
wrds = LibPQ.Connection("""
                        host = wrds-pgdata.wharton.upenn.edu 
                        port = 9737
                        user='wrds account' 
                        password='wrds password'
                        sslmode = 'require' 
                        dbname = wrds
                        """)

#2. determine the datasets within the fama french (ff) library:
res = execute(wrds, "SELECT distinct table_name
                    FROM information_schema.columns
                    WHERE table_schema='ff'
                    ORDER BY table_name")

data = DataFrame(columntable(res))
res = 0
data

#3. Fama French 4 factors
res = execute(wrds, "SELECT * FROM ff.factors_daily
WHERE date BETWEEN '1991-01-01' AND '2018-12-31'")

data = DataFrame(columntable(res))
res = 0
data

```

---

_[View the full topic](https://discourse.julialang.org/t/ann-famafrenchdata-jl-easy-access-to-fama-french-data/36030)._
