Custom Actions for argparse Documentation

Size: px
Start display at page:

Download "Custom Actions for argparse Documentation"

Transcription

1 Custom Actions for argparse Documentation Release 0.4 Hai Vu October 26, 2015

2

3 Contents 1 Introduction 1 2 Information Folder Actions IP Actions Dictionary Action Examples Extending the Custom Actions More Ideas Samples extend_action.py folder_exists.py proper_ip.py dict_action_example.py Indices and tables 9 Python Module Index 11 i

4 ii

5 CHAPTER 1 Introduction The package argparse_actions provides a number of custom actions for use with the argparse module. 1

6 Custom Actions for argparse Documentation, Release Chapter 1. Introduction

7 CHAPTER 2 Information Source Location: bitbucket Package Location: pypi Latest Document: latestdoc 2.1 Folder Actions The folder actions implement folder-related actions. class argparse_actions.folderexistsaction(option_strings, dest, nargs=none, const=none, default=none, type=none, choices=none, required=false, help=none, metavar=none) Custom action: verify the argument to be a folder (directory). If not, raise a NonFolderError exception. The action will strip off trailing slashes from the folder s name. class argparse_actions.foldercreateaction(option_strings, dest, nargs=none, const=none, default=none, type=none, choices=none, required=false, help=none, metavar=none) Custom action: create a new folder if not exist. If the folder already exists, do nothing. The action will strip off trailing slashes from the folder s name. 2.2 IP Actions Below are custom actions which deal with IPv4 addresses class argparse_actions.properipformataction(option_strings, dest, nargs=none, const=none, default=none, type=none, choices=none, required=false, help=none, metavar=none) A custom action, used in conjunction with argparse to validate an IP address. validate_ip(ipvalue) Validate an IP address, generate exception if need be. 3

8 Custom Actions for argparse Documentation, Release Dictionary Action class argparse_actions.dictaction(option_strings, dest, **kwargs) The DictAction class enables parsing the command line as a dictionary. One application is to handle defines such as those offered by g++ 4 Chapter 2. Information

9 CHAPTER 3 Examples The following example, taken from samples/folder_actions.py demonstrates the use of a custom action to verify the existence of a folder, specified from the command line: import argparse import argparse_actions if name == ' main ': parser = argparse.argumentparser(description='custom Actions') parser.add_argument('directory', action=argparse_actions.folderexistsaction) try: args = parser.parse_args() print 'Directory exists: {0}'.format(args.directory) except argparse_actions.nonfoldererror as e: print 'Directory does not exist' print e In the next example from samples/proper_ip.py, we use the ProperIpFormatAction custom action to verify if an IP address from command line is properly formatted: import argparse import argparse_actions if name == ' main ': parser = argparse.argumentparser(description='custom Actions') parser.add_argument('ip', action=argparse_actions.properipformataction) try: args = parser.parse_args() print 'IP is properly formatted: {0}'.format(args.ip) except argparse_actions.invalidip as e: print 'IP is invalid: {0}'.format(e.ip) # This will display similar output: # print e 3.1 Extending the Custom Actions If you find a custom action that almost do what you want, you can 5

10 Custom Actions for argparse Documentation, Release Write your own from scratch 2. Submit an enhancement request 3. Extend the existing custom action I am not commenting on option 1 it is your choice. For option 2, I will be gladly to accept any reasonable request, but sometimes life happens and I might not response quickly enough. That leaves you with the third option of extending the custom action yourself. Don t worry, it is not that hard. In the next example, I will take the ProperIpFormatAction custom action and extend it to include localhost as one of the proper IP format: import argparse import argparse_actions class IpAndLocalhostAction(argparse_actions.ProperIpFormatAction): def call (self, parser, namespace, values, option_string=none): # Do our check: allow for 'localhost' if values == 'localhost': setattr(namespace, self.dest, values) else: # Super class to perform its check parent = super(ipandlocalhostaction, self) parent. call (parser, namespace, values, option_string) if name == ' main ': parser = argparse.argumentparser(description='custom Actions') parser.add_argument('ip', action=ipandlocalhostaction) try: args = parser.parse_args() print 'IP is valid: {0}'.format(args.ip) except argparse_actions.invalidip as e: print e Discussion: The first step is to create a new class (IpAndLocalhostAction), based on an existing custom action (argparse_actions.properipformataction, which is really a class itself) Define the function call to override the base custom action with your own logic. 3.2 More Ideas Here are a few ideas I have in mind, which I might implement: Extend ProperIpFormatAction to determine if and IP... Is reachable Provides some services such as HTTP or FTP Belongs to a particular list, such as the banned IP list Extend FolderExistsAction to determine if the folder is... Writable Empty A symbolic link 6 Chapter 3. Examples

