Skip to main content

Nielsen Retail Reader

License License
Dependencies PyPI - Version | PyPI - Version | PyPI - Version | PyPI - Version | PyPI - Version
Meta PyPI - Version

Overview:

Nielsen Retail Reader is a special-purpose library and it's main purpose is to facilitate ease of processing of Nielsen Retail Scanner data of Kilt’s Center’s Nielsen IQ data used for Academic research only. The striking feature of this library is Dask which acts as an underlying framework that uniquely empowers the user to read Nielsen data with limited on device resources (by processing larger-than-memory data in chunks and distributed fashion). It understands the Kilts/Nielsen directory structure.

Data:

Information about the Retail Scanner data can be found here: Kilts Center for Marketing

IMPORTANT:

Access to Nielsen Retail Data:

Please note that Nielsen Retail data is proprietary and access is restricted to individuals whose institutions have an existing subscription or agreement with Nielsen. If you intend to use this library for accessing and analyzing Nielsen data, you must first ensure that you are authorized to do so by your institution. Unauthorized access or use of this data may violate terms of use and could have legal implications. Nielsen dataset should strictly follow standard naming convention as per laid out by Nielsen and Kilts Center of Marketing and under no circumstances the naming convention should be changed.

NielsenRetail processes Retail Scanner Data.

Table of Contents

Main Features

Here are just a few of the things that NielsenRetail does well:

  • Efficiently manages Nielsen directory and hierarchy, simplifying the process for researchers and significantly reducing the time needed to navigate through Nielsen documentation.
  • Size mutability: Processes dataframes larger-than-memory on a single machine through batch processing.
  • Distributed computing for terabyte sized datasets enhancing the overall data reading speed by utlising low-latency feature of Dask.
  • Provides simple yet distinct commands for separating sales, stores, and products data for analysis purposes.
  • This package has excellent compatibility with Numpy, Pandas etc.

Where to get it

The source code is currently hosted on GitHub at: https://github.com/pratikrelekar/NielsenDSRS

Binary installers is available at Python Package Index (PyPI)

For PyPI install:

pip install NielsenRetail

For Github pip install:

pip install git+https://github.com/pratikrelekar/NielsenDSRS

For pip install requirements:

python -m pip install -r requirements.txt

Dependencies

Before using NielsenRetail, ensure that all dependencies are correctly installed. Additionally, verify that the Client hosting the Python environment, the Scheduler, and the Worker nodes all have the same version installed.

How to use

For Local on system memory:

from dask.distributed import Client

# # Calculate memory per worker based on total system memory
total_memory_gb = SYSTEM_RAM  # Your system's total RAM in GB (Edit as per system memory)
n_workers = WORKERS         # Number of workers you want to use (Edit the total workers you want)
memory_per_worker_gb = int(total_memory_gb / n_workers)  # Memory per worker in GB

# Start the client with given specifications
client = Client(n_workers=n_workers, threads_per_worker=1, 
                memory_limit=f'{memory_per_worker_gb}GB')
print(client)

To utilize the power of the Dask, using auxilary memory cluster for large data processing

# you can only connect to the cluster from inside Python client environment
from dask.distributed import Client
client = Client('dask-scheduler.default.svc.cluster.local:address') #Replace the address with your actual address of the memory cluster
client

Debug

Make sure the NielsenDSRS module and all the dependencies are installed on Dask Client, Scheduler and Worker nodes. The versions should match on all. Following is the code to debug the errors related to the version mismatch:

For worker nodes:

def check_module():
    try:
        import NielsenDSRS
        return "Installed"
    except ImportError:
        return "Not Installed"

# Run the check across all workers
results = client.run(check_module)
for worker, result in results.items():
    print(f"{worker}: {result}")

For Scheduler:

scheduler_result = client.run_on_scheduler(check_module)
print(f"Scheduler: {scheduler_result}")

For Client:

try:
    import NielsenDSRS
    print("NielsenDSRS is installed on the client.")
except ImportError:
    print("NielsenDSRS is not installed on the client.")

If there is a mismatch or if the NielsenRetail is not correctly installed, follow these steps:

# Function to install NielsenDSRS
def install_nielsendsrs():
    import subprocess
    subprocess.check_call(["pip", "install", "NielsenRetail"])

# Install on all workers
c.run(install_nielsendsrs)

# Install on the scheduler
c.run_on_scheduler(install_nielsendsrs)

License

MIT License

Background

This library was developed at Data Science Research Services(University of Illinois at Urbana-Champaign) in 2024 and has been under active development since then. Currently supports Nielsen Retail Scanner data from 2006 to 2020.

Getting help

For general questions and discussions, visit DSRS mailing list.

Release files for NielsenRetail 0.1.2

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

Source distribution (sdist)

Source distribution for NielsenRetail 0.1.2
File Size Uploaded
nielsenretail-0.1.2.tar.gz 12.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for NielsenRetail 0.1.2
File Interpreter ABI Platform
NielsenRetail-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 24.7 kB

Release files / nielsenretail-0.1.2.tar.gz

Download URL nielsenretail-0.1.2.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b4afd7f1b2be69ab6348eaa6ab5f02190253fbbc039faa14d9c1de71e6b55f45
BLAKE2b-256 checksum
How to use checksums
2cc0bea16f5f240126ce8c8b4df511326943183f886d39f88c95e1228f9a44ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / NielsenRetail-0.1.2-py3-none-any.whl

Download URL NielsenRetail-0.1.2-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ef9b5e660f835d0eaa0a2a5941b3ffb81c8515816cf859136d18f24df9f588e
BLAKE2b-256 checksum
How to use checksums
4863d11d01043a6b840092fc5bacf75efce1df48d8e37d255ac139a2e0d95910
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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