<jupyter_start><jupyter_text>ABS Retail Turnover 8501 Table of Contents1&nbsp;&nbsp;Python set-up2&nbsp;&nbsp;Get data from ABS3&nbsp;&nbsp;Plot4&nbsp;&nbsp;Finished  Python set-up<jupyter_code># system imports
import sys
import pathlib
import calendar

# analytic imports
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt

# local imports
from finalise_plot import finalise_plot
from abs_common import (
    get_fs_constants,
    get_plot_constants,
    get_ABS_meta_and_data,
    get_identifier
)

# pandas display settings
pd.options.display.max_rows = 999
pd.options.display.max_columns = 999

# plotting stuff
plt.style.use('ggplot')
catalogue_id = '8501'
source, CHART_DIR, META_DATA = get_fs_constants(catalogue_id)<jupyter_output><empty_output><jupyter_text>Get data from ABS<jupyter_code># do the data capture and extraction
abs = get_ABS_meta_and_data(catalogue_id)
if abs is None:
    sys.exit(-1)<jupyter_output>Retrieving zip-file from cache ./ABS_CACHE/-statistics-industry-retail-and-wholesale-trade-retail-trade-australia-feb-2021-All-Time-Series-Spreadsheets.zip<jupyter_text>Plot<jupyter_code>meta = abs[META_DATA]
RECENT, plot_times, plot_tags = get_plot_constants(meta)
table = '1'
df = abs[table]
plots = meta[meta['Table'] == table]['Data Item Description'].unique()

series_type = "Seasonally Adjusted"

for plot in plots:
    series, units = get_identifier(meta, plot,
                           series_type, table)
    
    for start, tag in zip(plot_times, plot_tags):
        frame = df[df.index >= start] if start else df
        ax = frame[series].plot(lw=2)
        title = f"Retail Trade: {plot}".replace(" ;  Total (State) ; ", "")
        title = title.replace(" ;", "")
        finalise_plot(ax, title, units, tag, CHART_DIR,
                      rfooter=f'{source}s {table}',
                      lfooter=f'From {series_type.lower()} series')<jupyter_output><empty_output><jupyter_text>Finished<jupyter_code>print('Finished')<jupyter_output>Finished
{'fraction_non_alphanumeric': 0.11023622047244094, 'fraction_numerical': 0.012303149606299213, 'mean_word_length': 4.509485094850948, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '510647', 'license': 'MIT', 'n_tokens_mistral': 731, 'n_tokens_neox': 699, 'n_words': 148, 'path': 'notebooks/ABS Monthly Retail Turnover 8501.ipynb', 'repo_name': 'bpalmer4/Charts-based-on-ABS-data', 'size': '2032'}