semvec/pypi-packages huggingface dataset:
linesample 0.1.1
Utility to randomly sample lines from a file
License: MIT
Requires Python: >=3

# LineSample

Utility to randomly sample lines from an input file.

This module implements a command-line utility that randomly samples lines
from an input file. It is possible to sample lines by the probability of
each line being selected or by giving an overall number of lines. In either
case, the lines can be sampled with a single pass through the file, and the
ordering of lines in the original file is preserved. For reproducibility,
this module also supports seeding of the pseudorandom number generator used.

Only modules from the Python 3 standard library are used in this code. Type
hints (from the typing module), which at the time of writing is still a
provisional API, are also used.

# Installation

Currently, this module is only available for Python 3. You can install it 
with `pip install linesample`.

# Usage

To sample half of all lines from an input file `foo.txt`, run

```
linesample -f0.5 foo.txt
```

To sample up to 100 lines from `bar.txt`, run
```
linesample -n100 bar.txt
```

You must use one of the forms above. Specifying neither or both options will
result in an error.

By default, the utility uses the system time as the seed for its 
pseudorandom number generator. You can choose your own seed using a form 
like this:

```
linesample -s42 -n100 baz.txt
```

For reference, the usage string is as follows:

```
usage: ['linesample.py', '-h'] [-h] [-s SEED] [-f FRACTION | -n NUMBER] infile

positional arguments:
  infile                input file

optional arguments:
  -h, --help            show this help message and exit
  -s SEED, --seed SEED  seed for random number generator
  -f FRACTION, --fraction FRACTION
                        fraction of lines to select
  -n NUMBER, --number NUMBER
                        number of lines to select
```

# License

This module is distributed under the MIT License, whose text is listed both
in the LICENSE file provided with this package and immediately below.

Copyright (c) 2019 Steve Matsumoto

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
knot-keystore 0.1.0
A tool for safely archiving knot dnssec key material to azure.
License: MIT
Requires Python: >=3.6, <4.0

[![PyPI](https://img.shields.io/pypi/v/knot-keystore.svg)](https://pypi.python.org/pypi/knot-keystore)
[![Build Status](https://travis-ci.com/wolcomm/knot-keystore.svg?branch=master)](https://travis-ci.com/wolcomm/knot-keystore)
[![codecov](https://codecov.io/gh/wolcomm/knot-keystore/branch/master/graph/badge.svg)](https://codecov.io/gh/wolcomm/knot-keystore)

# knot-keystore

A tool to safely backup the knot kasp-db directory.

## overview

```bash
usage: knot-keystore [-h] [--socket SOCKET]
                     [--plugins [{local,azure} [{local,azure} ...]]]
                     [--retrieve] [--config-file CONFIG_FILE] [-v]

optional arguments:
  -h, --help            show this help message and exit
  --socket SOCKET, -s SOCKET
                        path to knotc control socket
  --plugins [{local,azure} [{local,azure} ...]], -p [{local,azure} [{local,azure} ...]]
                        select archival plugins
  --retrieve, -r        retrieve archive
  --config-file CONFIG_FILE, -c CONFIG_FILE
                        path to a configuration file
  -v                    increase output verbosity
```

- tries to find the kasp-db path by reading `knotd` config over the control
  socket.
- plugins:
  - create an xz-compressed archive and put it somewhere, safely encrypted (default)
  - retrieve and decrypt the stored archive, ready to restore to the kasp-db
    directory (with `--retrieve`)

## available plugins

- `local`: create an encrypted copy of the archive and write it to disk along
  with the encryption key. Mostly useful for testing.
- `azure`: write the archive to an Azure storage blob, first encrypting it using
  "client-side-encryption" with a KEK stored in Azure Key Vault.
sire 1.0.4
Python project generator
License: MIT

# sire

> *sire* is a command that generates Python 3.7 project templates, with git, travis, mypy (etc.) support.

> Version 1.0.4

[![Build Status](https://travis-ci.org/interrogator/sire.svg?branch=master)](https://travis-ci.org/interrogator/sire)
[![codecov.io](https://codecov.io/gh/interrogator/sire/branch/master/graph/badge.svg)](https://codecov.io/gh/interrogator/sire)
[![readthedocs](https://readthedocs.org/projects/sire/badge/?version=latest)](https://sire.readthedocs.io/en/latest/)
[![PyPI version](https://badge.fury.io/py/sire.svg)](https://badge.fury.io/py/sire)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)

## Install sire

```bash
pip install sire
#or
git clone https://github.com/interrogator/sire && cd sire && python.setup.py install
```

## Usage

```bash
sire --mkdocs --virtualenv --git --exclude=mypy <project_name>
```

## Alternative usages (not recommended)

As Python module:

```bash
python -m sire.sire mkdocs virtualenv <project_name>
```

Or from inside Python (why?):

```python
from sire import sire
sire('project_name', mkdocs=True, virtualenv=True, git=True)
```

### What gets generated

Pure Python:

* `<project_name>/<project_name>.py`
* `<project_name>/__init__.py`
* `setup.py`
* `requirements.txt` (with *black*, *isort*, *flake8* etc)
* `tests/tests.py`

Optional extras:

* mkdocs (`.readthedocs.yaml`, `./docs`, `.mkdocs.yml`)
* irtualenv (with dependencies installed)
* git (`.git`, `.gitignore`, `.pre-commit-config.yaml`)

Each of these has an associated flag:

```bash
sire -v/--virtualenv -m/--mkdocs -g/--git projname
```

Other files

* `.coveragerc`
* `.travis.yml`
* `publish.sh` (a script for running tests and authoring a new version)
* `mypy.ini`
* MIT License
* Empty `CHANGELOG`
* `.bumpversion.cfg`

If you want to skip any of these files, use the `--exclude` option with comma separation:

```bash
sire --exclude=travis,setup.py,mypy projname
```

## Trivia

* *sire* actually generated itself.

## Contributing

I don't really expect many other people to want this, because it's mostly tailored to my specific ideas about how a Pthon project should look. That said, if you do find this projet useful, you are more than welcome to submit pull/feature requests!

There are dozens of possible new features that could be added, which I'd personally quite like:

* a `--license` option, to choose the correct license file
* Setting git remote automatically (get github username from git global config?)
* Deleting irrelevant strings --- if no *codecoverage*, remove the associated badge for example
* Probably more code could be automatically generated and added for the main and test `.py` files

While I'd love to have these in *sire*, coding them will take me longer than doing it manually a few times. So, unless this repo somehow becomes popular or finds some new contributors, don't expect any of this stuff to get done in a hurry, unless you add it yourself.