earningscall 0.0.20__tar.gz → 0.0.22__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {earningscall-0.0.20 → earningscall-0.0.22}/CHANGELOG.md +8 -0
  2. {earningscall-0.0.20 → earningscall-0.0.22}/DEVELOPMENT.md +8 -0
  3. {earningscall-0.0.20 → earningscall-0.0.22}/PKG-INFO +130 -2
  4. earningscall-0.0.22/README.md +258 -0
  5. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/api.py +9 -1
  6. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/company.py +3 -0
  7. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/transcript.py +10 -1
  8. {earningscall-0.0.20 → earningscall-0.0.22}/pyproject.toml +1 -1
  9. {earningscall-0.0.20 → earningscall-0.0.22}/scripts/download_audio_files.py +6 -0
  10. {earningscall-0.0.20 → earningscall-0.0.22}/scripts/download_sp500_audio_files.py +6 -0
  11. {earningscall-0.0.20 → earningscall-0.0.22}/scripts/get_single_transcript.py +10 -2
  12. earningscall-0.0.22/tests/data/aapl-q1-2022-speaker-name-map-v2.yaml +643 -0
  13. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_get_transcript.py +54 -5
  14. earningscall-0.0.20/README.md +0 -129
  15. {earningscall-0.0.20 → earningscall-0.0.22}/.github/workflows/release.yml +0 -0
  16. {earningscall-0.0.20 → earningscall-0.0.22}/.github/workflows/test.yml +0 -0
  17. {earningscall-0.0.20 → earningscall-0.0.22}/.gitignore +0 -0
  18. {earningscall-0.0.20 → earningscall-0.0.22}/.python-version +0 -0
  19. {earningscall-0.0.20 → earningscall-0.0.22}/LICENSE +0 -0
  20. {earningscall-0.0.20 → earningscall-0.0.22}/TODO.md +0 -0
  21. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/__init__.py +0 -0
  22. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/errors.py +0 -0
  23. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/event.py +0 -0
  24. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/exports.py +0 -0
  25. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/sectors.py +0 -0
  26. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/symbols.py +0 -0
  27. {earningscall-0.0.20 → earningscall-0.0.22}/earningscall/utils.py +0 -0
  28. {earningscall-0.0.20 → earningscall-0.0.22}/hatch.toml +0 -0
  29. {earningscall-0.0.20 → earningscall-0.0.22}/scripts/download_single_audio_file.py +0 -0
  30. {earningscall-0.0.20 → earningscall-0.0.22}/scripts/get_all_company_transcripts.py +0 -0
  31. {earningscall-0.0.20 → earningscall-0.0.22}/scripts/list_companies.py +0 -0
  32. {earningscall-0.0.20 → earningscall-0.0.22}/setup.cfg +0 -0
  33. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/aapl-q1-2022-advanced-data-level-2.yaml +0 -0
  34. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/aapl-q1-2022-advanced-data-level-3.yaml +0 -0
  35. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/aapl-q1-2022-advanced-data-level-4.yaml +0 -0
  36. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/aapl-q1-2030-not-authorized-l2.yaml +0 -0
  37. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/aapl-q1-2030-not-authorized.yaml +0 -0
  38. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/aapl-q1-2030-not-found.yaml +0 -0
  39. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/aapl-q1-2030-server-error.yaml +0 -0
  40. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/demo-symbols-v2-alpha.yaml +0 -0
  41. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/demo-symbols-v2.yaml +0 -0
  42. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/meta-q3-2024-not-authorized.yaml +0 -0
  43. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/meta-q3-2024-not-found.yaml +0 -0
  44. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/meta-q3-2024-other-error.yaml +0 -0
  45. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/msft-company-events.yaml +0 -0
  46. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/msft-q1-2022-audio-file-short-clip.yaml +0 -0
  47. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/msft-transcript-response.yaml +0 -0
  48. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/sp500-company-list-failed.yaml +0 -0
  49. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/sp500-company-list.yaml +0 -0
  50. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/symbols-v2-missing-edge-cases.yaml +0 -0
  51. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/symbols-v2.yaml +0 -0
  52. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/symbols.txt +0 -0
  53. {earningscall-0.0.20 → earningscall-0.0.22}/tests/data/symbols.yaml +0 -0
  54. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_company.py +0 -0
  55. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_download_audio_files.py +0 -0
  56. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_earnings_event.py +0 -0
  57. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_exports.py +0 -0
  58. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_get_company_events.py +0 -0
  59. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_get_sp500_companies_api.py +0 -0
  60. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_helper.py +0 -0
  61. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_responses_mocking.py +0 -0
  62. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_sectors.py +0 -0
  63. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_symbols.py +0 -0
  64. {earningscall-0.0.20 → earningscall-0.0.22}/tests/test_utils.py +0 -0
