Skip to content

Commit 3590472

Browse files
committed
fix readme
1 parent 44c0e50 commit 3590472

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
<p align="center">
44
<i>This repository is part of <a href="https://sdv.dev">The Synthetic Data Vault Project</a>, a project from <a href="https://datacebo.com">DataCebo</a>.</i>
55
</p>
6-
76
<div align="left">
8-
<br/>
97

108
# PyMetrics
11-
129
The PyMetrics project allows you to extract download metrics for Python libraries published on [PyPI](https://pypi.org/) and [Anaconda](https://www.anaconda.com/).
1310

1411
The DataCebo team uses these scripts to report download counts for the libraries in the [SDV ecosystem](https://sdv.dev/) and other libraries.

pymetrics/anaconda.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@
2323
TIME_COLUMN = 'time'
2424
PKG_COLUMN = 'pkg_name'
2525
ANACONDA_BUCKET_PATH = 's3://anaconda-package-data/conda'
26-
ANACONDA_COLUMNS = [
27-
TIME_COLUMN,
28-
'data_source',
29-
PKG_COLUMN,
30-
'pkg_version',
31-
'pkg_platform',
32-
'pkg_python',
33-
'counts',
34-
]
3526

3627

3728
def _read_anaconda_parquet(URL, pkg_names=None):
@@ -188,12 +179,9 @@ def collect_anaconda_downloads(
188179
pkg_names=projects,
189180
)
190181
if len(new_downloads) > 0:
191-
if len(previous) == 0:
192-
previous = new_downloads
193-
else:
194-
# Keep only the newest data (on a per day basis) for all packages
195-
previous = previous[previous[TIME_COLUMN].dt.date != iteration_datetime.date()]
196-
previous = pd.concat([previous, new_downloads], ignore_index=True)
182+
# Keep only the newest data (on a per day basis) for all packages
183+
previous = previous[previous[TIME_COLUMN].dt.date != iteration_datetime.date()]
184+
previous = pd.concat([previous, new_downloads], ignore_index=True)
197185

198186
previous = previous.sort_values(TIME_COLUMN)
199187
LOGGER.info('Obtained %s new downloads', all_downloads_count - len(previous))

pymetrics/output.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ def get_path(folder, filename):
2525
2626
Aware of both local and Google Drive path formats.
2727
"""
28-
if not folder:
29-
return None
30-
3128
if folder.endswith('/'):
3229
folder = folder[:-1]
3330

@@ -167,9 +164,6 @@ def load_csv(csv_path, read_csv_kwargs=None):
167164
pd.DataFrame:
168165
CSV contents.
169166
"""
170-
if not csv_path:
171-
return None
172-
173167
if not csv_path.endswith('.csv'):
174168
csv_path += '.csv'
175169

0 commit comments

Comments
 (0)