earningscall 0.0.20__py3-none-any.whl → 0.0.22__py3-none-any.whl

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.
earningscall/api.py CHANGED
@@ -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,
earningscall/company.py CHANGED
@@ -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
  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
@@ -1,14 +1,14 @@
1
1
  earningscall/__init__.py,sha256=0mANmPlE7LEWtOGzV2cmmlPfBIWBWlWRDkyqPHJ1jm8,333
2
- earningscall/api.py,sha256=8Wl_JhcptjQpplvQjgODWuKgdfJ4gyj-1KET2vLTYes,4960
3
- earningscall/company.py,sha256=aae_GjA1ffz3wYY0vGvPQ71VpYwRGXU6psurwDdgNuU,6431
2
+ earningscall/api.py,sha256=NkYtMO9yq870Y2s_hWZni-scdc3DA2MO4MyQDAFNgws,5152
3
+ earningscall/company.py,sha256=8HPM_UEoUUOW6mCESktBLpm63HydSk34GWyIv6vZdpw,6625
4
4
  earningscall/errors.py,sha256=EA-d6qIYgQs9csp8JptQiAaYoM0M9HhCGJgKA9GAWPg,440
5
5
  earningscall/event.py,sha256=Jf7KPvpeaF9KkeHe46LbL_HIYLXkyHrs3psq-ZY-bkI,692
6
6
  earningscall/exports.py,sha256=i9UWHY6Lq1OzZTZX_1SdNzrNd_PSlPwpB337lGMK4oM,837
7
7
  earningscall/sectors.py,sha256=Xd6DLkAQ_fQkC2s-N9pReC8b_M3iy77OoFftoZj9FWY,5114
8
8
  earningscall/symbols.py,sha256=39tL7oP1HT8BturwKW7mgS33dX2Y_X8cw5GKK0aV02k,6354
9
- earningscall/transcript.py,sha256=Sm--ruKTEhkHiZSPP4I1njUgQNx_SfEIuQqjlTpLBh0,718
9
+ earningscall/transcript.py,sha256=970kq1-cDOOyuY630bH1-nwWuPHv9K0gABH2HtCEddQ,943
10
10
  earningscall/utils.py,sha256=Qx8KhlumUdzyBSZRKMS6vpWlb8MGZpLKA4OffJaMdCE,1032
11
- earningscall-0.0.20.dist-info/METADATA,sha256=H6qYvL5w8pSsiRRL-vkIqXvYRdkzSGuB8By7K9np698,7177
12
- earningscall-0.0.20.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
13
- earningscall-0.0.20.dist-info/licenses/LICENSE,sha256=ktEB_UcRMg2cQlX9wiDs544xWncWizwS9mEZuGsCLrM,1069
14
- earningscall-0.0.20.dist-info/RECORD,,
11
+ earningscall-0.0.22.dist-info/METADATA,sha256=gaiZWluFyCgXDXxuuZpO5TsNhmulf62TaM8Opwq2CfY,13106
12
+ earningscall-0.0.22.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
13
+ earningscall-0.0.22.dist-info/licenses/LICENSE,sha256=ktEB_UcRMg2cQlX9wiDs544xWncWizwS9mEZuGsCLrM,1069
14
+ earningscall-0.0.22.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.25.0
2
+ Generator: hatchling 1.26.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any