11 CHAPTER 4 Samples 4.1 extend_action.py This sample demonstrates how to extend the existing custom action to add functionality. In this example, we will extend the ProperIpFormatAction class to accept localhost as a proper IP address. Examples: python extend_action.py python extend_action.py localhost 4.2 folder_exists.py This sample demonstrate the FolderExistsAction custom action. Examples: python folder_exists /tmp python folder_exists /foo/bar 4.3 proper_ip.py This sample demonstrate the ProperIpFormatAction custom action. Examples: python proper_ip.py python proper_ip.py dict_action_example.py Simulate a g++ define command line Examples: python dict_action_example -D log_level=debug warning_as_error python dict_action_example -Dverbose -D strict 7

12 Custom Actions for argparse Documentation, Release Chapter 4. Samples

13 CHAPTER 5 Indices and tables genindex modindex search 9

14 Custom Actions for argparse Documentation, Release Chapter 5. Indices and tables

15 Python Module Index init, 3 a argparse_actions, 3 d dict_action, 3 dict_action_example, 7 e extend_action, 7 f folder_actions, 3 folder_exists, 7 i ip_actions, 3 p proper_ip, 7 11

16 Custom Actions for argparse Documentation, Release Python Module Index

17 Index Symbols init (module), 3 A argparse_actions (module), 3 D dict_action (module), 3 dict_action_example (module), 7 DictAction (class in argparse_actions), 4 E extend_action (module), 7 F folder_actions (module), 3 folder_exists (module), 7 FolderCreateAction (class in argparse_actions), 3 FolderExistsAction (class in argparse_actions), 3 I ip_actions (module), 3 P proper_ip (module), 7 ProperIpFormatAction (class in argparse_actions), 3 V validate_ip() (argparse_actions.properipformataction method), 3 13

monolith Documentation

monolith Documentation monolith Documentation Release 0.3.3 Łukasz Balcerzak December 16, 2013 Contents 1 Usage 3 1.1 Execution manager............................................ 3 1.2 Creating commands...........................................

More information

argcomplete Documentation Andrey Kislyuk

argcomplete Documentation Andrey Kislyuk Andrey Kislyuk May 08, 2018 Contents 1 Installation 3 2 Synopsis 5 2.1 argcomplete.autocomplete(parser).................................... 5 3 Specifying completers 7 3.1 Readline-style completers........................................

More information

argcomplete Documentation

argcomplete Documentation argcomplete Documentation Release Andrey Kislyuk Nov 21, 2017 Contents 1 Installation 3 2 Synopsis 5 2.1 argcomplete.autocomplete(parser).................................... 5 3 Specifying completers

More information

IHIH Documentation. Release Romain Dartigues

IHIH Documentation. Release Romain Dartigues IHIH Documentation Release 0.1.1 Romain Dartigues December 11, 2016 Contents 1 Why? 3 2 Table of contents 5 2.1 Source documentation.......................................... 5 2.2 Examples.................................................

More information

Django-Select2 Documentation. Nirupam Biswas

Django-Select2 Documentation. Nirupam Biswas Nirupam Biswas Mar 07, 2018 Contents 1 Get Started 3 1.1 Overview................................................. 3 1.2 Installation................................................ 3 1.3 External Dependencies..........................................

More information

termite Release 0.0.2

termite Release 0.0.2 termite Release 0.0.2 February 16, 2017 Contents 1 Features 3 2 Alternatives 5 3 Why another build tool? 7 4 Requeriments 9 5 Installation 11 5.1 Basic concepts..............................................

More information

bottle-rest Release 0.5.0

bottle-rest Release 0.5.0 bottle-rest Release 0.5.0 February 18, 2017 Contents 1 API documentation 3 1.1 bottle_rest submodule.......................................... 3 2 What is it 5 2.1 REST in bottle..............................................

More information

redis-lua Documentation

redis-lua Documentation redis-lua Documentation Release 2.0.8 Julien Kauffmann October 12, 2016 Contents 1 Quick start 3 1.1 Step-by-step analysis........................................... 3 2 What s the magic at play here?

More information

maya-cmds-help Documentation

maya-cmds-help Documentation maya-cmds-help Documentation Release Andres Weber May 28, 2017 Contents 1 1.1 Synopsis 3 1.1 1.1.1 Features.............................................. 3 2 1.2 Installation 5 2.1 1.2.1 Windows, etc............................................