@@ -1,3 +1,11 @@
1
+ ## Release `0.0.22` - 2024-10-07
2
+
3
+ * Add **experimental feature**: Speaker Names and Titles
4
+
5
+ ## Release `0.0.21` - 2024-10-07
6
+
7
+ * Bump version for PyPI release: updated README docs.
8
+
1
9
  ## Release `0.0.20` - 2024-10-07
2
10
 
3
11
  * Bugfix: Fix importlib error.
@@ -1,5 +1,13 @@
1
1
  # Development
2
2
 
3
+ The instructions on this page are meant for library contributors.
4
+ If you are interested in contributing to this project, read on.
5
+ Otherwise, if you are simply wanting to get EarningsCalls Transcripts or Audio Files,
6
+ please read the [README page](README.md) to get started.
7
+
8
+
9
+ ## Getting Started
10
+
3
11
  First, install Hatch plus other build dependencies. See the Hatch [installation instructions](https://hatch.pypa.io/latest/install/).
4
12
 
5
13
  My preferred way to install it is to use `pip`:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: earningscall
3
- Version: 0.0.20
3
+ Version: 0.0.22
4
4
  Summary: The EarningsCall Python library provides convenient access to the EarningsCall API. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.
5
5
  Project-URL: Homepage, https://earningscall.biz
6
6
  Project-URL: Documentation, https://github.com/EarningsCall/earningscall-python
@@ -30,7 +30,6 @@ License: MIT License
30
30
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
31
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
32
  SOFTWARE.
33
- License-File: LICENSE
34
33
  Keywords: earning call app,earnings call,earnings call api,earnings call app,earnings call transcript api,earnings call transcripts,earnings call transcripts api,earnings calls,earnings transcript api,listen to earnings calls,transcripts,where to listen to earnings calls
35
34
  Classifier: Development Status :: 3 - Alpha
36
35
  Classifier: Intended Audience :: Developers
@@ -95,6 +94,8 @@ Apple Inc. Q3 2021 Transcript Text: "Good day, and welcome to the Apple Q3 FY 20
95
94
 
96
95
 
97
96
  ```python
97
+ from datetime import datetime
98
+
98
99
  from earningscall import get_company
99
100
 
100
101
  company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
@@ -102,6 +103,9 @@ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
102
103
  print(f"Getting all transcripts for: {company}..")
103
104
  # Retrieve all earnings conference call events for a company, and iterate through each one
104
105
  for event in company.events():
106
+ if datetime.now().timestamp() < event.conference_date.timestamp():
107
+ print(f"* {company.company_info.symbol} Q{event.quarter} {event.year} -- skipping, conference date in the future")
108
+ continue
105
109
  transcript = company.get_transcript(event=event) # Fetch the earnings call transcript for this event
106
110
  print(f"* Q{event.quarter} {event.year}")
107
111
  if transcript:
@@ -126,6 +130,130 @@ Getting all transcripts for: Apple Inc...
126
130
  ...
127
131
  ```
128
132
 
133
+
134
+ ## Get Text by Speaker
135
+
136
+ If you want to get the text by speaker, you can do so by setting the `level` parameter to `2`.
137
+
138
+ NOTE: Level `2` data is provided in any plan that includes Enhanced Transcript Data.
139
+
140
+ ```python
141
+ from earningscall import get_company
142
+
143
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
144
+
145
+ transcript = company.get_transcript(year=2021, quarter=3, level=2)
146
+
147
+ first_speaker = transcript.speakers[0]
148
+ speaker_label = first_speaker.speaker
149
+ text = first_speaker.text
150
+ print(f"Speaker: {speaker_label}\nText: {text}")
151
+ ```
152
+
153
+ Output
154
+
155
+ ```text
156
+ Speaker: spk11
157
+ Text: Good day, and welcome to the Apple Q3 FY 2021 Earnings Conference Call. Today's call is being recorded. At this time, for opening remarks and introductions, I would like to turn the call over to Tejas Ghala, Director, Investor Relations and Corporate Finance. Please go ahead.
158
+ ```
159
+
160
+
161
+ ## Get Text by Speaker with Speaker Name and Title
162
+
163
+ NOTE: This is a new experimental feature. It includes Speaker Names and Titles.
164
+
165
+ ```python
166
+ from earningscall import get_company
167
+
168
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
169
+
170
+ transcript = company.get_transcript(year=2021, quarter=3, level=2)
171
+
172
+ speaker = transcript.speakers[1] # Get second speaker
173
+ speaker_label = speaker.speaker_info.name
174
+ text = speaker.text
175
+ print("Speaker:")
176
+ print(f" Name: {speaker.speaker_info.name}")
177
+ print(f" Title: {speaker.speaker_info.title}")
178
+ print()
179
+ print(f"Text: {text}")
180
+ ```
181
+
182
+ Output
183
+
184
+ ```text
185
+ Speaker:
186
+ Name: Tejas Ghala
187
+ Title: Director, Investor Relations and Corporate Finance
188
+
189
+ Text: Thank you. Good afternoon, and thank you for joining us. Speaking first today is Apple CEO Tim Cook, and he'll be followed by CFO Luca Maestri. After that, we'll open the call to questions from analysts. Please note that some of the information you'll hear during our discussion today will consist of forward-looking statements, including without limitation, those regarding revenue, gross margin, operating expenses, other income and expenses, taxes, capital allocation, and future business outlook, including the potential impact of COVID-19 on the company's business and results of operations. These statements involve risks and uncertainties that may cause actual results or trends to differ materially from our forecast. For more information, please refer to the risk factors discussed in Apple's most recently filed annual report on Form 10-K and the Form 8-K filed with the SEC today, along with the associated press release. Apple assumes no obligation to update any forward-looking statements or information which speak as of their respective dates. I'd like to now turn the call over to Tim for introductory remarks.
190
+ ```
191
+
192
+ ## Get Word-Level Timestamps
193
+
194
+ If you want to get the word-level timestamps, you can do so by setting the `level` parameter to `3`.
195
+
196
+ Each timestamp is the number of seconds since the start of the transcript.
197
+
198
+ NOTE: Level `3` data is provided in any plan that includes Enhanced Transcript Data.
199
+
200
+
201
+ ```python
202
+ from earningscall import get_company
203
+
204
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
205
+
206
+ transcript = company.get_transcript(year=2021, quarter=3, level=3)
207
+
208
+ first_speaker = transcript.speakers[0]
209
+ words_and_start_times = list(zip(first_speaker.words, first_speaker.start_times))
210
+ print(f"Speaker: {first_speaker.speaker}")
211
+ print(f"Words with start times: {words_and_start_times}")
212
+ ```
213
+
214
+ Output
215
+
216
+ ```text
217
+ Speaker: spk11
218
+ Words with start times: [('Good', 0.049), ('day,', 0.229), ('and', 0.489), ('welcome', 0.609), ('to', 0.929), ('the', 1.029), ('Apple', 1.229), ('Q3', 1.629), ('FY', 2.65), ('2021', 2.6599999999999997), ('Earnings', 3.81), ('Conference', 4.17), ('Call.', 4.55), ("Today's", 5.411), ('call', 5.811), ('is', 6.111), ('being', 6.271), ('recorded.', 6.471), ('At', 7.571), ('this', 7.671), ('time,', 7.871), ('for', 8.111), ('opening', 8.351), ('remarks', 8.631), ('and', 9.092), ('introductions,', 9.232), ('I', 9.832), ('would', 9.912), ('like', 10.052), ('to', 10.192), ('turn', 10.292), ('the', 10.492), ('call', 10.592), ('over', 10.872), ('to', 11.052), ('Tejas', 11.152), ('Ghala,', 11.532), ('Director,', 12.112), ('Investor', 12.533), ('Relations', 12.873), ('and', 13.353), ('Corporate', 13.473), ('Finance.', 13.773), ('Please', 14.413), ('go', 14.653), ('ahead.', 14.793)]
219
+ ```
220
+
221
+ ## Get Prepared Remarks and Q&A for a Single Quarter
222
+
223
+ If you want to get the prepared remarks and Q&A for a single quarter, you can do so by setting the `level` parameter to `4`.
224
+
225
+ NOTE: Level `4` data is provided in any plan that includes Enhanced Transcript Data.
226
+
227
+ ```python
228
+ from earningscall import get_company
229
+
230
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
231
+
232
+ transcript = company.get_transcript(year=2021, quarter=3, level=4)
233
+ print(f"{company} Q3 2021 Prepared Remarks: \"{transcript.prepared_remarks[:100]}...\"")
234
+ print(f"{company} Q3 2021 Q&A: \"{transcript.questions_and_answers[:100]}...\"")
235
+ ```
236
+
237
+ Output
238
+
239
+ ```text
240
+ Apple Inc. Q3 2021 Prepared Remarks: "Good day, and welcome to the Apple Q3 FY 2021 Earnings Conference Call. Today's call is being record..."
241
+ Apple Inc. Q3 2021 Q&A: "Our first question comes from Katie Huberty from Morgan Stanley. Please go ahead. Hello, Katie. Your..."
242
+ ```
243
+
244
+ ## Download Audio File
245
+
246
+ If you want to download the audio file for a single quarter, you can call the `download_audio_file` function.
247
+
248
+ ```python
249
+ from earningscall import get_company
250
+
251
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
252
+
253
+ print("Downloading audio file for Apple Inc. Q3 2021...")
254
+ audio_file = company.download_audio_file(year=2021, quarter=3, file_name="Apple Q3 2021.mp3")
255
+ ```
256
+
129
257
  ## List All Companies
130
258
 
131
259
  ```python
@@ -0,0 +1,258 @@
1
+ # EarningsCall Python Library
2
+
3
+ [![pypi](https://img.shields.io/pypi/v/earningscall.svg)](https://pypi.org/project/earningscall/)
4
+ [![Build Status](https://github.com/EarningsCall/earningscall-python/actions/workflows/release.yml/badge.svg?branch=master)](https://github.com/EarningsCall/earningscall-python/actions?query=branch%3Amaster)
5
+ [![Coverage Status](https://coveralls.io/repos/github/EarningsCall/earningscall-python/badge.svg?branch=master)](https://coveralls.io/github/EarningsCall/earningscall-python?branch=master)
6
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/earningscall?color=blue)](https://pypi.org/project/earningscall/)
7
+
8
+ The EarningsCall Python library provides convenient access to the [EarningsCall API](https://earningscall.biz/api-guide) from
9
+ applications written in the Python language. It includes a pre-defined set of
10
+ classes for API resources that initialize themselves dynamically from API
11
+ responses.
12
+
13
+ # Requirements
14
+
15
+ * Python 3.8+
16
+
17
+ # Installation
18
+
19
+ You don't need this source code unless you want to modify the package. If you just want to use the package, just run:
20
+
21
+ ```sh
22
+ pip install --upgrade earningscall
23
+ ```
24
+
25
+ ## Get Transcript for a Single Quarter
26
+
27
+ ```python
28
+ from earningscall import get_company
29
+
30
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
31
+
32
+ transcript = company.get_transcript(year=2021, quarter=3)
33
+ print(f"{company} Q3 2021 Transcript Text: \"{transcript.text[:100]}...\"")
34
+ ```
35
+
36
+ Output
37
+
38
+ ```text
39
+ Apple Inc. Q3 2021 Transcript Text: "Good day, and welcome to the Apple Q3 FY 2021 Earnings Conference Call. Today's call is being record..."
40
+ ```
41
+
42
+
43
+ ## Get All Transcripts for a company
44
+
45
+
46
+ ```python
47
+ from datetime import datetime
48
+
49
+ from earningscall import get_company
50
+
51
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
52
+
53
+ print(f"Getting all transcripts for: {company}..")
54
+ # Retrieve all earnings conference call events for a company, and iterate through each one
55
+ for event in company.events():
56
+ if datetime.now().timestamp() < event.conference_date.timestamp():
57
+ print(f"* {company.company_info.symbol} Q{event.quarter} {event.year} -- skipping, conference date in the future")
58
+ continue
59
+ transcript = company.get_transcript(event=event) # Fetch the earnings call transcript for this event
60
+ print(f"* Q{event.quarter} {event.year}")
61
+ if transcript:
62
+ print(f" Transcript Text: \"{transcript.text[:100]}...\"")
63
+ else:
64
+ print(f" No transcript found.")
65
+
66
+ ```
67
+
68
+ Output
69
+
70
+ ```text
71
+ Getting all transcripts for: Apple Inc...
72
+ * Q4 2023
73
+ Transcript Text: "Good day and welcome to the Apple Q4 Fiscal Year 2023 earnings conference call. Today's call is bein..."
74
+ * Q3 2023
75
+ Transcript Text: "Good day and welcome to the Apple Q3 Fiscal Year 2023 earnings conference call. Today's call is bein..."
76
+ * Q2 2023
77
+ Transcript Text: "At this time for opening remarks and introductions, I would like to turn the call over to Suhasini T..."
78
+ * Q1 2023
79
+
80
+ ...
81
+ ```
82
+
83
+
84
+ ## Get Text by Speaker
85
+
86
+ If you want to get the text by speaker, you can do so by setting the `level` parameter to `2`.
87
+
88
+ NOTE: Level `2` data is provided in any plan that includes Enhanced Transcript Data.
89
+
90
+ ```python
91
+ from earningscall import get_company
92
+
93
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
94
+
95
+ transcript = company.get_transcript(year=2021, quarter=3, level=2)
96
+
97
+ first_speaker = transcript.speakers[0]
98
+ speaker_label = first_speaker.speaker
99
+ text = first_speaker.text
100
+ print(f"Speaker: {speaker_label}\nText: {text}")
101
+ ```
102
+
103
+ Output
104
+
105
+ ```text
106
+ Speaker: spk11
107
+ Text: Good day, and welcome to the Apple Q3 FY 2021 Earnings Conference Call. Today's call is being recorded. At this time, for opening remarks and introductions, I would like to turn the call over to Tejas Ghala, Director, Investor Relations and Corporate Finance. Please go ahead.
108
+ ```
109
+
110
+
111
+ ## Get Text by Speaker with Speaker Name and Title
112
+
113
+ NOTE: This is a new experimental feature. It includes Speaker Names and Titles.
114
+
115
+ ```python
116
+ from earningscall import get_company
117
+
118
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
119
+
120
+ transcript = company.get_transcript(year=2021, quarter=3, level=2)
121
+
122
+ speaker = transcript.speakers[1] # Get second speaker
123
+ speaker_label = speaker.speaker_info.name
124
+ text = speaker.text
125
+ print("Speaker:")
126
+ print(f" Name: {speaker.speaker_info.name}")
127
+ print(f" Title: {speaker.speaker_info.title}")
128
+ print()
129
+ print(f"Text: {text}")
130
+ ```
131
+
132
+ Output
133
+
134
+ ```text
135
+ Speaker:
136
+ Name: Tejas Ghala
137
+ Title: Director, Investor Relations and Corporate Finance
138
+
139
+ Text: Thank you. Good afternoon, and thank you for joining us. Speaking first today is Apple CEO Tim Cook, and he'll be followed by CFO Luca Maestri. After that, we'll open the call to questions from analysts. Please note that some of the information you'll hear during our discussion today will consist of forward-looking statements, including without limitation, those regarding revenue, gross margin, operating expenses, other income and expenses, taxes, capital allocation, and future business outlook, including the potential impact of COVID-19 on the company's business and results of operations. These statements involve risks and uncertainties that may cause actual results or trends to differ materially from our forecast. For more information, please refer to the risk factors discussed in Apple's most recently filed annual report on Form 10-K and the Form 8-K filed with the SEC today, along with the associated press release. Apple assumes no obligation to update any forward-looking statements or information which speak as of their respective dates. I'd like to now turn the call over to Tim for introductory remarks.
140
+ ```
141
+
142
+ ## Get Word-Level Timestamps
143
+
144
+ If you want to get the word-level timestamps, you can do so by setting the `level` parameter to `3`.
145
+
146
+ Each timestamp is the number of seconds since the start of the transcript.
147
+
148
+ NOTE: Level `3` data is provided in any plan that includes Enhanced Transcript Data.
149
+
150
+
151
+ ```python
152
+ from earningscall import get_company
153
+
154
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
155
+
156
+ transcript = company.get_transcript(year=2021, quarter=3, level=3)
157
+
158
+ first_speaker = transcript.speakers[0]
159
+ words_and_start_times = list(zip(first_speaker.words, first_speaker.start_times))
160
+ print(f"Speaker: {first_speaker.speaker}")
161
+ print(f"Words with start times: {words_and_start_times}")
162
+ ```
163
+
164
+ Output
165
+
166
+ ```text
167
+ Speaker: spk11
168
+ Words with start times: [('Good', 0.049), ('day,', 0.229), ('and', 0.489), ('welcome', 0.609), ('to', 0.929), ('the', 1.029), ('Apple', 1.229), ('Q3', 1.629), ('FY', 2.65), ('2021', 2.6599999999999997), ('Earnings', 3.81), ('Conference', 4.17), ('Call.', 4.55), ("Today's", 5.411), ('call', 5.811), ('is', 6.111), ('being', 6.271), ('recorded.', 6.471), ('At', 7.571), ('this', 7.671), ('time,', 7.871), ('for', 8.111), ('opening', 8.351), ('remarks', 8.631), ('and', 9.092), ('introductions,', 9.232), ('I', 9.832), ('would', 9.912), ('like', 10.052), ('to', 10.192), ('turn', 10.292), ('the', 10.492), ('call', 10.592), ('over', 10.872), ('to', 11.052), ('Tejas', 11.152), ('Ghala,', 11.532), ('Director,', 12.112), ('Investor', 12.533), ('Relations', 12.873), ('and', 13.353), ('Corporate', 13.473), ('Finance.', 13.773), ('Please', 14.413), ('go', 14.653), ('ahead.', 14.793)]
169
+ ```
170
+
171
+ ## Get Prepared Remarks and Q&A for a Single Quarter
172
+
173
+ If you want to get the prepared remarks and Q&A for a single quarter, you can do so by setting the `level` parameter to `4`.
174
+
175
+ NOTE: Level `4` data is provided in any plan that includes Enhanced Transcript Data.
176
+
177
+ ```python
178
+ from earningscall import get_company
179
+
180
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
181
+
182
+ transcript = company.get_transcript(year=2021, quarter=3, level=4)
183
+ print(f"{company} Q3 2021 Prepared Remarks: \"{transcript.prepared_remarks[:100]}...\"")
184
+ print(f"{company} Q3 2021 Q&A: \"{transcript.questions_and_answers[:100]}...\"")
185
+ ```
186
+
187
+ Output
188
+
189
+ ```text
190
+ Apple Inc. Q3 2021 Prepared Remarks: "Good day, and welcome to the Apple Q3 FY 2021 Earnings Conference Call. Today's call is being record..."
191
+ Apple Inc. Q3 2021 Q&A: "Our first question comes from Katie Huberty from Morgan Stanley. Please go ahead. Hello, Katie. Your..."
192
+ ```
193
+
194
+ ## Download Audio File
195
+
196
+ If you want to download the audio file for a single quarter, you can call the `download_audio_file` function.
197
+
198
+ ```python
199
+ from earningscall import get_company
200
+
201
+ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
202
+
203
+ print("Downloading audio file for Apple Inc. Q3 2021...")
204
+ audio_file = company.download_audio_file(year=2021, quarter=3, file_name="Apple Q3 2021.mp3")
205
+ ```
206
+
207
+ ## List All Companies
208
+
209
+ ```python
210
+ from earningscall import get_all_companies
211
+
212
+ for company in get_all_companies():
213
+ print(f"{company.company_info} -- {company.company_info.sector} -- {company.company_info.industry}")
214
+ ```
215
+
216
+ By default, this library grants you access to only two companies, Apple Inc. and Microsoft, Inc.
217
+
218
+ To gain access to 5,000+ companies please [signup here](https://earningscall.biz/api-pricing) to get your API key.
219
+
220
+ Once you have access to your API key, you can set the API Key like this:
221
+
222
+ ```python
223
+ import earningscall
224
+
225
+ earningscall.api_key = "YOUR SECRET API KEY GOES HERE"
226
+ ```
227
+
228
+ Alternatively, you can pass in your API key as an environment variable:
229
+
230
+ ```sh
231
+ export ECALL_API_KEY="YOUR SECRET API KEY GOES HERE"
232
+ python your-python-script.py
233
+ ```
234
+
235
+ ## List S&P 500 Companies
236
+
237
+ ```python
238
+ from earningscall import get_sp500_companies
239
+
240
+ for company in get_sp500_companies():
241
+ print(f"{company.company_info} -- {company.company_info.sector} -- {company.company_info.industry}")
242
+ ```
243
+
244
+
245
+ ## Advanced
246
+
247
+ ### Disable Caching
248
+
249
+ When you call `get_company("aapl")` to retrieve a company, internally the library retrieves metadata
250
+ from the EarningsCall API. By default, it caches this metadata on disk in order to speed up subsequent requests.
251
+
252
+ If you prefer to disable this local caching behavior, you can do so with this code:
253
+
254
+ ```python
255
+ import earningscall
256
+
257
+ earningscall.enable_requests_cache = False
258
+ ```
@@ -1,6 +1,7 @@
1
1
  import importlib
2
2
  import logging
3
3
  import os
4
+ from importlib.metadata import PackageNotFoundError
4
5
  from typing import Optional
5
6
 
6
7
  import requests
@@ -46,8 +47,15 @@ def purge_cache():
46
47
  return cache_session().cache.clear()
47
48
 
48
49
 
50
+ def get_earnings_call_version():
51
+ try:
52
+ return importlib.metadata.version("earningscall")
53
+ except PackageNotFoundError:
54
+ return None
55
+
56
+
49
57
  def get_headers():
50
- earnings_call_version = importlib.metadata.version("earningscall")
58
+ earnings_call_version = get_earnings_call_version()
51
59
  return {
52
60
  "User-Agent": f"EarningsCall Python/{earnings_call_version}",
53
61
  "X-EarningsCall-Version": earnings_call_version,
@@ -92,6 +92,9 @@ class Company:
92
92
  transcript.text = " ".join(map(lambda spk: spk.text, transcript.speakers))
93
93
  elif level == 4:
94
94
  transcript.text = " ".join([transcript.prepared_remarks, transcript.questions_and_answers])
95
+ if transcript.speaker_name_map_v2:
96
+ for speaker in transcript.speakers:
97
+ speaker.speaker_info = transcript.speaker_name_map_v2.get(speaker.speaker)
95
98
  return transcript
96
99
  except requests.exceptions.HTTPError as error:
97
100
  if error.response.status_code == 404:
@@ -1,15 +1,23 @@
1
1
  from dataclasses import dataclass, field
2
- from typing import List, Optional
2
+ from typing import List, Optional, Dict
3
3
 
4
4
  from dataclasses_json import dataclass_json
5
5
 
6
6
  from earningscall.event import EarningsEvent
7
7
 
8
8
 
9
+ @dataclass_json
10
+ @dataclass
11
+ class SpeakerInfo:
12
+ name: str
13
+ title: str
14
+
15
+
9
16
  @dataclass_json
10
17
  @dataclass
11
18
  class Speaker:
12
19
  speaker: str
20
+ speaker_info: Optional[SpeakerInfo] = field(default=None)
13
21
  text: Optional[str] = field(default=None)
14
22
  words: Optional[List[str]] = field(default=None)
15
23
  start_times: Optional[List[float]] = field(default=None)
@@ -23,3 +31,4 @@ class Transcript:
23
31
  speakers: Optional[List[Speaker]] = field(default=None)
24
32
  prepared_remarks: Optional[str] = field(default=None)
25
33
  questions_and_answers: Optional[str] = field(default=None)
34
+ speaker_name_map_v2: Optional[Dict[str, SpeakerInfo]] = field(default=None)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "earningscall"
3
- version = "0.0.20"
3
+ version = "0.0.22"
4
4
  description = "The EarningsCall Python library provides convenient access to the EarningsCall API. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -1,4 +1,5 @@
1
1
  import argparse
2
+ from datetime import datetime
2
3
  import os
3
4
 
4
5
  import earningscall # noqa: F401
@@ -26,6 +27,11 @@ os.makedirs(directory, exist_ok=True)
26
27
  def download_audio_files(company: Company):
27
28
  print(f"Downloading all audio files for: {company}..")
28
29
  for event in company.events():
30
+ if datetime.now().timestamp() < event.conference_date.timestamp():
31
+ print(
32
+ f"* {company.company_info.symbol} Q{event.quarter} {event.year} -- skipping, conference date in the future"
33
+ )
34
+ continue
29
35
  file_name = os.path.join(
30
36
  directory,
31
37
  f"{company.company_info.exchange}_{company.company_info.symbol}_{event.year}_Q{event.quarter}.mp3",
@@ -1,3 +1,4 @@
1
+ from datetime import datetime
1
2
  import os
2
3
 
3
4
  import earningscall # noqa: F401
@@ -14,6 +15,11 @@ os.makedirs(directory, exist_ok=True)
14
15
  def download_audio_files(company: Company):
15
16
  print(f"Downloading all audio files for: {company}..")
16
17
  for event in company.events():
18
+ if datetime.now().timestamp() < event.conference_date.timestamp():
19
+ print(
20
+ f"* {company.company_info.symbol} Q{event.quarter} {event.year} -- skipping, conference date in the future"
21
+ )
22
+ continue
17
23
  file_name = os.path.join(
18
24
  directory,
19
25
  f"{company.company_info.exchange}_{company.company_info.symbol}_{event.year}_Q{event.quarter}.mp3",
@@ -9,5 +9,13 @@ from earningscall import get_company
9
9
 
10
10
  company = get_company("aapl")
11
11
 
12
- transcript = company.get_transcript(year=2021, quarter=3, level=4)
13
- print(f"{company} Q3 2021 Transcript Text: \"{transcript.text[:100]}...\"")
12
+ transcript = company.get_transcript(year=2021, quarter=3, level=2)
13
+
14
+ speaker = transcript.speakers[1]
15
+ speaker_label = speaker.speaker_info.name
16
+ text = speaker.text
17
+ print("Speaker:")
18
+ print(f" Name: {speaker.speaker_info.name}")
19
+ print(f" Title: {speaker.speaker_info.title}")
20
+ print()
21
+ print(f"Text: {text}")