earningscall 0.0.23__tar.gz → 0.0.25__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.23 → earningscall-0.0.25}/CHANGELOG.md +12 -0
  2. {earningscall-0.0.23 → earningscall-0.0.25}/PKG-INFO +8 -4
  3. {earningscall-0.0.23 → earningscall-0.0.25}/README.md +5 -2
  4. {earningscall-0.0.23 → earningscall-0.0.25}/TODO.md +4 -0
  5. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/api.py +7 -8
  6. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/company.py +2 -1
  7. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/exports.py +20 -2
  8. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/symbols.py +7 -5
  9. {earningscall-0.0.23 → earningscall-0.0.25}/pyproject.toml +1 -1
  10. {earningscall-0.0.23 → earningscall-0.0.25}/.github/workflows/release.yml +0 -0
  11. {earningscall-0.0.23 → earningscall-0.0.25}/.github/workflows/test.yml +0 -0
  12. {earningscall-0.0.23 → earningscall-0.0.25}/.gitignore +0 -0
  13. {earningscall-0.0.23 → earningscall-0.0.25}/.python-version +0 -0
  14. {earningscall-0.0.23 → earningscall-0.0.25}/DEVELOPMENT.md +0 -0
  15. {earningscall-0.0.23 → earningscall-0.0.25}/LICENSE +0 -0
  16. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/__init__.py +0 -0
  17. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/errors.py +0 -0
  18. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/event.py +0 -0
  19. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/sectors.py +0 -0
  20. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/transcript.py +0 -0
  21. {earningscall-0.0.23 → earningscall-0.0.25}/earningscall/utils.py +0 -0
  22. {earningscall-0.0.23 → earningscall-0.0.25}/hatch.toml +0 -0
  23. {earningscall-0.0.23 → earningscall-0.0.25}/scripts/download_audio_files.py +0 -0
  24. {earningscall-0.0.23 → earningscall-0.0.25}/scripts/download_single_audio_file.py +0 -0
  25. {earningscall-0.0.23 → earningscall-0.0.25}/scripts/download_sp500_audio_files.py +0 -0
  26. {earningscall-0.0.23 → earningscall-0.0.25}/scripts/get_all_company_transcripts.py +0 -0
  27. {earningscall-0.0.23 → earningscall-0.0.25}/scripts/get_single_transcript.py +0 -0
  28. {earningscall-0.0.23 → earningscall-0.0.25}/scripts/list_companies.py +0 -0
  29. {earningscall-0.0.23 → earningscall-0.0.25}/setup.cfg +0 -0
  30. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/aapl-q1-2022-advanced-data-level-2.yaml +0 -0
  31. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/aapl-q1-2022-advanced-data-level-3.yaml +0 -0
  32. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/aapl-q1-2022-advanced-data-level-4.yaml +0 -0
  33. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/aapl-q1-2022-speaker-name-map-v2.yaml +0 -0
  34. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/aapl-q1-2030-not-authorized-l2.yaml +0 -0
  35. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/aapl-q1-2030-not-authorized.yaml +0 -0
  36. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/aapl-q1-2030-not-found.yaml +0 -0
  37. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/aapl-q1-2030-server-error.yaml +0 -0
  38. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/demo-symbols-v2-alpha.yaml +0 -0
  39. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/demo-symbols-v2.yaml +0 -0
  40. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/meta-q3-2024-not-authorized.yaml +0 -0
  41. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/meta-q3-2024-not-found.yaml +0 -0
  42. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/meta-q3-2024-other-error.yaml +0 -0
  43. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/msft-company-events.yaml +0 -0
  44. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/msft-q1-2022-audio-file-short-clip.yaml +0 -0
  45. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/msft-transcript-response.yaml +0 -0
  46. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/sp500-company-list-failed.yaml +0 -0
  47. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/sp500-company-list.yaml +0 -0
  48. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/symbols-v2-missing-edge-cases.yaml +0 -0
  49. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/symbols-v2.yaml +0 -0
  50. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/symbols.txt +0 -0
  51. {earningscall-0.0.23 → earningscall-0.0.25}/tests/data/symbols.yaml +0 -0
  52. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_company.py +0 -0
  53. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_download_audio_files.py +0 -0
  54. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_earnings_event.py +0 -0
  55. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_errors.py +0 -0
  56. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_exports.py +0 -0
  57. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_get_company_events.py +0 -0
  58. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_get_sp500_companies_api.py +0 -0
  59. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_get_transcript.py +0 -0
  60. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_helper.py +0 -0
  61. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_responses_mocking.py +0 -0
  62. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_sectors.py +0 -0
  63. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_symbols.py +0 -0
  64. {earningscall-0.0.23 → earningscall-0.0.25}/tests/test_utils.py +0 -0
