Skip to main content

A wrapper around the postiliion api

Project description

Postilion

postilion is a wrapper around the publicly available postilion api

Installation

Use the package manager pip to install postilion.

pip install postilion

Usage

Import postilion

import postilion as pst

Destructure classes from module

from pst import Company, Filing, Financial

Get a company by ticker

company = Company.getByTicker('rost')
print(company)
{
  "stats": {
    "lastSyncedFilingsAt": "1990-02-01T00:00:00.000Z",
    "lastSyncedEarningsAt": "1990-02-01T00:00:00.000Z"
  },
  "createdAt": "2019-12-31T00:26:01.473Z",
  "updatedAt": "2019-12-31T00:26:01.473Z",
  "_id": "5e0a9a840736540024ede660",
  "name": "ross stores, inc.",
  "ref": "sec",
  "refId": "0000745732",
  "refIndustryId": "5651",
  "state": "ca",
  "ticker": "rost",
  "__v": 0
}

Get all filings by company

filings = Filing.getByCompany(company['_id'])
print(filings.head())
                        _id       status                 createdAt                 updatedAt  ... source  type                                                url __v
0  5e0a9a880736540024ede667  downloading  2019-12-31T00:26:01.484Z  2019-12-31T00:26:01.484Z  ...    sec  10-K  https://www.sec.gov/Archives/edgar/data/745732...   0
1  5e0a9a880736540024ede666  downloading  2019-12-31T00:26:01.484Z  2019-12-31T00:26:01.484Z  ...    sec  10-K  https://www.sec.gov/Archives/edgar/data/745732...   0
2  5e0a9a870736540024ede665  downloading  2019-12-31T00:26:01.484Z  2019-12-31T00:26:01.484Z  ...    sec  10-K  https://www.sec.gov/Archives/edgar/data/745732...   0
3  5e0a9a870736540024ede664  downloading  2019-12-31T00:26:01.484Z  2019-12-31T00:26:01.484Z  ...    sec  10-K  https://www.sec.gov/Archives/edgar/data/745732...   0
4  5e0a9a860736540024ede663  downloading  2019-12-31T00:26:01.484Z  2019-12-31T00:26:01.484Z  ...    sec  10-K  https://www.sec.gov/Archives/edgar/data/745732...   0

Get supported financial statements

statements = Financial.statements()
print(statements)
['balance-sheet', 'income-statement', 'cash-flow-statement', 'partners-capital-statement', 'financial-services']

Get roles for a financial statement

roles = Financial.roles('balance-sheet')
print(roles)
['StatementOfIncome', 'StatementOfIncomeDiscontinuedOperationsAlternate', 'StatementOfIncomeFirstAlternative', 'StatementOfOtherComprehensiveIncome', 'StatementOfOtherComprehensiveIncomeAlternative', 'StatementOfOtherComprehensiveIncomeFouthAlternative', 'StatementOfOtherComprehensiveIncomeSecondAlternative', 'StatementOfOtherComprehensiveIncomeThirdAlternative', 'ReceivablesLoansNotesReceivableAndOthers', 'ReceivablesLoansNotesReceivableAndOthersLoansAlternate', 'RetirementBenefitsTmp011', 'RetirementBenefitsTmp012', 'RetirementBenefitsTmp02', 'RetirementBenefitsTmp03', 'RetirementBenefitsTmp04', 'RetirementBenefitsTmp041', 'RetirementBenefitsTmp05', 'RetirementBenefitsTmp06', 'RetirementBenefitsTmp07', 'RetirementBenefitsTmp08', 'RetirementBenefitsTmp09']

Coming soon

Get financial statement by ticker, year, statement and [quarter]

statement = Financial.get(
  ticker='rost',
	year=2019,
	statement='income-statement',
	quarter=1
)
print(statement)
Coming soon...

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

postilion-0.0.4-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file postilion-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: postilion-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for postilion-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 705dd1b2287adaca77dffb2b2744f084b8913218e8fc3abd780c549b3722cac8
MD5 25ed3dd89d9e5434a3a78b9c57a0febf
BLAKE2b-256 167a3737dfe55270eeb9725cd8b09d63f17a831fd6017093d54680d5c2732a29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page