More information

pygenbank Documentation

pygenbank Documentation pygenbank Documentation Release 0.0.1 Matthieu Bruneaux February 06, 2017 Contents 1 Description 1 2 Contents 3 2.1 Installation................................................ 3 2.2 genbank module.............................................

More information

Confire Documentation

Confire Documentation Confire Documentation Release 0.2.0 Benjamin Bengfort December 10, 2016 Contents 1 Features 3 2 Setup 5 3 Example Usage 7 4 Next Topics 9 5 About 17 Python Module Index 19 i ii Confire is a simple but

More information

Weights and Biases Documentation

Weights and Biases Documentation Weights and Biases Documentation Release 0.6.17 Weights and Biases Aug 13, 2018 Contents 1 Intro 1 2 Quickstart - Existing Project 3 3 Weights & Biases Run API 5 3.1 Saving run files..............................................

More information

CGI Architecture Diagram. Web browser takes response from web server and displays either the received file or error message.

CGI Architecture Diagram. Web browser takes response from web server and displays either the received file or error message. What is CGI? The Common Gateway Interface (CGI) is a set of standards that define how information is exchanged between the web server and a custom script. is a standard for external gateway programs to

More information

Sherlock Documentation

Sherlock Documentation Sherlock Documentation Release 0.3.0 Vaidik Kapoor May 05, 2015 Contents 1 Overview 3 1.1 Features.................................................. 3 1.2 Supported Backends and Client Libraries................................

More information

Introduction to Python Part 2

Introduction to Python Part 2 Introduction to Python Part 2 v0.2 Brian Gregor Research Computing Services Information Services & Technology Tutorial Outline Part 2 Functions Tuples and dictionaries Modules numpy and matplotlib modules

More information

Dogeon Documentation. Release Lin Ju

Dogeon Documentation. Release Lin Ju Dogeon Documentation Release 1.0.0 Lin Ju June 07, 2014 Contents 1 Indices and tables 7 Python Module Index 9 i ii DSON (Doge Serialized Object Notation) is a data-interchange format,

More information

CS 11 python track: lecture 4

CS 11 python track: lecture 4 CS 11 python track: lecture 4 Today: More odds and ends assertions "print >>" syntax more on argument lists functional programming tools list comprehensions More on exception handling More on object-oriented

More information

django-embed-video Documentation

django-embed-video Documentation django-embed-video Documentation Release 0.6.stable Juda Kaleta October 04, 2013 CONTENTS i ii Django app for easy embeding YouTube and Vimeo videos and music from SoundCloud. Repository is located on

More information

Confuse. Release 0.1.0

Confuse. Release 0.1.0 Confuse Release 0.1.0 July 02, 2016 Contents 1 Using Confuse 3 2 View Theory 5 3 Validation 7 4 Command-Line Options 9 5 Search Paths 11 6 Your Application Directory 13 7 Dynamic Updates 15 8 YAML Tweaks

More information

.. Documentation. Release 0.4 beta. Author

.. Documentation. Release 0.4 beta. Author .. Documentation Release 0.4 beta Author May 06, 2015 Contents 1 Browser 3 1.1 Basic usages............................................... 3 1.2 Form manipulation............................................

More information

Argparse Tutorial Release 2.7.9

Argparse Tutorial Release 2.7.9 Argparse Tutorial Release 2.7.9 Guido van Rossum and the Python development team December 10, 2014 Python Software Foundation Email: docs@python.org Contents 1 Concepts 1 2 The basics 2 3 Introducing Positional

More information

Tagalog Documentation

Tagalog Documentation Tagalog Documentation Release 0.3.1 Government Digital Service July 09, 2014 Contents 1 Documentation index 3 1.1 Tagalog commands............................................ 3 1.2 tagalog Package.............................................

More information

Welcome to. Python 2. Session #5. Michael Purcaro, Chris MacKay, Nick Hathaway, and the GSBS Bootstrappers February 2014

Welcome to. Python 2. Session #5. Michael Purcaro, Chris MacKay, Nick Hathaway, and the GSBS Bootstrappers February 2014 Welcome to Python 2 Session #5 Michael Purcaro, Chris MacKay, Nick Hathaway, and the GSBS Bootstrappers February 2014 michael.purcaro@umassmed.edu 1 Building Blocks: modules To more easily reuse code,

More information

About Python. Python Duration. Training Objectives. Training Pre - Requisites & Who Should Learn Python

