Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow yyyy-mm for -sd & -ed, add --month shortcut #71

Merged
merged 2 commits into from
Oct 7, 2019

Conversation

hugovk
Copy link
Collaborator

@hugovk hugovk commented Mar 18, 2019

Fixes #61.

  • Allow yyyy-mm for --start-date and --end-date, which map on to the first day of the month for --start-date and the last day for --end-date.

  • Add --month as shortcut to --start-date and --end-date for a single month

These three are equivalent:

$ pypinfo --test --start-date 2018-04-01 --end-date 2018-04-30 setuptools
$ pypinfo --test --start-date 2018-04 --end-date 2018-04 setuptools
$ pypinfo --test --month 2018-04 setuptools

Each outputs:

SELECT
  COUNT(*) as download_count,
FROM
  TABLE_DATE_RANGE(
    [the-psf:pypi.downloads],
    TIMESTAMP("2018-04-01 00:00:00"),
    TIMESTAMP("2018-04-30 23:59:59")
  )
WHERE
  file.project = "setuptools"
  AND details.installer.name = "pip"
ORDER BY
  download_count DESC
LIMIT 10

@codecov
Copy link

codecov bot commented Mar 18, 2019

Codecov Report

Merging #71 into master will increase coverage by 4.22%.
The diff coverage is 97.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage   66.14%   70.37%   +4.22%     
==========================================
  Files           5        5              
  Lines         257      297      +40     
  Branches       35       35              
==========================================
+ Hits          170      209      +39     
- Misses         87       88       +1
Impacted Files Coverage Δ
tests/test_core.py 100% <100%> (ø) ⬆️
pypinfo/core.py 61.29% <95%> (+3.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48d56e6...3bc6182. Read the comment docs.

@hugovk
Copy link
Collaborator Author

hugovk commented Sep 30, 2019

Will merge this next month if no objections. Thanks!

suv27 pushed a commit to suv27/pypinfo that referenced this pull request Oct 5, 2019
@hugovk hugovk merged commit bdb71ae into ofek:master Oct 7, 2019
@hugovk hugovk deleted the yyyy-mm branch October 7, 2019 06:38
REestwick pushed a commit to REestwick/pypinfo that referenced this pull request Apr 1, 2024
Allow yyyy-mm for -sd & -ed, add --month shortcut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new option start-month (or: allow incomplete date YYYY-MM)
1 participant