earningscall 0.0.8__py3-none-any.whl → 0.0.10__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/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from typing import Optional
2
2
 
3
+ from earningscall.exports import get_company, get_all_companies, get_sp500_companies
3
4
  from earningscall.symbols import Symbols, load_symbols
4
- from earningscall.exports import get_company, get_all_companies
5
5
 
6
6
  api_key: Optional[str] = None
earningscall/api.py CHANGED
@@ -2,9 +2,9 @@ import logging
2
2
  import os
3
3
  from typing import Optional
4
4
 
5
- import earningscall
6
5
  import requests
7
6
 
7
+ import earningscall
8
8
 
9
9
  log = logging.getLogger(__file__)
10
10
 
@@ -19,6 +19,10 @@ def get_api_key():
19
19
  return api_key
20
20
 
21
21
 
22
+ def api_key_param():
23
+ return {"apikey": get_api_key()}
24
+
25
+
22
26
  def is_demo_account():
23
27
  return get_api_key() == "demo"
24
28
 
@@ -28,7 +32,7 @@ def get_events(exchange: str,
28
32
 
29
33
  log.debug(f"get_events exchange: {exchange} symbol: {symbol}")
30
34
  params = {
31
- "apikey": get_api_key(),
35
+ **api_key_param(),
32
36
  "exchange": exchange,
33
37
  "symbol": symbol,
34
38
  }
@@ -45,7 +49,7 @@ def get_transcript(exchange: str,
45
49
 
46
50
  log.debug(f"get_transcript year: {year} quarter: {quarter}")
47
51
  params = {
48
- "apikey": get_api_key(),
52
+ **api_key_param(),
49
53
  "exchange": exchange,
50
54
  "symbol": symbol,
51
55
  "year": str(year),
@@ -65,10 +69,14 @@ def get_symbols_v1():
65
69
 
66
70
 
67
71
  def get_symbols_v2():
68
- params = {
69
- "apikey": get_api_key(),
70
- }
71
- response = requests.get(f"{API_BASE}/symbols-v2.txt", params=params)
72
+ response = requests.get(f"{API_BASE}/symbols-v2.txt", params=api_key_param())
73
+ if response.status_code != 200:
74
+ return None
75
+ return response.text
76
+
77
+
78
+ def get_sp500_companies_txt_file():
79
+ response = requests.get(f"{API_BASE}/symbols/sp500.txt", params=api_key_param())
72
80
  if response.status_code != 200:
73
81
  return None
74
82
  return response.text
earningscall/errors.py CHANGED
@@ -23,7 +23,3 @@ class ClientError(BaseError):
23
23
 
24
24
  class InsufficientApiAccessError(ClientError):
25
25
  pass
26
-
27
-
28
- class CompanyNotFound(ClientError):
29
- pass
earningscall/event.py CHANGED
@@ -1,8 +1,8 @@
1
1
  import logging
2
- from dataclasses import dataclass, field
3
2
  from datetime import datetime
4
3
  from typing import Optional
5
4
 
5
+ from dataclasses import dataclass, field
6
6
  from dataclasses_json import config
7
7
  from dataclasses_json import dataclass_json
8
8
  from marshmallow import fields
earningscall/exports.py CHANGED
@@ -1,8 +1,8 @@
1
1
  from typing import Optional
2
2
 
3
- from earningscall.symbols import get_symbols
4
-
3
+ from earningscall.api import get_sp500_companies_txt_file
5
4
  from earningscall.company import Company
5
+ from earningscall.symbols import get_symbols
6
6
 
7
7
 
8
8
  def get_company(symbol: str) -> Optional[Company]:
@@ -18,6 +18,10 @@ def get_all_companies() -> [Company]:
18
18
 
19
19
 
20
20
  def get_sp500_companies() -> [Company]:
21
- ## TODO: Actually only return SP500 companies.
22
- for company_info in get_symbols().get_all():
23
- yield Company(company_info=company_info)
21
+ resp = get_sp500_companies_txt_file()
22
+ if not resp:
23
+ return []
24
+ for ticker_symbol in resp.split("\n"):
25
+ company_info = get_symbols().lookup_company(ticker_symbol)
26
+ if company_info:
27
+ yield Company(company_info=company_info)
earningscall/symbols.py CHANGED
@@ -129,8 +129,8 @@ class Symbols:
129
129
  except KeyError:
130
130
  pass
131
131
  if is_demo_account():
132
- raise InsufficientApiAccessError(f"For full access, please get an API Key. See: "
133
- f"https://earningscall.biz/api-pricing")
132
+ raise InsufficientApiAccessError(f"\"{symbol}\" requires an API Key for access. To get your API Key,"
133
+ f" see: https://earningscall.biz/api-pricing")
134
134
  return None
135
135
 
136
136
  def remove_exchange_symbol(self, exchange_symbol: str):
@@ -3,6 +3,7 @@ from typing import Optional
3
3
 
4
4
  from dataclasses import dataclass, field
5
5
  from dataclasses_json import dataclass_json
6
+
6
7
  from earningscall.event import EarningsEvent
7
8
 
8
9
  log = logging.getLogger(__file__)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: earningscall
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: The EarningsCall Python library.
5
5
  Project-URL: Homepage, https://earningscall.biz
6
6
  Project-URL: Documentation, https://github.com/EarningsCall/earningscall-python
@@ -9,6 +9,27 @@ Project-URL: Issues, https://github.com/EarningsCall/earningscall-python/issues
9
9
  Project-URL: Source, https://github.com/EarningsCall/earningscall-python
10
10
  Project-URL: Changelog, https://github.com/EarningsCall/earningscall-python/blob/master/CHANGELOG.md
11
11
  Author-email: EarningsCall <dev@earningscall.biz>
12
+ License: MIT License
13
+
14
+ Copyright (c) 2024 EarningsCall
15
+
16
+ Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ of this software and associated documentation files (the "Software"), to deal
18
+ in the Software without restriction, including without limitation the rights
19
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ copies of the Software, and to permit persons to whom the Software is
21
+ furnished to do so, subject to the following conditions:
22
+
23
+ The above copyright notice and this permission notice shall be included in all
24
+ copies or substantial portions of the Software.
25
+
26
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
+ SOFTWARE.
12
33
  License-File: LICENSE
13
34
  Requires-Python: >=3.8
14
35
  Requires-Dist: dataclasses-json>=0.6.4
@@ -44,7 +65,6 @@ pip install --upgrade earningscall
44
65
  ```python
45
66
  from earningscall import get_company
46
67
 
47
-
48
68
  company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
49
69
 
50
70
  transcript = company.get_transcript(year=2021, quarter=3)
@@ -64,7 +84,6 @@ Apple Inc. Q3 2021 Transcript Text: "Good day, and welcome to the Apple Q3 FY 20
64
84
  ```python
65
85
  from earningscall import get_company
66
86
 
67
-
68
87
  company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
69
88
 
70
89
  print(f"Getting all transcripts for: {company}..")
@@ -94,8 +113,6 @@ Getting all transcripts for: Apple Inc...
94
113
  ...
95
114
  ```
96
115
 
97
-
98
-
99
116
  ## List All Companies
100
117
 
101
118
  ```python
@@ -125,3 +142,13 @@ Alternatively, you can pass in your API key as an environment variable:
125
142
  export ECALL_API_KEY="YOUR SECRET API KEY GOES HERE"
126
143
  python your-python-script.py
127
144
  ```
145
+
146
+ ## List S&P 500 Companies
147
+
148
+ ```python
149
+ from earningscall import get_sp500_companies
150
+
151
+ for company in get_sp500_companies():
152
+ print(f"{company.company_info} -- {company.company_info.sector} -- {company.company_info.industry}")
153
+ ```
154
+
@@ -0,0 +1,14 @@
1
+ earningscall/__init__.py,sha256=LvXzPzsPyckMUVggfB5sklTAaswKsSG1IJ8ImC-fvTc,200
2
+ earningscall/api.py,sha256=-nqxFGrTinCFCj8_wA-fkyrqr-WfDS50sMAh2UGdBR0,1958
3
+ earningscall/company.py,sha256=VyiHOajDBAx-G6dgWrPBUwWKjDpBvb0moZIpULPmiKA,1765
4
+ earningscall/errors.py,sha256=_m8CvAcyWQprdyTNzYjdoCX5nUZpEP7rG4c5-eLmxno,441
5
+ earningscall/event.py,sha256=Gdda4829tWlrlFn38r8KOaI-IJzf-ambiNojKyr9XtY,689
6
+ earningscall/exports.py,sha256=wA6d4-AJyT-0Wz8g_j-3rFHHhnXHx5V1GCsaPJMatFc,814
7
+ earningscall/sectors.py,sha256=9aw14krRzdLJSTFC72Nwk3MQaXAIgkTBk5S-KTiki3U,5946
8
+ earningscall/symbols.py,sha256=StqRc_C2hFdlhCMEKpytfUmsruCSHY0WPQQIVIejF9k,7748
9
+ earningscall/transcript.py,sha256=rLH2bGrrgUmS8XZGAPUP7msiIcL7f4ABmbnVJWXI28c,329
10
+ earningscall/utils.py,sha256=Qx8KhlumUdzyBSZRKMS6vpWlb8MGZpLKA4OffJaMdCE,1032
11
+ earningscall-0.0.10.dist-info/METADATA,sha256=kfOIWa_oFRM35njNOeUIQHKxs23dS_9omh4nt3ieke8,5679
12
+ earningscall-0.0.10.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
13
+ earningscall-0.0.10.dist-info/licenses/LICENSE,sha256=ktEB_UcRMg2cQlX9wiDs544xWncWizwS9mEZuGsCLrM,1069
14
+ earningscall-0.0.10.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- earningscall/__init__.py,sha256=HTwEYkAem1VAYHaNtsqWMC5O_UGZPELVMqzk6txCo3Q,179
2
- earningscall/api.py,sha256=5_cdygmB-iyZH5ACLDmk5ctYqljKNXSe22FJ7Ws9Lfs,1751
3
- earningscall/company.py,sha256=VyiHOajDBAx-G6dgWrPBUwWKjDpBvb0moZIpULPmiKA,1765
4
- earningscall/errors.py,sha256=YTLkbhzWT_AURRL1IMlkkAKUiIW1L4V9Qh99bZnOtd8,488
5
- earningscall/event.py,sha256=a5mcyfuCqPCopcKQUZ1HJyqHfAf-RNKnux_o68DIUHM,689
6
- earningscall/exports.py,sha256=5mLO17Sf0XL8VnglIMIQy19riT2AYkZsyiN6nZ3q0Gk,641
7
- earningscall/sectors.py,sha256=9aw14krRzdLJSTFC72Nwk3MQaXAIgkTBk5S-KTiki3U,5946
8
- earningscall/symbols.py,sha256=fvqjnCbSAwfZB1dUrBUZFmJQ8C8V9uDzR0_C9RXMfIs,7722
9
- earningscall/transcript.py,sha256=yMu3Eib_9by0vHZobDGQFqS4OZ3_4NnYgAk0cGDbfQM,328
10
- earningscall/utils.py,sha256=Qx8KhlumUdzyBSZRKMS6vpWlb8MGZpLKA4OffJaMdCE,1032
11
- earningscall-0.0.8.dist-info/METADATA,sha256=tnnYzTm9EZ3Xc1bd0TSIl3iwe-E4uI4M544fWBXi7Vs,4212
12
- earningscall-0.0.8.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
13
- earningscall-0.0.8.dist-info/licenses/LICENSE,sha256=ktEB_UcRMg2cQlX9wiDs544xWncWizwS9mEZuGsCLrM,1069
14
- earningscall-0.0.8.dist-info/RECORD,,