# general-conference-extractor


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` sh
pip install general_conference_extractor
```

## How to Use

#### Example 1 - Just One Talk URL

Here’s what you could do with just one talk URL:

``` python
from general_conference_extractor.GeneralConferenceTalk import GeneralConferenceTalk

url = "https://www.churchofjesuschrist.org/study/general-conference/2024/04/15dushku?lang=eng"

talk = GeneralConferenceTalk(url, title=True, author=True, calling=True)

# Print the extracted text
print("**** Metadata ****  \n")
print(talk.metadata)
print("\n")

print("**** Extracted Text **** \n")
print(talk.text[0:300])
```

    **** Metadata ****  

    {'title': 'Pillars and Rays', 'author': 'Alexander Dushku', 'calling': 'Of the Seventy', 'year': 2024, 'month': 4, 'url': 'https://www.churchofjesuschrist.org/study/general-conference/2024/04/15dushku?lang=eng'}


    **** Extracted Text **** 

    Pillars and Rays

    By Elder Alexander Dushku

    Of the Seventy

    My message is for those who worry about their testimony because they haven’t had overwhelming spiritual experiences. I pray that I can provide some peace and assurance.

    The Restoration of the gospel of Jesus Christ began with an explosion

#### Example 2 - Get All the Talks for One General Conference

Or, here’s an example of extracting every talk from a specific General
Conference (i.e. April 2017 in this instance):

``` python
from general_conference_extractor.extract_URLs import generate_conference_url, extract_talk_urls
from general_conference_extractor.data_output import extract_conference_talks

# Step 1 - Get the URLs for the talks

# get the page URL that shows all the talks for that specific General Conference
gen_conf_page_url = generate_conference_url(2017, '04')

# get all the URLs for the talks that were given for that conference
talk_urls = extract_talk_urls(gen_conf_page_url)

# Step 2 - Save the talks as txt docs in folders and then their respective metadata in a seperate csv file
output_folder = './conference_talks'
metadata_csv_path = './metadata.csv'

# to produce the respective folders and documents
# extract_conference_talks(talk_urls, output_folder, metadata_csv_path)
```

#### Example 3 - Get All the Talks for a Specific Year

``` python
from general_conference_extractor.extract_URLs import extract_multiconference_talk_urls
from general_conference_extractor.data_output import extract_conference_talks

# As an example
multiconference_talk_urls = extract_multiconference_talk_urls(2017,2017)

# Step 2 - Save the talks as txt docs and their metadata in a csv file
output_folder = './conference_talks'
metadata_csv_path = './metadata.csv'

# to produce the respective folders and documents
# extract_conference_talks(multiconference_talk_urls, output_folder, metadata_csv_path)
```

#### Example 4 - Get All the Talks for a Specific Decade

``` python
from general_conference_extractor.extract_URLs import extract_multiconference_talk_urls
from general_conference_extractor.data_output import extract_conference_talks

# As an example
multiconference_talk_urls = extract_multiconference_talk_urls(2010,2019)

# Step 2 - Save the talks as txt docs and their metadata in a csv file
output_folder = './conference_talks'
metadata_csv_path = './metadata.csv'

# to produce the respective folders and documents
# extract_conference_talks(multiconference_talk_urls, output_folder, metadata_csv_path)
```
