Install python modules from pypi from a previous date in history

Related tags

CLI Tools pip-rewind
Overview

pip-rewind

pip-rewind is a command-line tool that can rewind pypi module versions (given as command-line arguments or read from a requirements.txt file) to a previous date in time.

This tool doesn't install any packages itself - rather, it generates output with modules constrained to specific versions, which can then be fed into pip install.

Usage

new-requirements.txt $ pip install -r new-requirements.txt ">
$ pip-rewind --date "09/01/2020" requests > new-requirements.txt
$ pip install -r new-requirements.txt

Or give it a requirements file:

new-requirements.txt $ pip install -r new-requirements.txt ">
$ pip-rewind --date "07/01/2019" -r requirements.txt > new-requirements.txt
$ pip install -r new-requirements.txt

You can also pipe the output directly to pip if preferred:

$ pip-rewind --date "12/01/2020 -r requirements.txt | pip install -r /dev/stdin

Currently, this package only parses a simple subset of valid requirements lines:

modulename
modulename<=5.0.0
modulename==4.0.0

Any line that describes a pypi dependency named modulename, possibly with a version identifier after, is valid - this tool simply cares about modulename since the version will be rewound anyway. Other lines (such as git dependencies) are ignored.

Motivation

Starting to work on old projects that don't have all their dependencies listed and version-constrained can be difficult (especially when some of those dependencies interact with specific versions of OS packages). The simple existence of a line specifying redis in a requirements.txt file without its version can lead to possible breakage when dealing with month- or year-old software.

LICENSE

MIT

You might also like...
cli simple python script to interact with iphone afc api based on python library( tidevice )
cli simple python script to interact with iphone afc api based on python library( tidevice )

afcclient cli simple python script to interact with iphone afc api based on python library( tidevice ) installation pip3 install -U tidevice cp afccli

Zecwallet-Python is a simple wrapper around the Zecwallet Command Line LightClient written in Python

A wrapper around Zecwallet Command Line LightClient, written in Python Table of Contents About Installation Usage Examples About Zecw

Python command line tool and python engine to label table fields and fields in data files.

Python command line tool and python engine to label table fields and fields in data files. It could help to find meaningful data in your tables and data files or to find Personal identifable information (PII).

xonsh is a Python-powered, cross-platform, Unix-gazing shell
xonsh is a Python-powered, cross-platform, Unix-gazing shell

xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.

A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.
A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.

Cookiecutter A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python

Dead simple CLI tool to try Python packages - It's never been easier! :package:
Dead simple CLI tool to try Python packages - It's never been easier! :package:

try - It's never been easier to try Python packages try is an easy-to-use cli tool to try out Python packages. Features Install specific package versi

Python commandline tool for remembering linux/terminal commands
Python commandline tool for remembering linux/terminal commands

ehh Remember linux commands Commandline tool for remembering linux/terminal commands. It stores your favorite commands in ~/ehh.json in your homedir a

A Telegram Bot Written In Python To Upload Medias To telegra.ph

Telegraph-Uploader A Telegram Bot Written In Python To Upload Medias To telegra.ph DEPLOY YOU CAN SIMPLY DEPLOY ON HEROKU BY CLICKING THE BUTTON BELOW

Rich is a Python library for rich text and beautiful formatting in the terminal.
Rich is a Python library for rich text and beautiful formatting in the terminal.

The Rich API makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more โ€” out of the box.

Comments
  • parsing error on packages with `git+`

    parsing error on packages with `git+`

    Dependency:

    git+https://github.com/ge-semtk/semtk-python3@1b61fffa5557bb5c2f124394934a2e6bcef86538
    

    Raises an unrecoverable error for pip-rewind. Investigate

    Exception ignored in: <generator object requirements_parser at 0x7f6c8badceb0>
    Traceback (most recent call last):
      File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/cli.py", line 39, in main
        version = get_first_version_before(module, args.date)
    RuntimeError: generator ignored GeneratorExit
    Traceback (most recent call last):
      File "/home/Amar1729/.local/bin/pip-rewind", line 8, in <module>
        sys.exit(main())
      File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/cli.py", line 39, in main
        version = get_first_version_before(module, args.date)
      File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/versions.py", line 101, in get_first_version_before
        version = get_first_version_before_rss(pkg, date)
      File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/versions.py", line 53, in get_first_version_before_rss
        for version, release_date in get_versions(pkg):
      File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/versions.py", line 33, in get_versions
        feed = rss_parser.Parser(xml=xml.content).parse()
      File "/home/Amar1729/.local/lib/python3.8/site-packages/rss_parser/_parser.py", line 39, in parse
        "version": main_soup.rss.get("version"),
    AttributeError: 'NoneType' object has no attribute 'get'
    
    opened by Amar1729 1
Releases(v0.1.1)
Owner
Amar Paul
Interested in security, artificial intelligence, quantum computing, physics, and colors
Amar Paul
A simple weather tool. I made this as a way for me to learn Python, API, and PyPi packaging.

A simple weather tool. I made this as a way for me to learn Python, API, and PyPi packaging.

Clint E. 105 Dec 31, 2022
Command-line interface to PyPI Stats API to get download stats for Python packages

pypistats Python 3.6+ interface to PyPI Stats API to get aggregate download statistics on Python packages on the Python Package Index without having t

Hugo van Kemenade 140 Jan 3, 2023
pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery.

pypinfo: View PyPI download statistics with ease. pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery. Installation pypin

Ofek Lev 351 Dec 26, 2022
topalias - Linux alias generator from bash/zsh command history with statistics, written on Python.

topalias topalias - Linux alias generator from bash/zsh command history with statistics, written on Python. Features Generate short alias for popular

Sergey Chudakov 38 May 26, 2022
A python command line tool to calculate options max pain for a given company symbol and options expiry date.

Options-Max-Pain-Calculator A python command line tool to calculate options max pain for a given company symbol and options expiry date. Overview - Ma

null 13 Dec 26, 2022
A simple script that outputs the current date on the user interface/terminal.

Py-Date A simple script that outputs the current date on the user interface/terminal. How to Run > Open your terminal and cd into the folder containi

Arinzechukwu Okoye 1 Jan 13, 2022
CLI helper to install Github releases on your system.

gh-release-install is a CLI helper to install Github releases on your system. It can be used for pretty much anything, to install a formatter in your CI, deploy some binary using an orcherstration tool, or on your desktop.

Jonas L. 28 Nov 6, 2022
commandpack - A package of modules for working with commands, command packages, files with command packages.

commandpack Help the project financially: Donate: https://smartlegion.github.io/donate/ Yandex Money: https://yoomoney.ru/to/4100115206129186 PayPal:

null 4 Sep 4, 2021
๐ŸThe nx-python plugin allows users to create a basic python application using nx commands.

?? NxPy: Nx Python plugin This project was generated using Nx. The nx-python plugin allows users to create a basic python application using nx command

StandUP Communications 74 Aug 31, 2022
Simple Python Library to display text with color in Python Terminal

pyTextColor v1.0 Introduction pyTextColor is a simple Python Library to display colorful outputs in Terminal, etc. Note: Your Terminal or any software

Siddhesh Chavan 1 Jan 23, 2022