This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description

Tools to pop (remove and return) lines from files, with a variety of modes.

This allows you to treat a file on disk as a queue, or to easily strip lines from a file, and many other uses.

Example

[cmd]$ cat test # Show original file

one

two

three

four

five

[cmd]$ popHead 2 test # Remove two lines from head of the file

one

two

[cmd]$ cat test # Show that lines have been removed from file

three

four

five

Modes

The followings modes and their associated command name are given:

Head - popHead [numLines] [filename] - Removes “numLines” from the top of provided “filename”, and prints them on stdout.

Tail - popTail [numLines] [filename] - Removes “numLines” from the bottom of provided “filename”, and prints them on stdout.

Random - popRandom [numLines] [filename] - Removes “numLines” from random positions within provided “filename”, and prints to stdout in a random order.

You can pass the –ordered flag, and the randomly-selected lines will be output in the same order they appear in the file. By default, the random lines will be output in random order.

Range - popRange [start] [stop] (optional: [step]) [filename] - Removes lines using inclusive 1-origin start, stop, and optional step, and prints to stdout. Negative numbers are supported to mean “from the end”, -1 is last line, -2 is second-to-last line.

These - popThese [line1] […lineN] [filename] - Removes specific lines given 1-origin numbers. If numbers are out of range, that number will be ommited. Lines are returned in provided order, and duplicates are allowed. Negative numbers are supported to mean “from the end”.

Peeking

By default, the pop* commands are designed to implement queues, and thus they perform real “pops” and remove the elements extracted from the source file.

If you’d just like to “peek” (extract lines but keep them in the source), add “–peek” when invoking any of the pop* commands.

Module

Functionality is exposed through a module, PopLines, which can perform all the same operations.

Release History

Release History

2.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
popLines-2.0.0.tar.gz (7.5 kB) Copy SHA256 Checksum SHA256 Source Feb 28, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting