earningscall 0.0.6__py3-none-any.whl → 0.0.8__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,2 +1,6 @@
1
+ from typing import Optional
2
+
1
3
  from earningscall.symbols import Symbols, load_symbols
2
4
  from earningscall.exports import get_company, get_all_companies
5
+
6
+ api_key: Optional[str] = None
earningscall/api.py CHANGED
@@ -2,6 +2,7 @@ import logging
2
2
  import os
3
3
  from typing import Optional
4
4
 
5
+ import earningscall
5
6
  import requests
6
7
 
7
8
 
@@ -9,12 +10,11 @@ log = logging.getLogger(__file__)
9
10
 
10
11
  DOMAIN = os.environ.get("ECALL_DOMAIN", "earningscall.biz")
11
12
  API_BASE = f"https://v2.api.{DOMAIN}"
12
- api_key: Optional[str] = None
13
13
 
14
14
 
15
15
  def get_api_key():
16
- global api_key
17
- if api_key is None:
16
+ api_key = earningscall.api_key
17
+ if not api_key:
18
18
  return os.environ.get("ECALL_API_KEY", "demo")
19
19
  return api_key
20
20
 
earningscall/exports.py CHANGED
@@ -18,5 +18,6 @@ def get_all_companies() -> [Company]:
18
18
 
19
19
 
20
20
  def get_sp500_companies() -> [Company]:
21
+ ## TODO: Actually only return SP500 companies.
21
22
  for company_info in get_symbols().get_all():
22
23
  yield Company(company_info=company_info)
@@ -1,7 +1,9 @@
1
1
  import logging
2
- from dataclasses import dataclass
2
+ from typing import Optional
3
3
 
4
+ from dataclasses import dataclass, field
4
5
  from dataclasses_json import dataclass_json
6
+ from earningscall.event import EarningsEvent
5
7
 
6
8
  log = logging.getLogger(__file__)
7
9
 
@@ -11,4 +13,4 @@ log = logging.getLogger(__file__)
11
13
  class Transcript:
12
14
 
13
15
  text: str
14
-
16
+ event: Optional[EarningsEvent] = field(default=None)
earningscall/utils.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import logging
2
2
  import os
3
3
  import pathlib
4
+ import sys
4
5
 
5
6
  import earningscall
6
7
 
@@ -18,3 +19,15 @@ def data_path(file_name=None):
18
19
 
19
20
  def enable_debug_logs():
20
21
  logging.basicConfig(level=logging.DEBUG)
22
+
23
+
24
+ LOG_FORMAT = "[%(asctime)s] [%(levelname)8s] --- %(message)s (%(filename)s:%(lineno)s)"
25
+
26
+
27
+ def configure_sane_logging(level=logging.DEBUG):
28
+ # Manually set the following loggers to "INFO", since they tend to be VERY noisy, and when we are
29
+ # debugging our own application, we only care about DEBUG logs from OUR application, not these libs.
30
+ for name in ['urllib3']:
31
+ logging.getLogger(name).setLevel(logging.INFO)
32
+ logging.getLogger("filelock").setLevel(logging.WARNING)
33
+ logging.basicConfig(level=level, stream=sys.stdout, format=LOG_FORMAT)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: earningscall
3
- Version: 0.0.6
3
+ Version: 0.0.8
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
@@ -70,7 +70,7 @@ company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
70
70
  print(f"Getting all transcripts for: {company}..")
71
71
  # Retrieve all earnings conference call events for a company, and iterate through each one
72
72
  for event in company.events():
73
- transcript = company.get_transcript(event) # Fetch the earnings call transcript for this event
73
+ transcript = company.get_transcript(event=event) # Fetch the earnings call transcript for this event
74
74
  print(f"* Q{event.quarter} {event.year}")
75
75
  if transcript:
76
76
  print(f" Transcript Text: \"{transcript.text[:100]}...\"")
@@ -0,0 +1,14 @@
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,,
@@ -1,14 +0,0 @@
1
- earningscall/__init__.py,sha256=Hfh2BCnihAqfWV9niZrlfHmTNuL5tEKTW37bAXGLrF0,119
2
- earningscall/api.py,sha256=_RnCSaZSUZJPvr_SiEk7YJZ8tkP9buLDQKReTWOZEPk,1749
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=EfuxNiKnLktlD4ZtBm89qwfKRgKXh3C7bjleEhvBhzQ,590
7
- earningscall/sectors.py,sha256=9aw14krRzdLJSTFC72Nwk3MQaXAIgkTBk5S-KTiki3U,5946
8
- earningscall/symbols.py,sha256=fvqjnCbSAwfZB1dUrBUZFmJQ8C8V9uDzR0_C9RXMfIs,7722
9
- earningscall/transcript.py,sha256=gV0Pqc9iilg4QQc89-ADEIcFQkQhFSnsJo8rvF7zKp0,192
10
- earningscall/utils.py,sha256=wfwlSgFPPxr3GsFAsTjDNg_mLLK9V6p_2CwfetN5RR0,454
11
- earningscall-0.0.6.dist-info/METADATA,sha256=L-e9p7VEpoYTJ8kHvu49XgSU5TjB4Tjhr3KSxGE5BJo,4206
12
- earningscall-0.0.6.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
13
- earningscall-0.0.6.dist-info/licenses/LICENSE,sha256=ktEB_UcRMg2cQlX9wiDs544xWncWizwS9mEZuGsCLrM,1069
14
- earningscall-0.0.6.dist-info/RECORD,,