imsciences 0.9.5.4__py3-none-any.whl → 0.9.5.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of imsciences might be problematic. Click here for more details.

imsciences/unittesting.py CHANGED
@@ -3,7 +3,6 @@ import pandas as pd
3
3
  import numpy as np
4
4
  import os
5
5
  from mmm import dataprocessing
6
- import plotly.graph_objects as go
7
6
 
8
7
  class TestDataProcessor(unittest.TestCase):
9
8
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imsciences
3
- Version: 0.9.5.4
3
+ Version: 0.9.5.6
4
4
  Summary: IMS Data Processing Package
5
5
  Author: IMS
6
6
  Author-email: cam@im-sciences.com
@@ -24,6 +24,7 @@ Requires-Dist: yfinance
24
24
  Requires-Dist: holidays
25
25
  Requires-Dist: google-analytics-data
26
26
  Requires-Dist: geopandas
27
+ Requires-Dist: geopy
27
28
 
28
29
  # IMS Package Documentation
29
30
 
@@ -35,23 +36,34 @@ The **Independent Marketing Sciences** package is a Python library designed to p
35
36
  - Seamless data processing for time series workflows.
36
37
  - Aggregation, filtering, and transformation of time series data.
37
38
  - Visualising Data
38
- - Integration with external data sources like FRED, Bank of England, ONS and OECD.
39
+ - Integration with external data sources like FRED, Bank of England and ONS.
39
40
 
40
41
  ---
41
42
 
42
43
  Table of Contents
43
44
  =================
44
45
 
