Code Monkey home page Code Monkey logo

foundations's Introduction

Foundations

https://secure.travis-ci.org/KelSolaar/Foundations.png?branch=master

https://gemnasium.com/KelSolaar/Foundations.png

Introduction

Foundations is the core package of Oncilla, Color, Manager, Umbra, sIBL_GUI, sIBL_Reporter.It provides modules defining various utilities objects used in those packages.

Installation

The following dependencies are needed:

To install Foundations from the Python Package Index you can issue this command in a shell:

pip install Foundations

or this alternative command:

easy_install Foundations

You can also directly install from Github source repository:

git clone git://github.com/KelSolaar/Foundations.git
cd Foundations
python setup.py install

If you want to build the documentation you will also need:

Usage

Given the large spectrum of the objects defined in Foundations package, please refer to Foundations - Api for precise usage examples about each modules. Here are listed a few non exhaustive usage examples.

  • foundations.dataStructures.Structure:
>>> person = Structure(firstName="Doe", lastName="John", gender="male")
>>> person.firstName
'Doe'
>>> person.keys()
['gender', 'firstName', 'lastName']
>>> person["gender"]
'male'
>>> del(person["gender"])
>>> person["gender"]
Traceback (most recent call last):
  File "<console>", line 1, in <module>
KeyError: 'gender'
>>> person.gender
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'Structure' object has no attribute 'gender'
  • foundations.dataStructures.Lookup:
>>> person = Lookup(firstName="Doe", lastName="John", gender="male")
>>> person.getFirstKeyFromValue("Doe")
'firstName'
>>> persons = foundations.foundations.dataStructures.Lookup(John="Doe", Jane="Doe", Luke="Skywalker")
>>> persons.getKeysFromValue("Doe")
['Jane', 'John']
  • foundations.environment.Environment:
>>> environment = Environment(JOHN="DOE", DOE="JOHN")
>>> environment.setValues()
True
>>> import os
>>> os.environ["JOHN"]
'DOE'
>>> os.environ["DOE"]
'JOHN'
  • foundations.strings.getNiceName:
>>> getNiceName("getMeANiceName")
'Get Me A Nice Name'
>>> getNiceName("__getMeANiceName")
'__Get Me A Nice Name'
  • foundations.strings.getSplitextBasename:
>>> getSplitextBasename("/Users/JohnDoe/Documents/Test.txt")
'Test'
  • foundations.strings.getCommonPathsAncestor:
>>> getCommonPathsAncestor("/Users/JohnDoe/Documents", "/Users/JohnDoe/Documents/Test.txt")
'/Users/JohnDoe/Documents'
  • foundations.walkers.filesWalker:
>>> for file in filesWalker("./foundations/tests/testsFoundations/resources/standard/level_0"):
...     print(file)
...
./foundations/tests/testsFoundations/resources/standard/level_0/level_1/level_2/standard.sIBLT
./foundations/tests/testsFoundations/resources/standard/level_0/level_1/loremIpsum.txt
./foundations/tests/testsFoundations/resources/standard/level_0/level_1/standard.rc
./foundations/tests/testsFoundations/resources/standard/level_0/standard.ibl
>>> for file in filesWalker("./foundations/tests/testsFoundations/resources/standard/level_0", ("\.sIBLT",)):
...     print(file)
...
./foundations/tests/testsFoundations/resources/standard/level_0/level_1/level_2/standard.sIBLT

About

Foundations by Thomas Mansencal – 2008 - 2014
Copyright © 2008 - 2014 – Thomas Mansencal – [email protected]
This software is released under terms of GNU GPL V3 license: http://www.gnu.org/licenses/

foundations's People

Contributors

kelsolaar avatar ralic avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

daveboyd777

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.