Accern Data Library
Client library for consuming Accern data feed API.
PyPI page: Click here
Installation:
pip install accern-data
Sample snippet:
import accern_data
# Create a data client.
client = accern_data.create_data_client("https://api.example.com/", "SomeRandomToken")
# Set a data format/mode in which the data has to be downloaded.
# Split dates lets you divide files on the basis of dates.
client.set_mode(mode="csv", split_dates=True) # Other modes: {"df", "json"}
Set filters:
client.set_filters({
"provider_id": 5,
"entity_name": "Hurco Companies, Inc.",
"event": "Governance - Product Development, R&D and Innovation",
"entity_ticker": "HURC",
"entity_accern_id": "BBG000BLLFK1",
})
Set parameters to the download function:
client.download_range(
start_date="2022-01-03",
output_path=".",
output_pattern="data",
end_date="2022-03-04")
Note: To download single day's data, set end_date=None or can leave that unset:
client.download_range(
start_date="2022-01-03",
output_path=".",
output_pattern="data",
end_date=None)
OR
client.download_range(
start_date="2022-01-03",
output_path=".",
output_pattern="data")
One-liner download:
accern_data.create_data_client("https://api.example.com/", "SomeRandomToken").download_range(start_date="2022-01-03", output_path=".", output_pattern="data", end_date="2022-03-04", mode="csv", filters={"entity_ticker": "HURC"})
Getting data using iterator:
for res in client.iterate_range(
start_date="2022-01-03",
end_date="2022-03-04"):
do_something(res)
Error logging:
While downloading the data any critical error will get raised.
Any non-critical errors, such as API timeouts, get silenced and API calls are repeated. To see a list of the last n errors use:
client.get_last_silenced_errors()
Metadata
Release files for accern-data 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| accern_data-0.2.1.tar.gz | 559.8 kB | Without provenance | Details for accern_data-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| accern_data-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for accern_data-0.2.1-py3-none-any.whl |
Total release size: 1.1 MB
Release files / accern_data-0.2.1.tar.gz
| Download URL | accern_data-0.2.1.tar.gz |
|---|---|
| Size | 559.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5c60c1a1b951495a4b58771b9c9887072934da2e341c04121b079aabbafe25f
|
|
BLAKE2b-256 checksum How to use checksums |
bfd16956a772e806774300221f67de867a4084438f6a6cf3101a0e26496b0485
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.0
|
Release files / accern_data-0.2.1-py3-none-any.whl
| Download URL | accern_data-0.2.1-py3-none-any.whl |
|---|---|
| Size | 579.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9d65c21d85da2b1d9ef0da7fe89eff763e94fafb05767907fd66cdb1e1d09e7
|
|
BLAKE2b-256 checksum How to use checksums |
c1f9516737145f73496707256a6b154a8b135db04db92b645471b8e813c60574
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.0
|
Security for accern-data 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.