45
- 1. [Data Processing for Time Series](#data-processing-for-time-series)
46
- 2. [Data Processing for Incrementality Testing](#data-processing-for-incrementality-testing)
47
- 3. [Data Visualisations](#data-visualisations)
48
- 4. [Data Pulling](#data-pulling)
49
- 5. [Installation](#installation)
50
- 6. [Usage](#usage)
46
+ 1. [Usage](#usage)
47
+ 2. [Data Processing for Time Series](#data-processing-for-time-series)
48
+ 3. [Data Processing for Incrementality Testing](#data-processing-for-incrementality-testing)
49
+ 4. [Data Visualisations](#data-visualisations)
50
+ 5. [Data Pulling](#data-pulling)
51
+ 6. [Installation](#installation)
51
52
  7. [License](#license)
53
+ 8. [Roadmap](#roadmap)
52
54
 
53
55
  ---
54
56
 
57
+ ## Usage
58
+
59
+ ```bash
60
+ from imsciences import dataprocessing, geoprocessing, datapull, datavis
61
+ ims_proc = dataprocessing()
62
+ ims_geo = geoprocessing()
63
+ ims_pull = datapull()
64
+ ims_vis = datavis()
65
+ ```
66
+
55
67
  ## Data Processing for Time Series
56
68
 
57
69
  ## 1. `get_wd_levels`
@@ -239,14 +251,14 @@ Table of Contents
239
251
  - **Example**: `pull_ga('GeoExperiment-31c5f5db2c39.json', '111111111', '2023-10-15', 'United Kingdom', ['totalUsers', 'newUsers'])`
240
252
 
241
253
  ## 2. `process_itv_analysis`
242
- - **Description**: Pull in GA4 data for geo experiments.
243
- - **Usage**: `process_itv_analysis(self, raw_df, itv_path, cities_path, media_spend_path, output_path, group1, group2)`
244
- - **Example**: `process_itv_analysis(df, 'itv regional mapping.csv', 'Geo_Mappings_with_Coordinates.xlsx', 'IMS.xlsx', 'itv_for_test_analysis_itvx.csv', ['West', 'Westcountry', 'Tyne Tees'], ['Central Scotland', 'North Scotland'])`
254
+ - **Description**: Processes region-level data for geo experiments by mapping ITV regions, grouping selected metrics, merging with media spend data, and saving the result.
255
+ - **Usage**: `process_itv_analysis(self, raw_df, itv_path, cities_path, media_spend_path, output_path, test_group, control_group, columns_to_aggregate, aggregator_list)`
256
+ - **Example**: `process_itv_analysis(df, 'itv regional mapping.csv', 'Geo_Mappings_with_Coordinates.xlsx', 'IMS.xlsx', 'itv_for_test_analysis_itvx.csv', ['West', 'Westcountry', 'Tyne Tees'], ['Central Scotland', 'North Scotland'], ['newUsers', 'transactions'], ['sum', 'sum'])`
245
257
 
246
258
  ## 3. `process_city_analysis`
247
- - **Description**: Processes city-level data for geo experiments by grouping user metrics, merging with media spend data, and saving the result.
248
- - **Usage**: `process_city_analysis(raw_df, spend_df, output_path, group1, group2, response_column)`
249
- - **Example**: `process_city_analysis(df, spend, output, ['Barnsley'], ['Aberdeen'], 'newUsers')`
259
+ - **Description**: Processes city-level data for geo experiments by grouping selected metrics, merging with media spend data, and saving the result.
260
+ - **Usage**: `process_city_analysis(raw_df, spend_df, output_path, test_group, control_group, columns_to_aggregate, aggregator_list)`
261
+ - **Example**: `process_city_analysis(df, spend, output, ['Barnsley'], ['Aberdeen'], ['newUsers', 'transactions'], ['sum', 'sum'])`
250
262
 
251
263
  ---
252
264
 
@@ -298,8 +310,8 @@ Table of Contents
298
310
 
299
311
  ## 6. `pull_weather`
300
312
  - **Description**: Fetch and process historical weather data for the specified country.
301
- - **Usage**: `pull_weather(week_commencing, country)`
302
- - **Example**: `pull_weather('mon', 'GBR')`
313
+ - **Usage**: `pull_weather(week_commencing, start_date, country)`
314
+ - **Example**: `pull_weather('mon', '2020-01-01', 'GBR')`
303
315
 
304
316
  ## 7. `pull_macro_ons_uk`
305
317
  - **Description**: Fetch and process time series data from the Beta ONS API.
@@ -311,6 +323,11 @@ Table of Contents
311
323
  - **Usage**: `pull_yfinance(tickers, week_start_day)`
312
324
  - **Example**: `pull_yfinance(['^FTMC', '^IXIC'], 'mon')`
313
325
 
326
+ ## 9. `pull_sports_events`
327
+ - **Description**: Pull a veriety of sports events primaraly football and rugby.
328
+ - **Usage**: `pull_sports_events(start_date, week_commencing)`
329
+ - **Example**: `pull_sports_events('2020-01-01', 'mon')`
330
+
314
331
  ---
315
332
 
316
333
  ## Installation
@@ -323,20 +340,16 @@ pip install imsciences
323
340
 
324
341
  ---
325
342
 
326
- ## Usage
343
+ ## License
327
344
 
328
- ```bash
329
- from imsciences import *
330
- ims_proc = dataprocessing()
331
- ims_geo = geoprocessing()
332
- ims_pull = datapull()
333
- ims_vis = datavis()
334
- ```
345
+ This project is licensed under the MIT License. ![License](https://img.shields.io/badge/license-MIT-blue.svg)
335
346
 
336
347
  ---
337
348
 
338
- ## License
349
+ ## Roadmap
339
350
 
340
- This project is licensed under the MIT License. ![License](https://img.shields.io/badge/license-MIT-blue.svg)
351
+ - [Fixes]: Naming conventions are inconsistent/ have changed from previous seasonality tools (eg. 'seas_nyd' is named 'seas_new_years_day', 'week_1' is named 'seas_1')
352
+ - [Fixes]: Naming conventions can be inconsistent within the data pull (suffix on some var is 'gb' on some it is 'uk' and for others there is no suffix) - furthermore, there is a lack of consistency for global holidays/events (Christmas, Easter, Halloween, etc) - some have regional suffix and others don't.
353
+ - [Additions]: Need to add new data pulls for more macro and seasonal varibles
341
354
 
342
355
  ---
@@ -5,18 +5,18 @@ imsciences/__init__.py,sha256=_HuYeLbDMTdt7GpKI4r6-d7yRPZgcAQ7yOW0-ydR2Yo,117
5
5
  imsciences/datafunctions-IMS-24Ltp-3.py,sha256=3Snv-0iE_03StmyjtT-riOU9f4v8TaJWLoyZLJp6l8Y,141406
6
6
  imsciences/datafunctions.py,sha256=WZrXNLO-SYrCuFt0pAbha74psMOZPY7meWJ7yWEbRpk,169953
7
7
  imsciences/datapull.py,sha256=TPY0LDgOkcKTBk8OekbD0Grg5x0SomAK2dZ7MuT6X1E,19000
8
- imsciences/geo.py,sha256=J8AkLk1Nyty3VBkPFqcseXjtlSvXVNkHW_nymERz3nA,13472
8
+ imsciences/geo.py,sha256=-UVQQG8lpUJSos_MjYoKArgPWivD7lFEG5oxF9AGDQg,17526
9
9
  imsciences/mmm.py,sha256=w2A90eJPvMH0Mp3jh8booKaLGm0BKFqW-H92FR4OpV8,80490
10
- imsciences/pull.py,sha256=bGz8B7bBQ5b9hrx3ipCFTWl_eebEb7rPL4dANKiVWTY,74015
11
- imsciences/unittesting.py,sha256=DYGqVCsZHrs_tZ-EXDW8q8CdlcsTnG8HsnmWjEE521c,45691
10
+ imsciences/pull.py,sha256=8j4k9hnQ9IuxY8W_PvO6afutPm4Pz_SJRjZfU47qxX0,81654
11
+ imsciences/unittesting.py,sha256=U177_Txg0Lqn49zYRu5bl9OVe_X7MkNJ6V_Zd6DHOsU,45656
12
12
  imsciences/vis.py,sha256=2izdHQhmWEReerRqIxhY4Ai10VjL7xoUqyWyZC7-2XI,8931
13
13
  imsciencesdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
14
14
  imsciencesdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
15
15
  imsdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
16
16
  imsdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
17
- imsciences-0.9.5.4.dist-info/LICENSE.txt,sha256=lVq2QwcExPX4Kl2DHeEkRrikuItcDB1Pr7yF7FQ8_z8,1108
18
- imsciences-0.9.5.4.dist-info/METADATA,sha256=wCS5rgCM0s3XEwXIPZCwBpaej5PxebfgHB1MaKy-5us,17644
19
- imsciences-0.9.5.4.dist-info/PKG-INFO-IMS-24Ltp-3,sha256=yqZbigwHjnYoqyI81PGz_AeofRFfOrwH_Vyawyef-mg,854
20
- imsciences-0.9.5.4.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
21
- imsciences-0.9.5.4.dist-info/top_level.txt,sha256=hsENS-AlDVRh8tQJ6-426iUQlla9bPcGc0-UlFF0_iU,11
22
- imsciences-0.9.5.4.dist-info/RECORD,,
17
+ imsciences-0.9.5.6.dist-info/LICENSE.txt,sha256=lVq2QwcExPX4Kl2DHeEkRrikuItcDB1Pr7yF7FQ8_z8,1108
18
+ imsciences-0.9.5.6.dist-info/METADATA,sha256=ZGduN0X7DpyEAu3CC1QqZVpQsNITjObWk7Iml-7m5FI,18846
19
+ imsciences-0.9.5.6.dist-info/PKG-INFO-IMS-24Ltp-3,sha256=yqZbigwHjnYoqyI81PGz_AeofRFfOrwH_Vyawyef-mg,854
20
+ imsciences-0.9.5.6.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
21
+ imsciences-0.9.5.6.dist-info/top_level.txt,sha256=hsENS-AlDVRh8tQJ6-426iUQlla9bPcGc0-UlFF0_iU,11
22
+ imsciences-0.9.5.6.dist-info/RECORD,,