Skip to content

Commit e52b865

Browse files
committed
Update python and add new trick
1 parent 74fd31d commit e52b865

File tree

3 files changed

+91
-51
lines changed

3 files changed

+91
-51
lines changed

.github/workflows/continuous-deployment.yaml

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,74 +3,74 @@ name: Deploy
33
on:
44
push:
55
branches:
6-
- main
6+
- main
77
workflow_dispatch:
88

99
jobs:
1010
build:
1111
name: Build
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v4
1515

16-
- uses: actions/setup-python@v5
17-
with:
18-
python-version: '3.10'
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.13"
1919

20-
- id: install-pipenv
21-
name: Install pipenv
22-
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
23-
shell: bash
20+
- id: install-pipenv
21+
name: Install pipenv
22+
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
23+
shell: bash
2424

25-
- id: install-python-dependencies
26-
name: Install Python dependencies
27-
run: pipenv sync --dev
28-
shell: bash
25+
- id: install-python-dependencies
26+
name: Install Python dependencies
27+
run: pipenv sync --dev
28+
shell: bash
2929

30-
- id: build-sphinx-documentation
31-
name: Build Sphinx documentation
32-
run: |
33-
pipenv run python createconf.py;
34-
pipenv run sphinx-build -b html src _build;
35-
shell: bash
36-
working-directory: docs
37-
env:
38-
LSEG_APP_KEY: ${{ secrets.LSEG_APP_KEY }}
39-
LSEG_USERNAME: ${{ secrets.LSEG_USERNAME }}
40-
LSEG_PASSWORD: ${{ secrets.LSEG_PASSWORD }}
30+
- id: build-sphinx-documentation
31+
name: Build Sphinx documentation
32+
run: |
33+
pipenv run python createconf.py;
34+
pipenv run sphinx-build -b html src _build;
35+
shell: bash
36+
working-directory: docs
37+
env:
38+
LSEG_APP_KEY: ${{ secrets.LSEG_APP_KEY }}
39+
LSEG_USERNAME: ${{ secrets.LSEG_USERNAME }}
40+
LSEG_PASSWORD: ${{ secrets.LSEG_PASSWORD }}
4141

42-
- name: Upload release candidate
43-
uses: actions/upload-artifact@v4
44-
with:
45-
name: release-candidate
46-
path: ./docs/
42+
- name: Upload release candidate
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: release-candidate
46+
path: ./docs/
4747

4848
deploy:
4949
name: Deploy
5050
runs-on: ubuntu-latest
5151
needs: build
5252
steps:
53-
- name: Download release candidate
54-
uses: actions/download-artifact@v4
55-
with:
56-
name: release-candidate
57-
path: ./docs/
53+
- name: Download release candidate
54+
uses: actions/download-artifact@v4
55+
with:
56+
name: release-candidate
57+
path: ./docs/
5858

59-
- id: configure-aws
60-
name: Configure AWS Credentials
61-
uses: aws-actions/configure-aws-credentials@v4
62-
with:
63-
aws-access-key-id: ${{ secrets.PALEWIRE_DOCS_AWS_ACCESS_KEY_ID }}
64-
aws-secret-access-key: ${{ secrets.PALEWIRE_DOCS_AWS_SECRET_ACCESS_KEY }}
65-
aws-region: us-east-1
59+
- id: configure-aws
60+
name: Configure AWS Credentials
61+
uses: aws-actions/configure-aws-credentials@v4
62+
with:
63+
aws-access-key-id: ${{ secrets.PALEWIRE_DOCS_AWS_ACCESS_KEY_ID }}
64+
aws-secret-access-key: ${{ secrets.PALEWIRE_DOCS_AWS_SECRET_ACCESS_KEY }}
65+
aws-region: us-east-1
6666

67-
- id: upload-to-s3
68-
name: Upload documentation to Amazon S3
69-
uses: datadesk/delivery-deploy-action@v1
70-
with:
71-
bucket: ${{ secrets.PALEWIRE_DOCS_AWS_BUCKET }}
72-
base-path: refinitiv-data-python-cookbook/
73-
dir: ./docs/_build/
74-
should-cache: false
75-
use-accelerate-endpoint: false
76-
public: true
67+
- id: upload-to-s3
68+
name: Upload documentation to Amazon S3
69+
uses: datadesk/delivery-deploy-action@v1
70+
with:
71+
bucket: ${{ secrets.PALEWIRE_DOCS_AWS_BUCKET }}
72+
base-path: refinitiv-data-python-cookbook/
73+
dir: ./docs/_build/
74+
should-cache: false
75+
use-accelerate-endpoint: false
76+
public: true

docs/src/economics-next-release.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
jupytext:
3+
text_representation:
4+
extension: .md
5+
format_name: myst
6+
format_version: '0.8'
7+
jupytext_version: '1.4.1'
8+
kernelspec:
9+
display_name: Python 3
10+
language: python
11+
name: python3
12+
---
13+
14+
# Fetching an economic indicator's next release date
15+
16+
```{code-cell}
17+
:tags: [hide-cell]
18+
import warnings
19+
warnings.simplefilter(action='ignore', category=FutureWarning)
20+
21+
import lseg.data as ld
22+
23+
ld.open_session()
24+
```
25+
26+
You can use the [LSEG Data Library for Python](https://pypi.org/project/lseg-data/) to retrieve an economic indicator's next release date by passing the relevant [Refinitiv Instrument Code](https://en.wikipedia.org/wiki/Refinitiv_Identification_Code) to the `get_data` function and requesting the necessary fields.
27+
28+
The `ECI_ACT_DT` field contains the confirmed date when new data will be released. This is the preferred field as it represents the official release schedule. However, this field may not be updated immediately after a release, causing it to show a past date until the next schedule is entered into the system.
29+
30+
The `NDOR_1` field is a forward-looking value that always contains the next scheduled release date. This serves as our fallback when `ECI_ACT_DT` is stale or in the past.
31+
32+
Here's how to retrieve the next release date for the US Consumer Price Index, a monthly inflation indicator released by the US Bureau of Labor Statistics:
33+
34+
```{code-cell}
35+
ld.get_data(
36+
"USCPI=ECI",
37+
fields=["ECI_ACT_DT", "NDOR_1"],
38+
)
39+
```

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,5 @@ Like the LSEG Python client, this cookbook is free. All it requires is a [LSEG W
6363
./economics-monthly-values.md
6464
./economics-weekly-values.md
6565
./economics-time-range.md
66+
./economics-next-release.md
6667
```

0 commit comments

Comments
 (0)