@@ -1,3 +1,15 @@
1
+ # Changelog
2
+
3
+ ## Release `0.0.25` - 2024-12-15
4
+
5
+ * Bump version for PyPI release (no changes to the code).
6
+
7
+ ## Release `0.0.24` - 2024-12-15
8
+
9
+ * Remove extraneous debug logging.
10
+ * Add CBOE exchange to the list of exchanges.
11
+ * Support env variable "EARNINGSCALL_API_KEY" for key.
12
+
1
13
  ## Release `0.0.23` - 2024-11-24
2
14
 
3
15
  * Allow `None` for optional fields in SpeakerInfo data structure.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: earningscall
3
- Version: 0.0.23
3
+ Version: 0.0.25
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,6 +30,7 @@ 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
33
34
  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
34
35
  Classifier: Development Status :: 3 - Alpha
35
36
  Classifier: Intended Audience :: Developers
@@ -55,6 +56,9 @@ Description-Content-Type: text/markdown
55
56
  [![Coverage Status](https://coveralls.io/repos/github/EarningsCall/earningscall-python/badge.svg?branch=master)](https://coveralls.io/github/EarningsCall/earningscall-python?branch=master)
56
57
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/earningscall?color=blue)](https://pypi.org/project/earningscall/)
57
58
 
59
+ [![Python](https://img.shields.io/badge/Python-14354C?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/)
60
+
61
+
58
62
  The EarningsCall Python library provides convenient access to the [EarningsCall API](https://earningscall.biz/api-guide) from
59
63
  applications written in the Python language. It includes a pre-defined set of
60
64
  classes for API resources that initialize themselves dynamically from API
@@ -272,13 +276,13 @@ Once you have access to your API key, you can set the API Key like this:
272
276
  ```python
273
277
  import earningscall
274
278
 
275
- earningscall.api_key = "YOUR SECRET API KEY GOES HERE"
279
+ earningscall.api_key = "YOUR-SECRET-API-KEY-GOES-HERE"
276
280
  ```
277
281
 
278
282
  Alternatively, you can pass in your API key as an environment variable:
279
283
 
280
284
  ```sh
281
- export ECALL_API_KEY="YOUR SECRET API KEY GOES HERE"
285
+ export EARNINGSCALL_API_KEY="YOUR-SECRET-API-KEY-GOES-HERE"
282
286
  python your-python-script.py
283
287
  ```
284
288
 
@@ -5,6 +5,9 @@
5
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
6
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/earningscall?color=blue)](https://pypi.org/project/earningscall/)
7
7
 
8
+ [![Python](https://img.shields.io/badge/Python-14354C?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/)
9
+
10
+
8
11
  The EarningsCall Python library provides convenient access to the [EarningsCall API](https://earningscall.biz/api-guide) from
9
12
  applications written in the Python language. It includes a pre-defined set of
10
13
  classes for API resources that initialize themselves dynamically from API
@@ -222,13 +225,13 @@ Once you have access to your API key, you can set the API Key like this:
222
225
  ```python
223
226
  import earningscall
224
227
 
225
- earningscall.api_key = "YOUR SECRET API KEY GOES HERE"
228
+ earningscall.api_key = "YOUR-SECRET-API-KEY-GOES-HERE"
226
229
  ```
227
230
 
228
231
  Alternatively, you can pass in your API key as an environment variable:
229
232
 
230
233
  ```sh
231
- export ECALL_API_KEY="YOUR SECRET API KEY GOES HERE"
234
+ export EARNINGSCALL_API_KEY="YOUR-SECRET-API-KEY-GOES-HERE"
232
235
  python your-python-script.py
233
236
  ```
234
237
 
@@ -1,10 +1,14 @@
1
1
 
2
2
  # ToDos
3
3
 
4
+ * Add optional argument to `get_company` to specify the exchange
4
5
  * Add ability to retrieve advanced transcript data
5
6
  * Raise helpful error if the user tries to make a call that the current plan doesn't support
7
+ * Add streaming support for Audio Data.
8
+ * Verify changing API keys invalidates the cache
6
9
 
7
10
 
8
11
  # Considerations
9
12
 
13
+ * Consider removing all debug logging.
10
14
  * Consider implementing @dataclass and @dataclass_json from scratch to avoid third-party dependency
@@ -19,7 +19,13 @@ API_BASE = f"https://v2.api.{DOMAIN}"
19
19
  def get_api_key():
20
20
  if earningscall.api_key:
21
21
  return earningscall.api_key
22
- return os.environ.get("ECALL_API_KEY", "demo")
22
+ e_call_key = os.environ.get("ECALL_API_KEY")
23
+ earnings_call_key = os.environ.get("EARNINGSCALL_API_KEY")
24
+ if e_call_key:
25
+ return e_call_key
26
+ if earnings_call_key:
27
+ return earnings_call_key
28
+ return "demo"
23
29
 
24
30
 
25
31
  def api_key_param():
@@ -99,9 +105,7 @@ def do_get(
99
105
 
100
106
 
101
107
  def get_events(exchange: str, symbol: str):
102
- log.debug(f"get_events exchange: {exchange} symbol: {symbol}")
103
108
  params = {
104
- **api_key_param(),
105
109
  "exchange": exchange,
106
110
  "symbol": symbol,
107
111
  }
@@ -129,9 +133,7 @@ def get_transcript(
129
133
 
130
134
  :return: The transcript for the given exchange, symbol, year, and quarter.
131
135
  """
132
- log.debug(f"get_transcript exchange: {exchange} symbol: {symbol} year: {year} quarter: {quarter} level: {level}")
133
136
  params = {
134
- **api_key_param(),
135
137
  "exchange": exchange,
136
138
  "symbol": symbol,
137
139
  "year": str(year),
@@ -144,7 +146,6 @@ def get_transcript(
144
146
 
145
147
 
146
148
  def get_symbols_v2():
147
- log.debug("get_symbols_v2")
148
149
  response = do_get("symbols-v2.txt", use_cache=True)
149
150
  if response.status_code != 200:
150
151
  return None
@@ -152,7 +153,6 @@ def get_symbols_v2():
152
153
 
153
154
 
154
155
  def get_sp500_companies_txt_file():
155
- log.debug("get_sp500_companies_txt_file")
156
156
  response = do_get("symbols/sp500.txt", use_cache=True)
157
157
  if response.status_code != 200:
158
158
  return None
@@ -178,7 +178,6 @@ def download_audio_file(
178
178
  :rtype Optional[str]: The filename of the downloaded audio file.
179
179
  """
180
180
  params = {
181
- **api_key_param(),
182
181
  "exchange": exchange,
183
182
  "symbol": symbol,
184
183
  "year": str(year),
@@ -15,6 +15,8 @@ log = logging.getLogger(__file__)
15
15
  class Company:
16
16
  """
17
17
  A class representing a company.
18
+
19
+ Can be used to retrieve events, transcripts, and audio files.
18
20
  """
19
21
 
20
22
  company_info: CompanyInfo
@@ -129,7 +131,6 @@ class Company:
129
131
 
130
132
  :return: The audio for the given year and quarter.
131
133
  """
132
- log.info(f"Downloading audio file for {self.company_info.symbol} {event}")
133
134
  if not self.company_info.exchange or not self.company_info.symbol:
134
135
  return None
135
136
  if (not year or not quarter) and event:
@@ -5,19 +5,37 @@ from earningscall.company import Company
5
5
  from earningscall.symbols import get_symbols
6
6
 
7
7
 
8
- def get_company(symbol: str) -> Optional[Company]:
9
- company_info = get_symbols().lookup_company(symbol)
8
+ def get_company(symbol: str, exchange: Optional[str] = None) -> Optional[Company]:
9
+ """
10
+ Get a company by symbol and optionally an exchange.
11
+
12
+ :param str symbol: The symbol to get the company for.
13
+ :param Optional[str] exchange: The exchange to get the company for.
14
+
15
+ :return: The company for the given symbol and exchange.
16
+ """
17
+ company_info = get_symbols().lookup_company(symbol=symbol, exchange=exchange)
10
18
  if company_info:
11
19
  return Company(company_info=company_info)
12
20
  return None
13
21
 
14
22
 
15
23
  def get_all_companies() -> Iterator[Company]:
24
+ """
25
+ Get all companies.
26
+
27
+ :return: An iterator of all companies that is available to the current API plan.
28
+ """
16
29
  for company_info in get_symbols().get_all():
17
30
  yield Company(company_info=company_info)
18
31
 
19
32
 
20
33
  def get_sp500_companies() -> Iterator[Company]:
34
+ """
35
+ Get all S&P 500 companies.
36
+
37
+ :return: An iterator of all S&P 500 companies that is available to the current API plan.
38
+ """
21
39
  resp = get_sp500_companies_txt_file()
22
40
  if not resp:
23
41
  return
@@ -8,7 +8,7 @@ from earningscall.errors import InsufficientApiAccessError
8
8
  from earningscall.sectors import sector_to_index, industry_to_index, index_to_sector, index_to_industry
9
9
 
10
10
  # WARNING: Add new indexes to the *END* of this list
11
- EXCHANGES_IN_ORDER = ["NYSE", "NASDAQ", "AMEX", "TSX", "TSXV", "OTC", "LSE"]
11
+ EXCHANGES_IN_ORDER = ["NYSE", "NASDAQ", "AMEX", "TSX", "TSXV", "OTC", "LSE", "CBOE"]
12
12
 
13
13
  log = logging.getLogger(__file__)
14
14
 
@@ -98,12 +98,12 @@ class Symbols:
98
98
  self.by_exchange_and_sym = {}
99
99
 
100
100
  def add(self, _sym: CompanyInfo):
101
- size_before = len(self.by_exchange_and_sym)
101
+ # size_before = len(self.by_exchange_and_sym)
102
102
  self.exchanges.add(_sym.exchange)
103
103
  self.by_name[_sym.name].add(_sym)
104
104
  self.by_exchange_and_sym[f"{_sym.exchange}_{_sym.symbol}"] = _sym
105
- if len(self.by_exchange_and_sym) == size_before:
106
- log.debug(f"Duplicate: {_sym}")
105
+ # if len(self.by_exchange_and_sym) == size_before:
106
+ # log.debug(f"Duplicate: {_sym}")
107
107
 
108
108
  def get_all(self) -> Iterator[CompanyInfo]:
109
109
  for _exchange_symbol, _symbol in self.by_exchange_and_sym.items():
@@ -115,7 +115,9 @@ class Symbols:
115
115
  def get_exchange_symbol(self, exchange_symbol: str) -> CompanyInfo:
116
116
  return self.by_exchange_and_sym[exchange_symbol]
117
117
 
118
- def lookup_company(self, symbol: str) -> Optional[CompanyInfo]:
118
+ def lookup_company(self, symbol: str, exchange: Optional[str] = None) -> Optional[CompanyInfo]:
119
+ if exchange:
120
+ return self.get(exchange, symbol.upper())
119
121
  for exchange in EXCHANGES_IN_ORDER:
120
122
  try:
121
123
  _symbol = self.get(exchange, symbol.upper())
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "earningscall"
3
- version = "0.0.23"
3
+ version = "0.0.25"
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 = [
File without changes
File without changes
File without changes
File without changes