Skip to main content

oe-databank

PyPI version GitHub stars

Python expression of Oxford Economics' Databank API.

Installation

pip install oe-databank

Usage

Queries can be sent synchronously or asynchronously.

import asyncio
from oe_databank import (
    DatabankAsyncClient,
    DatabankClient,
    FileDownloadRequestDto,
    FileFormat,
    Frequency,
    ListingType,
    Order,
    Selection,
    SelectionSortOrder,
    SelectionType,
    Sequence,
)

request = FileDownloadRequestDto(
    selections=[
        Selection(
            selectionType=SelectionType.QUERY,
            isTemporarySelection=True,
            databankCode="IST",
            sequence=Sequence.EARLIEST_TO_LATEST,
            groupingMode=False,
            transposeColumns=False,
            order=Order.LOCATION_INDICATOR,
            indicatorSortOrder=SelectionSortOrder.ALPHABETICAL,
            locationSortOrder=SelectionSortOrder.ALPHABETICAL,
            format=0,
            legacyDatafeedFileStructure=False,
            variables=[],
            regions=[],
            listingType=ListingType.SHARED,
            isDataFeed=False,
            startYear=2023,
            endYear=2027,
            precision=5,
            frequency=Frequency.ANNUAL,
            stackedQuarters=False,
        )
    ],
    format=FileFormat.CSV,
    name="test-te-pull",
)

DatabankClient(api_key=...).query(request=request, to_path="sync_result.csv")

asyncio.run(DatabankAsyncClient(api_key=...).query(request=request, to_path="async_result.csv"))

You might run into issues with large downloads, so you can use retry options to handle errors during download.

from oe_databank import DatabankClient

DatabankClient(api_key=...).query(
    request=request,
    to_path="sync_result.csv",
    download_attempts=3,
    download_retry_delay_seconds=2.0,
)

Metadata

Release files for oe-databank 0.2.0

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

Source distribution (sdist)

Source distribution for oe-databank 0.2.0
File Size Uploaded Provenance
oe_databank-0.2.0.tar.gz 39.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for oe-databank 0.2.0
File Interpreter ABI Platform
oe_databank-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 56.1 kB

Release files / oe_databank-0.2.0.tar.gz

Download URL oe_databank-0.2.0.tar.gz
Size 39.5 kB
Tags Source
SHA-256 checksum
How to use checksums
60ae81ff337db7a6e978d2f4fd235bcdffe391332103605cefe2444e18f3021d
BLAKE2b-256 checksum
How to use checksums
f7f1d606b6ce2fc409e8311ae7644ede55af4d8b311f394f1b3ac049d75bfbf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.7

Release files / oe_databank-0.2.0-py3-none-any.whl

Download URL oe_databank-0.2.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb33492a39a19dffd5f7717ad5d72a761bc0619422855bb551ddcd52881c7389
BLAKE2b-256 checksum
How to use checksums
43c318a46745e4404f7ceee73dc991ce1167a68072b3f3ac2e02fcac98ec2427
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.7

Security for oe-databank 0.2.0

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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