About Python. Python Duration. Training Objectives. Training Pre - Requisites & Who Should Learn Python About Python Python course is a great introduction to both fundamental programming concepts and the Python programming language. By the end, you'll be familiar with Python syntax and you'll be able to

More information

django-embed-video Documentation

django-embed-video Documentation django-embed-video Documentation Release 0.7.stable Juda Kaleta December 21, 2013 Contents i ii Django app for easy embeding YouTube and Vimeo videos and music from SoundCloud. Repository is located on

More information

Bitdock. Release 0.1.0

Bitdock. Release 0.1.0 Bitdock Release 0.1.0 August 07, 2014 Contents 1 Installation 3 1.1 Building from source........................................... 3 1.2 Dependencies............................................... 3

More information

oemof.db Documentation

oemof.db Documentation oemof.db Documentation Release 0.0.5 Uwe Krien, oemof developing group Mar 20, 2017 Contents 1 Getting started 3 1.1 Installation................................................ 3 1.2 Configuration and

More information

Flask-RESTful Documentation

Flask-RESTful Documentation Flask-RESTful Documentation Release 0.2.1 Kyle Conroy, Ryan Horn, Frank Stratton January 25, 2015 Contents 1 User s Guide 3 1.1 Installation................................................ 3 1.2 Quickstart................................................

More information

solrq Documentation Release Michał Jaworski

solrq Documentation Release Michał Jaworski solrq Documentation Release 1.1.1 Michał Jaworski Mar 27, 2017 Contents 1 solrq 1 2 usage 3 2.1 quick reference.............................................. 4 3 contributing 7 4 testing 9 5 Detailed

More information

Lecture 7. Memory in Python

Lecture 7. Memory in Python Lecture 7 Memory in Python Announcements For This Lecture Readings Reread Chapter 3 No reading for Thursday Lab Work on Assignment Credit when submit A Nothing else to do Assignment Moved to Fri, Sep.

More information

Snakemine: Redmine API wrapper Documentation

Snakemine: Redmine API wrapper Documentation Snakemine: Redmine API wrapper Documentation Release 1.0b1 Mark Lee Sep 27, 2017 Contents 1 Installation 3 2 Example 5 3 License 7 4 Contributing 9 5 Contributors 11 6 API Documentation 13 6.1 Package:

More information

Making Python a better scripting language

Making Python a better scripting language Making Python a better scripting language Nicola Musatti nicola.musatti@gmail.com @NMusatti http://wthwdik.wordpress.com Agenda Why are we here? What is a scripting language? A programming language of

More information

pylatexenc Documentation

pylatexenc Documentation pylatexenc Documentation Release 1.2 Philippe Faist Apr 28, 2017 Contents: 1 Simple Parser for LaTeX Code 3 1.1 The main LatexWalker class....................................... 3 1.2 Exception Classes............................................

More information

Part IV. More on Python. Tobias Neckel: Scripting with Bash and Python Compact Max-Planck, February 16-26,

