Skip to main content

Extra python libraries for scaffolding server scripts.

Project description

extra python modules for server script scaffolding

https://travis-ci.org/hbradleyiii/ext_pylib.svg?branch=master https://www.quantifiedcode.com/api/v1/project/b9f8a6c7f3724ee4896e7cd8d2a865aa/badge.svg

This is a work in progress. Use at your own risk.

ext_pylib is a group of submodules that are useful scaffolding for other larger projects. I began developing it after noticing how often I was repeating several patterns for server scripts. It works well for building server scripts.

Installing and Including in projects

Installing ext_pylib

$ git clone git@github.com:hbradleyiii/ext_pylib.git
$ cd <project directory>
$ pip install -e .

Running Tests

$ cd <project directory>
$ py.test

Modules

Domain Module

TODO

Files Module

A class to manage and create files. Also includes three mixin classes Parsable, Section, and Template.

Section Mixin

The Section mixin adds methods useful for processing template section files. A section file is a template of a configuration file that only represents a particular section of that file. It begins and ends with a delineator

For example:

## START:SECTION_NAME ##
content here...
## END:SECTION_NAME ##

A use case would be how WordPress delineates a particular section of the htaccess file in its root directory with a start line and an end line. This is a section of the full htaccess file and could be managed by a Section mixin.

Template Mixin

The Template mixin adds a method useful for processing a regular template file: apply_using(). It assumes that the file contains placeholder text to be replaced by actual data. The placeholders and actual data are passsed into the method as a dict. The resulting data is returned (presumably to be saved in another file.) #### Parsable Mixin

The Parsable mixin adds a method useful for parsing (presumably) configuration files. It takes a dict of attribute names and regexes to be used. When setup_parsing() is called, a dynamic property is created for getting and setting a value in self.data based on the regex.

Password Module

TODO

Prompt Module

TODO

User Module

TODO


Soli Deo gloria.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

ext_pylib-0.1.tar.gz (19.0 kB view details)

Uploaded Source

File details

Details for the file ext_pylib-0.1.tar.gz.

File metadata

  • Download URL: ext_pylib-0.1.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ext_pylib-0.1.tar.gz
Algorithm Hash digest
SHA256 f80032fd9f588f84524479030420b31749f04d6243080366f48e8e7f3c1ddf14
MD5 f38820a0699d7d7d6ca250f116012db9
BLAKE2b-256 5e6dc7d4e26d0c83315ec060999423e23c0b18d335e7b540ba99cfc81c82b003

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page