Skip to main content

Library of Wonderful Things

Project description

A library of wonderful things!

Motivation

This library is born from my version of the utils library everyone makes. Only, instead of being utils that are specific to the task, these utils are for programming in general: They assume logs should be structured, all data should be JSONizable, and OO is preferred, and more.

Python is a Little Crufty

Python is awesome now, but it was originally a procedural language invented before pure functional semantics, before OO, and even before the discovery of vowels. As a consequence there are many procedures that alter their own parameters, or have disemvoweled names. This library puts a facade over these relics of the past and uses convention to name methods.

Specifics

Installing pyLibrary

Python packages are easy to install, assuming you have Python (see below).

pip install pyLibrary

Installing for Development

  • Download from Github:

    git clone https://github.com/klahnakoski/pyLibrary.git
  • Install requirements:

    python setup.py develop

Windows 7 Install Instructions for Python

Updated November 2014, for Python 2.7.8

Python was really made for Linux, and installation will be easier there. Technically, Python works on Windows too, but there are a few gotchas you can avoid by following these instructions.

  • Download Python 2.7

    • 32bit ONLY!!! Many native libs are 32 bit

    • Varsion 2.7.8 or higher (includes pip, so install is easier)

  • Install Python at c:\Python27 (The space in the “Program Files” may screw up installs of native libs)

  • Add to you path: c:\Python27;c:\Python27\scripts;

  • Download https://bootstrap.pypa.io/get-pip.py

    CALL python get-pip.py
    CALL pip install virtualenv
  • Many “Python Powered” native installs require a pointer to the python installation, but they have no idea where to look in 64bit windows. You must alter the registry (http://stackoverflow.com/questions/3652625/installing-setuptools-on-64-bit-windows):

    SET HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath = "C:\Python27"

Using virtualenv

virtualenv allows you to have multiple python projects on the same machine, even if they use different versions of the same libraries. virtualenv does this by making a copy of the main python directory and using it to hold the specific versions required.

  • New environment: virtualenv <name_of_dir>

  • Activate environment: <name_of_dir>\scripts\activate

  • Exit environment: deactivate

If you have more than one project on your dev box I suggest you do all your work inside a virtual environment.

PyPy and Virtual Environments

virtualenv can be used with PyPy, but it is a bit more involved. The paths must be explict, and some copying is required.

New environment:

The first call to virtualenv will make the directory, to which you copy the PyPy core libraries, and the second call finishes the install.

c:\PyPy27\bin\virtualenv <name_of_dir>
copy c:\PyPy27\bin\lib_pypy <name_of_dir>
copy c:\PyPy27\bin\lib_python <name_of_dir>
c:\PyPy27\bin\virtualenv <name_of_dir>

Activate environment:

With CPython virtualenv places it’s executables in Scripts. The PyPy version uses bin

<name_of_dir>\bin\activate

Using PIP in PyPy:

PyPy does not share any libraries with CPython. You must install the PyPy libraries using

C:\pypy\bin\pip.exe

The pip found in your %PATH% probably points to C:\python27\Scripts\pip.exe.

Using PIP in PyPy virtualenv:

Do NOT use the <name_of_dir>\Scripts directory: It installs to your main PyPy installation. Pip install is done using the bin directory:

<name_of_dir>\bin\pip.exe

Exit environment:

Deactivation is like normal

deactivate

CPython Binaries and Virtual Environments

If you plan to use any binary packages, virtualenv will not work directly. Instead, install the binary (32 bit only!!) to the main python installation. Then copy any newly installed files/directories from C:\Python27\Lib\site-packages to <name_of_dir>\Lib\site-packages.

Binaries and PyPy

This strategy for installing binaries into Virtual Environments is almost identical to installing binaries into your PyPy environment: Install Numpy and Scipy to your CPython installation using a windows installer (which has pre-compiled binaries), and then copy the C:\Python27\Lib\site-packages\<package> to c:\PyPy\site-packages\; note lack of Lib subdirectory.

Project details


Download files

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

Source Distribution

pyLibrary-0.9.16319.zip (466.0 kB view details)

Uploaded Source

Built Distributions

pyLibrary-0.9.16319.win-amd64-py2.7.exe (684.7 kB view details)

Uploaded Source

pyLibrary-0.9.16319-py2.7.egg (1.0 MB view details)

Uploaded Source

File details

Details for the file pyLibrary-0.9.16319.zip.

File metadata

  • Download URL: pyLibrary-0.9.16319.zip
  • Upload date:
  • Size: 466.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyLibrary-0.9.16319.zip
Algorithm Hash digest
SHA256 d45817311d97c89fb79403bc868b02b81ac180d0d8d781c88a6ad29236abf9b5
MD5 238bb787b2f7653a10c9a3d9cc86daed
BLAKE2b-256 de53c2659adeae9e1ec4e35416e263671ee0192cfc8667a8ee5915d12fb1f3f8

See more details on using hashes here.

File details

Details for the file pyLibrary-0.9.16319.win-amd64-py2.7.exe.

File metadata

File hashes

Hashes for pyLibrary-0.9.16319.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 2e8a7cc6d905d9c73418bc80334480f0fc72790ac6725d713cdd71660176e636
MD5 4ba414c1cb0e095356ceb1e12b06e06d
BLAKE2b-256 a1fa45d5c8234777f892e102dcf2f597df32833f64d3429a009580ae0bf7c54a

See more details on using hashes here.

File details

Details for the file pyLibrary-0.9.16319-py2.7.egg.

File metadata

File hashes

Hashes for pyLibrary-0.9.16319-py2.7.egg
Algorithm Hash digest
SHA256 f9492865c2390a2d4db002bd31d8c3e6d7d4f7e8069ed47339b89edb0be3252b
MD5 cf8f59c65047fd42c732fdc118f44cc0
BLAKE2b-256 df32de248436ff8c7ce267f8742bb8673f5755f39968a14eae2a558e59918b7e

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