Part IV. More on Python. Tobias Neckel: Scripting with Bash and Python Compact Max-Planck, February 16-26, Part IV More on Python Compact Course @ Max-Planck, February 16-26, 2015 36 More on Strings Special string methods (excerpt) s = " Frodo and Sam and Bilbo " s. islower () s. isupper () s. startswith ("

More information

python-aspectlib Release 0.4.1

python-aspectlib Release 0.4.1 python-aspectlib 0.4.1 Release 0.4.1 May 03, 2014 Contents i ii aspectlib is an aspect-oriented programming, monkey-patch and decorators library. It is useful when changing behavior in existing code is

More information

drove.io Documentation

drove.io Documentation drove.io Documentation Release 0.1 Andrés J. Díaz November 20, 2014 Contents 1 Installation 3 2 Usage 5 3 Plugins 7 4 Reference 9 4.1 drove................................................... 9 4.2 drove.command.............................................

More information

.. Documentation. Release Author

.. Documentation. Release Author .. Documentation Release 0.4.3 Author May 31, 2015 Contents 1 Browser 3 1.1 Basic usages............................................... 3 1.2 Form manipulation............................................

More information

Final thoughts on functions F E B 2 5 T H

Final thoughts on functions F E B 2 5 T H Final thoughts on functions F E B 2 5 T H Ordering functions in your code Will the following code work? Here the function is defined after the main program that is calling it. print foo() def foo(): return

More information

Ensure Documentation. Release Andrey Kislyuk

Ensure Documentation. Release Andrey Kislyuk Ensure Documentation Release 0.0.1 Andrey Kislyuk Nov 06, 2018 Contents 1 Installation 3 2 Synopsis 5 2.1 Notes................................................... 5 2.2 Raising custom exceptions........................................

More information

Seshat Documentation. Release Joshua P Ashby

Seshat Documentation. Release Joshua P Ashby Seshat Documentation Release 1.0.0 Joshua P Ashby Apr 05, 2017 Contents 1 A Few Minor Warnings 3 2 Quick Start 5 2.1 Contributing............................................... 5 2.2 Doc Contents...............................................

More information

python-aspectlib Release 0.5.0

python-aspectlib Release 0.5.0 python-aspectlib 0.5.0 Release 0.5.0 March 17, 2014 Contents i ii aspectlib is an aspect-oriented programming, monkey-patch and decorators library. It is useful when changing behavior in existing code

More information

Devirtualize Documentation

Devirtualize Documentation Devirtualize Documentation Release 0.1 Adam Schwalm January 25, 2017 Contents 1 The basics 1 1.1 Requirements............................................... 1 1.2 Installation................................................

More information

PySpec Documentation. Release Zac Stewart

PySpec Documentation. Release Zac Stewart PySpec Documentation Release 0.0.1 Zac Stewart May 10, 2014 Contents 1 Contents 3 1.1 Expectations............................................... 3 2 Indices and tables 7 Python Module Index 9 i ii PySpec

More information

FIQL Parser. Release 0.15

FIQL Parser. Release 0.15 FIQL Parser Release 0.15 July 02, 2016 Contents 1 What is FIQL? 3 2 How does FIQL work? 5 3 Installing fiql_parser 7 4 Using fiql_parser 9 4.1 Parsing a FIQL formatted string.....................................

More information

pysharedutils Documentation

pysharedutils Documentation pysharedutils Documentation Release 0.5.0 Joel James August 07, 2017 Contents 1 pysharedutils 1 2 Indices and tables 13 i ii CHAPTER 1 pysharedutils pysharedutils is a convenient utility module which

More information

nidm Documentation Release 1.0 NIDASH Working Group

nidm Documentation Release 1.0 NIDASH Working Group nidm Documentation Release 1.0 NIDASH Working Group November 05, 2015 Contents 1 Why do I want to use this? 3 2 Under Development 5 2.1 Installation................................................ 5 2.2

More information

CSE : Python Programming

CSE : Python Programming CSE 399-004: Python Programming Lecture 2: Data, Classes, and Modules January 22, 2007 http://www.seas.upenn.edu/~cse39904/ Administrative things Teaching assistant Brian Summa (bsumma @ seas.upenn.edu)

More information

Data Structures (list, dictionary, tuples, sets, strings)

Data Structures (list, dictionary, tuples, sets, strings) Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in brackets: l = [1, 2, "a"] (access by index, is mutable sequence) Tuples are enclosed in parentheses: t = (1, 2, "a") (access

More information

django-secure Documentation

django-secure Documentation django-secure Documentation Release 0.1.2 Carl Meyer and contributors January 23, 2016 Contents 1 Quickstart 3 1.1 Dependencies............................................... 3 1.2 Installation................................................

More information

Bibolamazi Documentation

Bibolamazi Documentation Bibolamazi Documentation Release 3.0 Philippe Faist May 31, 2015 Contents 1 Introduction to Bibolamazi 3 1.1 Example Usage Scenario......................................... 3 1.2 Teaser: Features.............................................

More information

django-subdomains Documentation

django-subdomains Documentation django-subdomains Documentation Release 2.1.0 ted kaemming April 29, 2016 Contents 1 Installation 3 2 Quick Start 5 2.1 Example Configuration.......................................... 5 3 Basic Usage

More information

XStatic Documentation

XStatic Documentation XStatic Documentation Release 1.0.1 Thomas Waldmann Sep 18, 2018 Contents 1 What is XStatic 1 1.1 The Idea................................................. 1 1.2 Pros....................................................

More information

dota2api Documentation

dota2api Documentation dota2api Documentation Release 1 Joshua Duffy March 04, 2015 Contents 1 Contents 3 1.1 Installation................................................ 3 1.2 Tutorial..................................................

More information

OBJECT ORIENTED PROGRAMMING 6

OBJECT ORIENTED PROGRAMMING 6 OBJECT ORIENTED PROGRAMMING 6 COMPUTER SCIENCE 61A October 10, 2013 1 Overview This week, you were introduced to the programming paradigm known as Object Oriented Programming. If you ve programmed in a

More information

tld Documentation Release 0.9 Artur Barseghyan

tld Documentation Release 0.9 Artur Barseghyan tld Documentation Release 0.9 Artur Barseghyan Jun 13, 2018 Contents 1 Prerequisites 3 2 Documentation 5 3 Installation 7 4 Usage examples 9 5 Update the list of TLD names

More information

semidbm Documentation

semidbm Documentation semidbm Documentation Release 0.4.0 James Saryerwinnie Jr September 04, 2013 CONTENTS i ii semidbm is a pure python implementation of a dbm, which is essentially a persistent key value store. It allows

More information

Python StatsD Documentation

Python StatsD Documentation Python StatsD Documentation Release 3.2.2 James Socol Dec 15, 2017 Contents 1 Installing 3 2 Contents 5 2.1 Configuring Statsd............................................ 5 2.2 Data Types................................................

More information

django-sticky-uploads Documentation

django-sticky-uploads Documentation django-sticky-uploads Documentation Release 0.2.0 Caktus Consulting Group October 26, 2014 Contents 1 Requirements/Installing 3 2 Browser Support 5 3 Documentation 7 4 Running the Tests 9 5 License 11

More information

spacetrack Documentation

spacetrack Documentation spacetrack Documentation Release 0.13.1 Frazer McLean Feb 03, 2018 Contents 1 Installation 3 1.1 pip.................................................. 3 1.2 Git..................................................

More information

streamio Documentation

streamio Documentation streamio Documentation Release 0.1.0.dev James Mills April 17, 2014 Contents 1 About 3 1.1 Examples................................................. 3 1.2 Requirements...............................................

More information

RIPE Atlas Cousteau Documentation

RIPE Atlas Cousteau Documentation RIPE Atlas Cousteau Documentation Release 1.1 The RIPE Atlas Team February 09, 2016 Contents 1 Contents: 3 1.1 Requirements & Installation....................................... 3 1.2 Use & Examples.............................................

More information

zope.location Documentation

zope.location Documentation zope.location Documentation Release 4.0 Zope Foundation Contributors January 28, 2015 Contents 1 Using zope.location 3 1.1 Location................................................ 3 1.2 inside()................................................

More information

Easy-select2 Documentation

Easy-select2 Documentation Easy-select2 Documentation Release 1.2.2 Lobanov Stanislav aka asyncee September 15, 2014 Contents 1 Installation 3 2 Quickstart 5 3 Configuration 7 4 Usage 9 5 Reference 11 5.1 Widgets..................................................

More information

pymodbustcp Documentation

pymodbustcp Documentation pymodbustcp Documentation Release 0.1.6 Loïc Lefebvre May 14, 2018 Contents 1 Quick start guide 1 1.1 Overview of the package......................................... 1 1.2 Package setup..............................................

More information

micawber Documentation

micawber Documentation micawber Documentation Release 0.3.4 charles leifer Nov 29, 2017 Contents 1 examples 3 2 integration with web frameworks 5 2.1 Installation................................................ 5 2.2 Getting

More information

yagmail Documentation

yagmail Documentation yagmail Documentation Release 0.10.189 kootenpv Feb 08, 2018 Contents 1 API Reference 3 1.1 Authentication.............................................. 3 1.2 SMTP Client...............................................

More information

CS2304: Python for Java Programmers. CS2304: Advanced Function Topics

CS2304: Python for Java Programmers. CS2304: Advanced Function Topics CS2304: Advanced Function Topics Functions With An Arbitrary Number of Parameters Let s say you wanted to create a function where you don t know the exact number of parameters. Python gives you a few ways

More information

OstrichLib Documentation

OstrichLib Documentation OstrichLib Documentation Release 0.0.0 Itamar Ostricher May 10, 2016 Contents 1 utils package 3 1.1 collections utils module......................................... 3 1.2 path utils module.............................................

More information

dragonfluid Documentation

dragonfluid Documentation dragonfluid Documentation Release 0.9.0.a5 Charles J. Daniels September 25, 2015 Contents 1 Welcome to dragonfluid! 3 1.1 About................................................... 3 1.2 It s Not For Everyone..........................................

More information

Exception Handling. Genome 559

Exception Handling. Genome 559 Exception Handling Genome 559 Review - classes Use your own classes to: - package together related data - conceptually organize your code - force a user to conform to your expectations Class constructor:

More information

InfluxDB Documentation

InfluxDB Documentation InfluxDB Documentation Release 4.1.1 John Shahid Sep 13, 2017 Contents 1 Contents 3 1.1 InfluxDB-Python............................................. 3 1.1.1 InfluxDB-Python........................................

More information

Dodo Commands Documentation

Dodo Commands Documentation Dodo Commands Documentation Release 0.2.1 Maarten Nieber Apr 04, 2019 Contents 1 Goals of the Dodo Commands system 3 1.1 Provide a per-project environment.................................... 3 1.2 Single

More information

CS 11 python track: lecture 3. n Today: Useful coding idioms

CS 11 python track: lecture 3. n Today: Useful coding idioms CS 11 python track: lecture 3 Today: Useful coding idioms Useful coding idioms "Idiom" Standard ways of accomplishing a common task Using standard idioms won't make your code more correct, but more concise

More information

tapi Documentation Release 0.1 Jimmy John

tapi Documentation Release 0.1 Jimmy John tapi Documentation Release 0.1 Jimmy John July 02, 2014 Contents 1 Why use TAPI? 3 2 Features 5 3 Dependencies 7 4 Installation 9 5 Quick Start 11 6 User Guide 13 6.1 Fundamentals...............................................

More information

JSONRPC Documentation

JSONRPC Documentation JSONRPC Documentation Release 1.0 Edward Langley March 29, 2016 Contents 1 Getting Started 3 2 JSON-RPC Server 5 3 JSON-RPC Proxy 7 4 jsonrpc.jsonutil 9 5 Indices and tables 11 Python Module Index 13

More information

Mastering Python Decorators

Mastering Python Decorators Mastering Python Decorators One of the hallmarks of good Python is the judicious use of decorators to optimize, simplify and add new functionality to existing code. Decorators are usually seen as an advanced

More information

traitlets Documentation

traitlets Documentation traitlets Documentation Release 5.0.0.dev The IPython Development Team Dec 08, 2017 Contents 1 Using Traitlets 3 1.1 Default values, and checking type and value............................... 3 1.2 observe..................................................

More information

PyCPUID Documentation

PyCPUID Documentation PyCPUID Documentation Release 0.5 Bram de Greve March 13, 2016 Contents 1 Introduction 3 1.1 Installation.............................................. 3 1.2 Source Code.............................................

More information

txzmq Documentation Release Andrey Smirnov

txzmq Documentation Release Andrey Smirnov txzmq Documentation Release 0.8.0 Andrey Smirnov Apr 21, 2017 Contents 1 Installation 3 1.1 Requirements............................................... 3 1.2 MacOS X.................................................

More information

Class extension and. Exception handling. Genome 559

Class extension and. Exception handling. Genome 559 Class extension and Exception handling Genome 559 Review - classes 1) Class constructors - class MyClass: def init (self, arg1, arg2): self.var1 = arg1 self.var2 = arg2 foo = MyClass('student', 'teacher')

More information

CIS192 Python Programming

CIS192 Python Programming CIS192 Python Programming Generators Exceptions and IO Eric Kutschera University of Pennsylvania February 13, 2015 Eric Kutschera (University of Pennsylvania) CIS 192 February 13, 2015 1 / 24 Outline 1

More information

Meta Classes. Chapter 4

Meta Classes. Chapter 4 Chapter 4 Meta Classes Python classes are also objects, with the particularity that these can create other objects (their instances). Since classes are objects, we can assign them to variables, copy them,

More information

json-rpc Documentation

json-rpc Documentation json-rpc Documentation Release 1.11.0 Kirill Pavlov May 02, 2018 Contents 1 Features 3 2 Contents 5 2.1 Quickstart................................................ 5 2.2 Method dispatcher............................................

More information

Django Service Objects Documentation

Django Service Objects Documentation Django Service Objects Documentation Release 0.5.0 mixxorz, c17r Sep 11, 2018 User Documentation 1 What? 1 2 Installation 3 2.1 Philosophy................................................ 3 2.2 Usage...................................................

More information

Pemrograman Jaringan Web Client Access PTIIK

Pemrograman Jaringan Web Client Access PTIIK Pemrograman Jaringan Web Client Access PTIIK - 2012 In This Chapter You'll learn how to : Download web pages Authenticate to a remote HTTP server Submit form data Handle errors Communicate with protocols

More information

django-oauth2-provider Documentation

django-oauth2-provider Documentation django-oauth2-provider Documentation Release 0.2.7-dev Alen Mujezinovic Aug 16, 2017 Contents 1 Getting started 3 1.1 Getting started.............................................. 3 2 API 5 2.1 provider.................................................

More information

TH IRD EDITION. Python Cookbook. David Beazley and Brian K. Jones. O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo

TH IRD EDITION. Python Cookbook. David Beazley and Brian K. Jones. O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo TH IRD EDITION Python Cookbook David Beazley and Brian K. Jones O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo Table of Contents Preface xi 1. Data Structures and Algorithms 1 1.1. Unpacking

More information

Python StatsD Documentation

Python StatsD Documentation Python StatsD Documentation Release 2.0.3 James Socol January 03, 2014 Contents i ii statsd is a friendly front-end to Graphite. This is a Python client for the statsd daemon. Quickly, to use: >>> import

More information

django-conduit Documentation

django-conduit Documentation django-conduit Documentation Release 0.0.1 Alec Koumjian Apr 24, 2017 Contents 1 Why Use Django-Conduit? 3 2 Table of Contents 5 2.1 Filtering and Ordering.......................................... 5

More information

APT Session 2: Python

APT Session 2: Python APT Session 2: Python Laurence Tratt Software Development Team 2017-10-20 1 / 17 http://soft-dev.org/ What to expect from this session: Python 1 What is Python? 2 Basic Python functionality. 2 / 17 http://soft-dev.org/

More information

Python Statsd Documentation

Python Statsd Documentation Python Statsd Documentation Release 1.0 Rick van Hattem April 14, 2012 CONTENTS i ii Python Statsd Documentation, Release 1.0 Contents: CONTENTS 1 Python Statsd Documentation, Release 1.0 2 CONTENTS CHAPTER

More information

Class extension and. Exception handling. Genome 559

Class extension and. Exception handling. Genome 559 Class extension and Exception handling Genome 559 Review - classes 1) Class constructors - class myclass: def init (self, arg1, arg2): self.var1 = arg1 self.var2 = arg2 foo = myclass('student', 'teacher')

