Skip to main content

ecal (pronounced ee-cal) is a package for getting a US equity earnings announcement calendar.

For more documentation, please see http://ecal.readthedocs.io.

Installation

ecal can be easily installed with pip:

$ pip install ecal

Usage

ecal is really simple to use. Below you’ll find the basics.

Getting the earnings announcements for a single date

To get the earnings announcements for a single date simply import ecal and call get():

import ecal

cal_df = ecal.get('2017-03-30')

The results will be an earnings calendar in a pandas DataFrame:

           ticker when
date
2017-03-30   AEHR  amc
2017-03-30   ANGO  bmo
2017-03-30   BSET   --
2017-03-30     FC  amc
2017-03-30    LNN  bmo
2017-03-30   SAIC  bmo
2017-03-30   TITN  bmo

The returned DataFrame has the following columns:

ticker

is the ticker symbol on NYSE or NASDAQ.

when

can be bmo which means before market open, amc which means after market close or -- which means no time reported.

If there were no announcements for this day, an empty DataFrame will be returned.

Getting the earnings announcements for a date range

It is equally easy to get the earnings announcements for a date range:

import ecal

cal_df = ecal.get('2018-01-01', '2018-01-05')

Once again the results will be an earnings calendar in a pandas DataFrame:

           ticker when
date
2018-01-04    CMC  bmo
2018-01-04   LNDC  amc
2018-01-04   NEOG  bmo
2018-01-04    RAD  amc
2018-01-04   RECN  amc
2018-01-04    UNF  bmo
2018-01-05   AEHR  amc
2018-01-05   ANGO  bmo
2018-01-05     FC  amc
2018-01-05     LW  bmo
2018-01-05    PKE  bmo
2018-01-05   PSMT  amc
2018-01-05    RPM  bmo
2018-01-05   SONC  amc
2018-01-05    WBA  bmo

Days with no earnings announcements will have no rows in the DataFrame. In the example above, there were no announcements on Jan first, second and third.

It should be noted that ecal fetches earnings announcements from api.earningscalendar.net by default. This source limits us to 1 call per second. However you don’t have to worry about this because the ecal.ECNFetcher throttles calls to the API to prevent rate limiting. That said, please note that this fetcher gets announcements one day at a time which means if you want 30 days, it’s going to take 30 seconds to get that data. Yikes. Fear not… that’s why ecal comes with caching.

Caching

ecal supports caching so that repeated calls to ecal.get() don’t actually make calls to the server. Runtime caching is enabled by default which means calls during your program’s execution will be cached. However, the ecal.RuntimeCache is only temporary and the next time your program runs it will call the API again.

Persistent on disk caching is provided via ecal.SqliteCache and can be easily enabled by setting ecal.default_cache once before calls to ecal.get():

import ecal
ecal.default_cache = ecal.SqliteCache('ecal.db')

cal_df = ecal.get('2017-03-30')

Extension

ecal is very easy to extend in case you want to support another caching system or even create an earnings announcement fetcher. For more documentation, please see http://ecal.readthedocs.io.

Release files for ecal 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecal 1.0.2
File Size Uploaded
ecal-1.0.2.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ecal 1.0.2
File Interpreter ABI Platform
ecal-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 18.5 kB

Release files / ecal-1.0.2.tar.gz

Download URL ecal-1.0.2.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bf617ecec08df6a114fb0e1cc053d0a96ce0e4ae34bc758dc648a9c2ed9e06d1
BLAKE2b-256 checksum
How to use checksums
051545123a05b1c77a156681cafbfb2ff33630b2d48574329d337627c6a942ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.6

Release files / ecal-1.0.2-py3-none-any.whl

Download URL ecal-1.0.2-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
900b9fea81e7f7f6fa91e61227bbb258c44f47d4546866539b14673aa82136ea
BLAKE2b-256 checksum
How to use checksums
39c3f1a56b8ad5ffdf5d444b37d96bc6c6296c17ad09a2f0b09e628f170814de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.6

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page