More information

Kong Documentation. Release Hong Minhee

Kong Documentation. Release Hong Minhee Kong Documentation Release 0.1.0 Hong Minhee August 18, 2014 Contents 1 kong Tofu implementation 3 1.1 kong.ast Abstract Syntax Tree.................................. 3 1.2 kong.parser Tofu parser.....................................

More information

e24paymentpipe Documentation

e24paymentpipe Documentation e24paymentpipe Documentation Release 1.2.0 Burhan Khalid Oct 30, 2017 Contents 1 e24paymentpipe 3 1.1 Features.................................................. 3 1.2 Todo...................................................

More information

django-slim Documentation

django-slim Documentation django-slim Documentation Release 0.5 Artur Barseghyan December 24, 2013 Contents i ii django-slim Contents 1 2 Contents CHAPTER 1 Description Simple implementation of multi-lingual

More information

Python Call Graph. Release Gerald Kaszuba

Python Call Graph. Release Gerald Kaszuba Python Call Graph Release 1.0.1 Gerald Kaszuba Sep 21, 2017 Contents 1 Screenshots 3 2 Project Status 5 3 Features 7 4 Quick Start 9 5 Documentation Index 11 5.1 Usage Guide...............................................

More information

TAIL RECURSION, SCOPE, AND PROJECT 4 11

TAIL RECURSION, SCOPE, AND PROJECT 4 11 TAIL RECURSION, SCOPE, AND PROJECT 4 11 COMPUTER SCIENCE 61A Noveber 12, 2012 1 Tail Recursion Today we will look at Tail Recursion and Tail Call Optimizations in Scheme, and how they relate to iteration

More information

CSE : Python Programming. Decorators. Announcements. The decorator pattern. The decorator pattern. The decorator pattern

CSE : Python Programming. Decorators. Announcements. The decorator pattern. The decorator pattern. The decorator pattern CSE 399-004: Python Programming Lecture 12: Decorators April 9, 200 http://www.seas.upenn.edu/~cse39904/ Announcements Projects (code and documentation) are due: April 20, 200 at pm There will be informal

More information

yarl Documentation Release Andrew Svetlov

yarl Documentation Release Andrew Svetlov yarl Documentation Release 1.2.0- Andrew Svetlov Apr 30, 2018 Contents 1 Introduction 3 2 Installation 5 3 Dependencies 7 4 API documentation 9 5 Comparison with other URL libraries 11 6 Source code 13

More information

https://lambda.mines.edu Object oriented programming is a type of programming with objects that maintain internal state and pass messages between each other. First appeared in the mid-1960s in Simula:

More information